diff --git a/src/api/manage.ts b/src/api/manage.ts index fbdcb48..29fbc23 100644 --- a/src/api/manage.ts +++ b/src/api/manage.ts @@ -1,3 +1,4 @@ +import { Firmware, FirmwareQueryParam, FirmwareUploadParam } from '/@/types/device-firmware' import request, { CommonListResponse, IListWorkspaceResponse, IPage, IWorkspaceResponse } from '/@/api/http/request' import { Device } from '/@/types/device' @@ -150,7 +151,7 @@ export const updateDeviceHms = async function (workspace_id: string, device_sn: } export const getDeviceHms = async function (body: HmsQueryBody, workspace_id: string, pagination: IPage): Promise> { - let url = `${HTTP_PREFIX}/devices/${workspace_id}/devices/hms?page=${pagination.page}&page_size=${pagination.page_size}` + + let url = `${HTTP_PREFIX}/devices/${workspace_id}/devices/hms?page=${pagination.page}&page_size=${pagination.page_size}` + `&level=${body.level ?? ''}&begin_time=${body.begin_time ?? ''}&end_time=${body.end_time ?? ''}&message=${body.message ?? ''}&language=${body.language}` body.sns.forEach((sn: string) => { if (sn !== '') { @@ -165,4 +166,23 @@ export const changeLivestreamLens = async function (body: {}): Promise> { + const url = `${HTTP_PREFIX}/workspaces/${workspace_id}/firmwares?page=${page.page}&page_size=${page.page_size}` + + `&device_name=${body.device_name}&product_version=${body.product_version}&status=${body.firmware_status ?? ''}` + const result = await request.get(url) + return result.data +} + +export const importFirmareFile = async function (workspaceId: string, param: FormData): Promise> { + const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/firmwares/file/upload` + const result = await request.post(url, param) + return result.data +} + +export const changeFirmareStatus = async function (workspaceId: string, firmwareId: string, param: {status: boolean}): Promise> { + const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/firmwares/${firmwareId}` + const result = await request.put(url, param) + return result.data } \ No newline at end of file diff --git a/src/api/media.ts b/src/api/media.ts index 9a03ef5..634bd13 100644 --- a/src/api/media.ts +++ b/src/api/media.ts @@ -15,12 +15,11 @@ export const downloadMediaFile = async function (workspaceId: string, fileId: st if (result.data.type === 'application/json') { const reader = new FileReader() reader.onload = function (e) { - let text = reader.result as string + const text = reader.result as string const result = JSON.parse(text) message.error(result.message) } reader.readAsText(result.data, 'utf-8') - return } else { return result.data } diff --git a/src/api/wayline.ts b/src/api/wayline.ts index dfbeef3..ec579dc 100644 --- a/src/api/wayline.ts +++ b/src/api/wayline.ts @@ -72,6 +72,9 @@ export interface Task { code: number, // 错误码 rth_altitude: number // 相对机场返航高度 20 - 500 out_of_control_action: OutOfControlAction // 失控动作 + media_count: number // 媒体数量 + uploading:boolean // 是否正在上传媒体 + uploaded_count: number // 已上传媒体数量 } // Get Wayline Jobs @@ -104,3 +107,10 @@ export const importKmzFile = async function (workspaceId: string, file: {}): Pro }) return result.data } + +// 媒体立即上传 +export const uploadMediaFileNow = async function (workspaceId: string, jobId: string): Promise> { + const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/jobs/${jobId}/media-highest` + const result = await request.post(url) + return result.data +} diff --git a/src/components/common/topbar.vue b/src/components/common/topbar.vue index 02423e4..4f0bff3 100644 --- a/src/components/common/topbar.vue +++ b/src/components/common/topbar.vue @@ -63,7 +63,8 @@ const workspaceName = ref('') const options = [ { key: 0, label: ERouterName.WORKSPACE.charAt(0).toUpperCase() + ERouterName.WORKSPACE.substr(1), path: '/' + ERouterName.WORKSPACE }, { key: 1, label: ERouterName.MEMBERS.charAt(0).toUpperCase() + ERouterName.MEMBERS.substr(1), path: '/' + ERouterName.MEMBERS }, - { key: 2, label: ERouterName.DEVICES.charAt(0).toUpperCase() + ERouterName.DEVICES.substr(1), path: '/' + ERouterName.DEVICES } + { key: 2, label: ERouterName.DEVICES.charAt(0).toUpperCase() + ERouterName.DEVICES.substr(1), path: '/' + ERouterName.DEVICES }, + { key: 3, label: ERouterName.FIRMWARES.charAt(0).toUpperCase() + ERouterName.FIRMWARES.substr(1), path: '/' + ERouterName.FIRMWARES }, ] const selected = ref(root.$route.path) diff --git a/src/components/devices/DeviceFirmwareStatus.vue b/src/components/devices/DeviceFirmwareStatus.vue new file mode 100644 index 0000000..7102b35 --- /dev/null +++ b/src/components/devices/DeviceFirmwareStatus.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/task/TaskPanel.vue b/src/components/task/TaskPanel.vue index 339c189..5b70155 100644 --- a/src/components/task/TaskPanel.vue +++ b/src/components/task/TaskPanel.vue @@ -10,14 +10,6 @@
{{ formatTaskTime(record.end_time) }}
- - - - + + + + + +