| | |
| | | return result.data |
| | | } |
| | | |
| | | // Edit Wayline File by name |
| | | export const renameWaylineFile = async function (workspaceId: string, fileId: string, fileName: string) : Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/wayline_update` |
| | | const result = await request.put(url, null, { params: { waylineId: fileId, name: fileName } }) |
| | | return result.data |
| | | } |
| | | |
| | | export interface waylineJob { |
| | | name: string |
| | | fileId: string |
| | |
| | | try { |
| | | let body = undefined as any |
| | | if (params.action !== undefined) { |
| | | body = { |
| | | action: params.action |
| | | if (params.cmd === DeviceCmd.SdrWorkModeSwitch) { |
| | | body = { |
| | | link_workmode: params.action |
| | | } |
| | | } else { |
| | | body = { |
| | | action: params.action |
| | | } |
| | | } |
| | | } |
| | | const { code, message: msg } = await postSendCmd({ dock_sn: params.sn, device_cmd: params.cmd }, body) |
| | |
| | | |
| | | let rightClickHandler: Cesium.ScreenSpaceEventHandler |
| | | const addRightClick = (sid: string, cb: Function) => { |
| | | if (leftClickHandler) { |
| | | if (rightClickHandler) { |
| | | removeRightClickEvent() |
| | | } |
| | | rightClickHandler = new Cesium.ScreenSpaceEventHandler(viewer?.scene.canvas) |
| | |
| | | import { message } from 'ant-design-vue' |
| | | import { onMounted, UnwrapRef, reactive, ref } from 'vue' |
| | | import routeEdit from './components/route-edit/index.vue' |
| | | import { deleteWaylineFile, downloadWaylineFile, getWaylineFiles, importKmzFile, getWayLineFile } from '/@/api/wayline' |
| | | import { deleteWaylineFile, downloadWaylineFile, getWaylineFiles, importKmzFile, getWayLineFile, renameWaylineFile } from '/@/api/wayline' |
| | | import { ELocalStorageKey, ERouterName } from '/@/types' |
| | | import { EDeviceType } from '/@/types/device' |
| | | import { useMyStore } from '/@/store' |
| | |
| | | editVisible.value = true |
| | | } |
| | | |
| | | const handleEditName = () => { |
| | | const handleEditName = async () => { |
| | | const renameRes = await renameWaylineFile(workspaceId.value, currentWayLine.value.id, currentWayLine.value.name) |
| | | if (renameRes.code !== 0) return message.error(renameRes.message) |
| | | message.success('修改文件名成功') |
| | | editVisible.value = false |
| | | } |
| | | </script> |