Merge branch 'master' of http://139.196.74.78:10010/r/drone/drone-web-manage
| | |
| | | * |
| | | * Copyright (c) 2024 by shuishen, All Rights Reserved. |
| | | */ |
| | | import request from '@/axios'; |
| | | import request from '@/axios' |
| | | |
| | | import { ELocalStorageKey } from '@/types'; |
| | | import { ELocalStorageKey } from '@/types' |
| | | |
| | | const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId) || ''; |
| | | const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId) || '' |
| | | |
| | | export const putDeviceProps = (deviceSn, body) => { |
| | | return request({ |
| | | url: `/drone-device-core/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/property`, |
| | | method: 'put', |
| | | body, |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | /** |
| | | * 设置调色盘 |
| | | * @param {机场编码} deviceSn |
| | | * @param {*} body |
| | | * @returns |
| | | */ |
| | | export const setThermalCurrentPaletteStyle = (deviceSn, workspaceId, body) => { |
| | | return request({ |
| | | // /manage/api/v1/devices/selectDevicePage |
| | | url: `/drone-device-core/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/setThermalCurrentPaletteStyle`, |
| | | method: 'put', |
| | | body, |
| | | }) |
| | | } |
| | |
| | | import { EDeviceTypeName } from '@/types'; |
| | | import { EDeviceTypeName } from '@/types' |
| | | |
| | | const initStateFunc = () => ({ |
| | | Layers: [ |
| | |
| | | currentSn: '', |
| | | currentType: -1, |
| | | }, |
| | | videoSurveillance: {}, // 视频监控相关信息 |
| | | osdVisible: { |
| | | // osd 显示设备相关信息 |
| | | sn: '', |
| | |
| | | selectedAction: undefined, |
| | | kmzPath: '', |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | const mutations = { |
| | | SET_LAYER_INFO(state, info) { |
| | | state.Layers = info; |
| | | // 获取视频相关信息 |
| | | SAVE_VIDEO_SURVEILLANCE_INFO (state, info) { |
| | | console.log('videoSurveillanceInfo', info) |
| | | state.videoSurveillance = info |
| | | }, |
| | | SET_DEVICE_INFO(state, info) { |
| | | state.deviceState.deviceInfo[info.sn] = info.host; |
| | | state.deviceState.currentSn = info.sn; |
| | | state.deviceState.currentType = EDeviceTypeName.Aircraft; |
| | | SET_LAYER_INFO (state, info) { |
| | | state.Layers = info |
| | | }, |
| | | SET_GATEWAY_INFO(state, info) { |
| | | state.deviceState.gatewayInfo[info.sn] = info.host; |
| | | state.deviceState.currentSn = info.sn; |
| | | state.deviceState.currentType = EDeviceTypeName.Gateway; |
| | | SET_DEVICE_INFO (state, info) { |
| | | state.deviceState.deviceInfo[info.sn] = info.host |
| | | state.deviceState.currentSn = info.sn |
| | | state.deviceState.currentType = EDeviceTypeName.Aircraft |
| | | }, |
| | | SET_DOCK_INFO(state, info) { |
| | | SET_GATEWAY_INFO (state, info) { |
| | | state.deviceState.gatewayInfo[info.sn] = info.host |
| | | state.deviceState.currentSn = info.sn |
| | | state.deviceState.currentType = EDeviceTypeName.Gateway |
| | | }, |
| | | SET_DOCK_INFO (state, info) { |
| | | if (Object.keys(info.host).length === 0) { |
| | | return; |
| | | return |
| | | } |
| | | if (!state.deviceState.dockInfo[info.sn]) { |
| | | state.deviceState.dockInfo[info.sn] = {}; |
| | | state.deviceState.dockInfo[info.sn] = {} |
| | | } |
| | | state.deviceState.currentSn = info.sn; |
| | | state.deviceState.currentType = EDeviceTypeName.Dock; |
| | | const dock = state.deviceState.dockInfo[info.sn]; |
| | | state.deviceState.currentSn = info.sn |
| | | state.deviceState.currentType = EDeviceTypeName.Dock |
| | | const dock = state.deviceState.dockInfo[info.sn] |
| | | if (info.host.mode_code !== undefined) { |
| | | dock.basic_osd = info.host; |
| | | return; |
| | | dock.basic_osd = info.host |
| | | return |
| | | } |
| | | if (info.host.sdr) { |
| | | dock.link_osd = info.host; |
| | | return; |
| | | dock.link_osd = info.host |
| | | return |
| | | } |
| | | if (info.host.job_number !== undefined) { |
| | | dock.work_osd = info.host; |
| | | dock.work_osd = info.host |
| | | } |
| | | }, |
| | | SET_HMSInfo_DetailSn(state, data) { |
| | | state.hmsInfoDetailSn = data; |
| | | SET_HMSInfo_DetailSn (state, data) { |
| | | state.hmsInfoDetailSn = data |
| | | }, |
| | | SET_DRAW_VISIBLE_INFO(state, bool) { |
| | | state.drawVisible = bool; |
| | | SET_DRAW_VISIBLE_INFO (state, bool) { |
| | | state.drawVisible = bool |
| | | }, |
| | | SET_MAP_ELEMENT_CREATE(state, info) { |
| | | state.wsEvent.mapElementCreat = info; |
| | | SET_MAP_ELEMENT_CREATE (state, info) { |
| | | state.wsEvent.mapElementCreat = info |
| | | }, |
| | | SET_MAP_ELEMENT_UPDATE(state, info) { |
| | | state.wsEvent.mapElementUpdate = info; |
| | | SET_MAP_ELEMENT_UPDATE (state, info) { |
| | | state.wsEvent.mapElementUpdate = info |
| | | }, |
| | | SET_MAP_ELEMENT_DELETE(state, info) { |
| | | state.wsEvent.mapElementDelete = info; |
| | | SET_MAP_ELEMENT_DELETE (state, info) { |
| | | state.wsEvent.mapElementDelete = info |
| | | }, |
| | | SET_DEVICE_ONLINE(state, info) { |
| | | state.deviceStatusEvent.deviceOnline = info; |
| | | SET_DEVICE_ONLINE (state, info) { |
| | | state.deviceStatusEvent.deviceOnline = info |
| | | }, |
| | | SET_DEVICE_OFFLINE(state, info) { |
| | | state.deviceStatusEvent.deviceOffline = info; |
| | | delete state.deviceState.gatewayInfo[info.sn]; |
| | | delete state.deviceState.deviceInfo[info.sn]; |
| | | delete state.deviceState.dockInfo[info.sn]; |
| | | delete state.hmsInfo[info.sn]; |
| | | SET_DEVICE_OFFLINE (state, info) { |
| | | state.deviceStatusEvent.deviceOffline = info |
| | | delete state.deviceState.gatewayInfo[info.sn] |
| | | delete state.deviceState.deviceInfo[info.sn] |
| | | delete state.deviceState.dockInfo[info.sn] |
| | | delete state.hmsInfo[info.sn] |
| | | // delete state.markerInfo.coverMap[info.sn] |
| | | // delete state.markerInfo.pathMap[info.sn] |
| | | }, |
| | | SET_OSD_VISIBLE_INFO(state, info) { |
| | | state.osdVisible = info; |
| | | SET_OSD_VISIBLE_INFO (state, info) { |
| | | state.osdVisible = info |
| | | }, |
| | | SET_SELECT_WAYLINE_INFO(state, info) { |
| | | state.waylineInfo = info; |
| | | SET_SELECT_WAYLINE_INFO (state, info) { |
| | | state.waylineInfo = info |
| | | }, |
| | | SET_SELECT_DOCK_INFO(state, info) { |
| | | state.dockInfo = info; |
| | | SET_SELECT_DOCK_INFO (state, info) { |
| | | state.dockInfo = info |
| | | }, |
| | | SET_DEVICE_HMS_INFO(state, info) { |
| | | const hmsList = state.hmsInfo[info.sn]; |
| | | state.hmsInfo[info.sn] = info.host.concat(hmsList ?? []); |
| | | SET_DEVICE_HMS_INFO (state, info) { |
| | | const hmsList = state.hmsInfo[info.sn] |
| | | state.hmsInfo[info.sn] = info.host.concat(hmsList ?? []) |
| | | }, |
| | | SET_DEVICES_CMD_EXECUTE_INFO(state, info) { |
| | | SET_DEVICES_CMD_EXECUTE_INFO (state, info) { |
| | | // 保存设备指令ws消息推送 |
| | | if (!info.sn) { |
| | | return; |
| | | return |
| | | } |
| | | if (state.devicesCmdExecuteInfo[info.sn]) { |
| | | const index = state.devicesCmdExecuteInfo[info.sn].findIndex( |
| | | cmdExecuteInfo => cmdExecuteInfo.biz_code === info.biz_code |
| | | ); |
| | | ) |
| | | if (index >= 0) { |
| | | // 丢弃前面的消息 |
| | | if (state.devicesCmdExecuteInfo[info.sn][index].timestamp > info.timestamp) { |
| | | return; |
| | | return |
| | | } |
| | | state.devicesCmdExecuteInfo[info.sn][index] = info; |
| | | state.devicesCmdExecuteInfo[info.sn][index] = info |
| | | } else { |
| | | state.devicesCmdExecuteInfo[info.sn].push(info); |
| | | state.devicesCmdExecuteInfo[info.sn].push(info) |
| | | } |
| | | } else { |
| | | state.devicesCmdExecuteInfo[info.sn] = [info]; |
| | | state.devicesCmdExecuteInfo[info.sn] = [info] |
| | | } |
| | | }, |
| | | SET_MQTT_STATE(state, mqttState) { |
| | | state.mqttState = mqttState; |
| | | SET_MQTT_STATE (state, mqttState) { |
| | | state.mqttState = mqttState |
| | | }, |
| | | SET_CLIENT_ID(state, clientId) { |
| | | state.clientId = clientId; |
| | | SET_CLIENT_ID (state, clientId) { |
| | | state.clientId = clientId |
| | | }, |
| | | // 设置wayline中的信息 |
| | | SET_WAYLINE_INFO(state, { isShow, selectedPoint, selectedAction }) { |
| | | isShow !== undefined && (state.waylineTool.isShow = isShow); |
| | | state.waylineTool.selectedPoint = selectedPoint; |
| | | selectedAction !== undefined && (state.waylineTool.selectedAction = selectedAction); |
| | | SET_WAYLINE_INFO (state, { isShow, selectedPoint, selectedAction }) { |
| | | isShow !== undefined && (state.waylineTool.isShow = isShow) |
| | | state.waylineTool.selectedPoint = selectedPoint |
| | | selectedAction !== undefined && (state.waylineTool.selectedAction = selectedAction) |
| | | }, |
| | | SET_WAYLINE_KMZPATH(state, kmzPath) { |
| | | state.waylineTool.kmzPath = kmzPath; |
| | | SET_WAYLINE_KMZPATH (state, kmzPath) { |
| | | state.waylineTool.kmzPath = kmzPath |
| | | }, |
| | | }; |
| | | } |
| | | |
| | | const actions = { |
| | | updateElement({ state }, content) { |
| | | const key = content.id.replaceAll('resource__', ''); |
| | | const type = content.type; |
| | | const layers = state.Layers; |
| | | const layer = layers.find(item => item.id === key); |
| | | updateElement ({ state }, content) { |
| | | const key = content.id.replaceAll('resource__', '') |
| | | const type = content.type |
| | | const layers = state.Layers |
| | | const layer = layers.find(item => item.id === key) |
| | | if (layer) { |
| | | layer[type] = content.bool; |
| | | layer[type] = content.bool |
| | | } |
| | | }, |
| | | |
| | | getLayerInfo({ state }, id) { |
| | | return state.layerBaseInfo[id]; |
| | | getLayerInfo ({ state }, id) { |
| | | return state.layerBaseInfo[id] |
| | | }, |
| | | }; |
| | | } |
| | | |
| | | const device = { |
| | | state: initStateFunc, |
| | | mutations, |
| | | actions, |
| | | }; |
| | | } |
| | | |
| | | export default device; |
| | | export default device |
| | |
| | | export let ERouterName; |
| | | (function (ERouterName) { |
| | | ERouterName['ELEMENT'] = 'element'; |
| | | ERouterName['LOGIN'] = 'login'; |
| | | ERouterName['PROJECT'] = 'project'; |
| | | ERouterName['ADD_PROJECT'] = 'add_project'; |
| | | ERouterName['EDIT_PROJECT'] = 'edit_project'; |
| | | ERouterName['PROJECT_LIST'] = 'project_list'; |
| | | ERouterName['HOME'] = 'home'; |
| | | ERouterName['TSA'] = 'tsa'; |
| | | ERouterName['LAYER'] = 'layer'; |
| | | ERouterName['MEDIA'] = 'media'; |
| | | ERouterName['WAYLINE'] = 'wayline'; |
| | | ERouterName['LIVESTREAM'] = 'livestream'; |
| | | ERouterName['LIVING'] = 'living'; |
| | | ERouterName['WORKSPACE'] = 'workspace'; |
| | | ERouterName['MEMBERS'] = 'members'; |
| | | ERouterName['DEVICES'] = 'devices'; |
| | | ERouterName['TASK'] = 'task'; |
| | | ERouterName['CREATE_PLAN'] = 'create-plan'; |
| | | ERouterName['SELECT_PLAN'] = 'select-plan'; |
| | | ERouterName['FIRMWARES'] = 'firmwares'; |
| | | ERouterName['PILOT'] = 'pilot-login'; |
| | | ERouterName['PILOT_HOME'] = 'pilot-home'; |
| | | ERouterName['PILOT_MEDIA'] = 'pilot-media'; |
| | | ERouterName['PILOT_LIVESHARE'] = 'pilot-liveshare'; |
| | | ERouterName['PILOT_BIND'] = 'pilot-bind'; |
| | | ERouterName['IMPLEMENT'] = 'implement'; |
| | | ERouterName['ROUTE_HISTORY'] = 'route-history'; |
| | | })(ERouterName || (ERouterName = {})); |
| | | ERouterName['ELEMENT'] = 'element' |
| | | ERouterName['LOGIN'] = 'login' |
| | | ERouterName['PROJECT'] = 'project' |
| | | ERouterName['ADD_PROJECT'] = 'add_project' |
| | | ERouterName['EDIT_PROJECT'] = 'edit_project' |
| | | ERouterName['PROJECT_LIST'] = 'project_list' |
| | | ERouterName['HOME'] = 'home' |
| | | ERouterName['TSA'] = 'tsa' |
| | | ERouterName['LAYER'] = 'layer' |
| | | ERouterName['MEDIA'] = 'media' |
| | | ERouterName['WAYLINE'] = 'wayline' |
| | | ERouterName['LIVESTREAM'] = 'livestream' |
| | | ERouterName['LIVING'] = 'living' |
| | | ERouterName['WORKSPACE'] = 'workspace' |
| | | ERouterName['MEMBERS'] = 'members' |
| | | ERouterName['DEVICES'] = 'devices' |
| | | ERouterName['TASK'] = 'task' |
| | | ERouterName['CREATE_PLAN'] = 'create-plan' |
| | | ERouterName['SELECT_PLAN'] = 'select-plan' |
| | | ERouterName['FIRMWARES'] = 'firmwares' |
| | | ERouterName['PILOT'] = 'pilot-login' |
| | | ERouterName['PILOT_HOME'] = 'pilot-home' |
| | | ERouterName['PILOT_MEDIA'] = 'pilot-media' |
| | | ERouterName['PILOT_LIVESHARE'] = 'pilot-liveshare' |
| | | ERouterName['PILOT_BIND'] = 'pilot-bind' |
| | | ERouterName['IMPLEMENT'] = 'implement' |
| | | ERouterName['ROUTE_HISTORY'] = 'route-history' |
| | | })(ERouterName || (ERouterName = {})) |
| | | |
| | | export let EStorageKey; |
| | | (function (EStorageKey) { |
| | | EStorageKey['LANG_CODE'] = 'DJI_CREATE_VITE_H5_APP:lang_code'; |
| | | EStorageKey['TEST_TOOLS_POSITION_STORAGE_KEY'] = 'DJI_CREATE_VITE_H5_APP:test_tools_position'; |
| | | EStorageKey['SESSION_ID'] = 'DJI_CREATE_VITE_H5_APP:sess'; |
| | | })(EStorageKey || (EStorageKey = {})); |
| | | EStorageKey['LANG_CODE'] = 'DJI_CREATE_VITE_H5_APP:lang_code' |
| | | EStorageKey['TEST_TOOLS_POSITION_STORAGE_KEY'] = 'DJI_CREATE_VITE_H5_APP:test_tools_position' |
| | | EStorageKey['SESSION_ID'] = 'DJI_CREATE_VITE_H5_APP:sess' |
| | | })(EStorageKey || (EStorageKey = {})) |
| | | |
| | | export let EStatusValue; |
| | | (function (EStatusValue) { |
| | | EStatusValue['CONNECTED'] = 'Connected'; |
| | | EStatusValue['DISCONNECT'] = 'Disconnect'; |
| | | EStatusValue['LIVING'] = 'Living'; |
| | | })(EStatusValue || (EStatusValue = {})); |
| | | EStatusValue['CONNECTED'] = 'Connected' |
| | | EStatusValue['DISCONNECT'] = 'Disconnect' |
| | | EStatusValue['LIVING'] = 'Living' |
| | | })(EStatusValue || (EStatusValue = {})) |
| | | |
| | | export let ELiveStatusValue; |
| | | (function (ELiveStatusValue) { |
| | | ELiveStatusValue[(ELiveStatusValue['DISCONNECT'] = 0)] = 'DISCONNECT'; |
| | | ELiveStatusValue[(ELiveStatusValue['CONNECTED'] = 1)] = 'CONNECTED'; |
| | | ELiveStatusValue[(ELiveStatusValue['LIVING'] = 2)] = 'LIVING'; |
| | | })(ELiveStatusValue || (ELiveStatusValue = {})); |
| | | ELiveStatusValue[(ELiveStatusValue['DISCONNECT'] = 0)] = 'DISCONNECT' |
| | | ELiveStatusValue[(ELiveStatusValue['CONNECTED'] = 1)] = 'CONNECTED' |
| | | ELiveStatusValue[(ELiveStatusValue['LIVING'] = 2)] = 'LIVING' |
| | | })(ELiveStatusValue || (ELiveStatusValue = {})) |
| | | |
| | | export let EComponentName; |
| | | (function (EComponentName) { |
| | | EComponentName['Thing'] = 'thing'; |
| | | EComponentName['Liveshare'] = 'liveshare'; |
| | | EComponentName['Api'] = 'api'; |
| | | EComponentName['Ws'] = 'ws'; |
| | | EComponentName['Map'] = 'map'; |
| | | EComponentName['Tsa'] = 'tsa'; |
| | | EComponentName['Media'] = 'media'; |
| | | EComponentName['Mission'] = 'mission'; |
| | | })(EComponentName || (EComponentName = {})); |
| | | EComponentName['Thing'] = 'thing' |
| | | EComponentName['Liveshare'] = 'liveshare' |
| | | EComponentName['Api'] = 'api' |
| | | EComponentName['Ws'] = 'ws' |
| | | EComponentName['Map'] = 'map' |
| | | EComponentName['Tsa'] = 'tsa' |
| | | EComponentName['Media'] = 'media' |
| | | EComponentName['Mission'] = 'mission' |
| | | })(EComponentName || (EComponentName = {})) |
| | | |
| | | export let ELocalStorageKey; |
| | | (function (ELocalStorageKey) { |
| | | ELocalStorageKey['Username'] = 'username'; |
| | | ELocalStorageKey['WorkspaceId'] = 'workspace_id'; |
| | | ELocalStorageKey['Token'] = 'x-auth-token'; |
| | | ELocalStorageKey['PlatformName'] = 'platform_name'; |
| | | ELocalStorageKey['WorkspaceName'] = 'workspace_name'; |
| | | ELocalStorageKey['WorkspaceDesc'] = 'workspace_desc'; |
| | | ELocalStorageKey['Flag'] = 'flag'; |
| | | ELocalStorageKey['UserId'] = 'user_id'; |
| | | ELocalStorageKey['Device'] = 'device'; |
| | | ELocalStorageKey['GatewayOnline'] = 'gateway_online'; |
| | | ELocalStorageKey['UserInfo'] = 'user_info'; |
| | | })(ELocalStorageKey || (ELocalStorageKey = {})); |
| | | ELocalStorageKey['Username'] = 'username' |
| | | ELocalStorageKey['WorkspaceId'] = 'workspace_id' |
| | | ELocalStorageKey['Token'] = 'x-auth-token' |
| | | ELocalStorageKey['PlatformName'] = 'platform_name' |
| | | ELocalStorageKey['WorkspaceName'] = 'workspace_name' |
| | | ELocalStorageKey['WorkspaceDesc'] = 'workspace_desc' |
| | | ELocalStorageKey['Flag'] = 'flag' |
| | | ELocalStorageKey['UserId'] = 'user_id' |
| | | ELocalStorageKey['Device'] = 'device' |
| | | ELocalStorageKey['GatewayOnline'] = 'gateway_online' |
| | | ELocalStorageKey['UserInfo'] = 'user_info' |
| | | })(ELocalStorageKey || (ELocalStorageKey = {})) |
| | | |
| | | export let EPhotoType; |
| | | (function (EPhotoType) { |
| | | EPhotoType[(EPhotoType['Original'] = 0)] = 'Original'; |
| | | EPhotoType[(EPhotoType['Preview'] = 1)] = 'Preview'; |
| | | EPhotoType[(EPhotoType['Unknown'] = -1)] = 'Unknown'; |
| | | })(EPhotoType || (EPhotoType = {})); |
| | | EPhotoType[(EPhotoType['Original'] = 0)] = 'Original' |
| | | EPhotoType[(EPhotoType['Preview'] = 1)] = 'Preview' |
| | | EPhotoType[(EPhotoType['Unknown'] = -1)] = 'Unknown' |
| | | })(EPhotoType || (EPhotoType = {})) |
| | | |
| | | export let EDownloadOwner; |
| | | (function (EDownloadOwner) { |
| | | EDownloadOwner[(EDownloadOwner['Mine'] = 0)] = 'Mine'; |
| | | EDownloadOwner[(EDownloadOwner['Others'] = 1)] = 'Others'; |
| | | EDownloadOwner[(EDownloadOwner['Unknown'] = -1)] = 'Unknown'; |
| | | })(EDownloadOwner || (EDownloadOwner = {})); |
| | | EDownloadOwner[(EDownloadOwner['Mine'] = 0)] = 'Mine' |
| | | EDownloadOwner[(EDownloadOwner['Others'] = 1)] = 'Others' |
| | | EDownloadOwner[(EDownloadOwner['Unknown'] = -1)] = 'Unknown' |
| | | })(EDownloadOwner || (EDownloadOwner = {})) |
| | | |
| | | export let EUserType; |
| | | (function (EUserType) { |
| | | EUserType[(EUserType['Web'] = 1)] = 'Web'; |
| | | EUserType[(EUserType['Pilot'] = 2)] = 'Pilot'; |
| | | })(EUserType || (EUserType = {})); |
| | | EUserType[(EUserType['Web'] = 1)] = 'Web' |
| | | EUserType[(EUserType['Pilot'] = 2)] = 'Pilot' |
| | | })(EUserType || (EUserType = {})) |
| | | |
| | | export let EBizCode; |
| | | (function (EBizCode) { |
| | | EBizCode['GatewayOsd'] = 'gateway_osd'; |
| | | EBizCode['DeviceOsd'] = 'device_osd'; |
| | | EBizCode['DockOsd'] = 'dock_osd'; |
| | | EBizCode['MapElementCreate'] = 'map_element_create'; |
| | | EBizCode['MapElementUpdate'] = 'map_element_update'; |
| | | EBizCode['MapElementDelete'] = 'map_element_delete'; |
| | | EBizCode['DeviceOnline'] = 'device_online'; |
| | | EBizCode['DeviceOffline'] = 'device_offline'; |
| | | EBizCode['DeviceHms'] = 'device_hms'; |
| | | EBizCode['FlightTaskProgress'] = 'flighttask_progress'; |
| | | EBizCode['FlightTaskMediaProgress'] = 'file_upload_callback'; |
| | | EBizCode['FlightTaskMediaHighestPriority'] = 'highest_priority_upload_flighttask_media'; |
| | | EBizCode['DeviceReboot'] = 'device_reboot'; |
| | | EBizCode['DroneOpen'] = 'drone_open'; |
| | | EBizCode['DroneClose'] = 'drone_close'; |
| | | EBizCode['DeviceFormat'] = 'device_format'; |
| | | EBizCode['DroneFormat'] = 'drone_format'; |
| | | EBizCode['CoverOpen'] = 'cover_open'; |
| | | EBizCode['CoverClose'] = 'cover_close'; |
| | | EBizCode['PutterOpen'] = 'putter_open'; |
| | | EBizCode['PutterClose'] = 'putter_close'; |
| | | EBizCode['ChargeOpen'] = 'charge_open'; |
| | | EBizCode['ChargeClose'] = 'charge_close'; |
| | | EBizCode['DeviceUpgrade'] = 'ota_progress'; |
| | | EBizCode['DeviceLogUploadProgress'] = 'fileupload_progress'; |
| | | EBizCode['ControlSourceChange'] = 'control_source_change'; |
| | | EBizCode['FlyToPointProgress'] = 'fly_to_point_progress'; |
| | | EBizCode['TakeoffToPointProgress'] = 'takeoff_to_point_progress'; |
| | | EBizCode['JoystickInvalidNotify'] = 'joystick_invalid_notify'; |
| | | EBizCode['DrcStatusNotify'] = 'drc_status_notify'; |
| | | })(EBizCode || (EBizCode = {})); |
| | | EBizCode['GatewayOsd'] = 'gateway_osd' |
| | | EBizCode['DeviceOsd'] = 'device_osd' |
| | | EBizCode['DockOsd'] = 'dock_osd' |
| | | EBizCode['MapElementCreate'] = 'map_element_create' |
| | | EBizCode['MapElementUpdate'] = 'map_element_update' |
| | | EBizCode['MapElementDelete'] = 'map_element_delete' |
| | | EBizCode['DeviceOnline'] = 'device_online' |
| | | EBizCode['DeviceOffline'] = 'device_offline' |
| | | EBizCode['DeviceHms'] = 'device_hms' |
| | | EBizCode['FlightTaskProgress'] = 'flighttask_progress' |
| | | EBizCode['FlightTaskMediaProgress'] = 'file_upload_callback' |
| | | EBizCode['FlightTaskMediaHighestPriority'] = 'highest_priority_upload_flighttask_media' |
| | | EBizCode['DeviceReboot'] = 'device_reboot' |
| | | EBizCode['DroneOpen'] = 'drone_open' |
| | | EBizCode['DroneClose'] = 'drone_close' |
| | | EBizCode['DeviceFormat'] = 'device_format' |
| | | EBizCode['DroneFormat'] = 'drone_format' |
| | | EBizCode['CoverOpen'] = 'cover_open' |
| | | EBizCode['CoverClose'] = 'cover_close' |
| | | EBizCode['PutterOpen'] = 'putter_open' |
| | | EBizCode['PutterClose'] = 'putter_close' |
| | | EBizCode['ChargeOpen'] = 'charge_open' |
| | | EBizCode['ChargeClose'] = 'charge_close' |
| | | EBizCode['DeviceUpgrade'] = 'ota_progress' |
| | | EBizCode['DeviceLogUploadProgress'] = 'fileupload_progress' |
| | | EBizCode['ControlSourceChange'] = 'control_source_change' |
| | | EBizCode['FlyToPointProgress'] = 'fly_to_point_progress' |
| | | EBizCode['TakeoffToPointProgress'] = 'takeoff_to_point_progress' |
| | | EBizCode['JoystickInvalidNotify'] = 'joystick_invalid_notify' |
| | | EBizCode['DrcStatusNotify'] = 'drc_status_notify' |
| | | EBizCode['VideoSurveillance'] = 'live_status' // 视频监控 |
| | | |
| | | })(EBizCode || (EBizCode = {})) |
| | | |
| | | export const EBizCodeMessage = { |
| | | [EBizCode.DeviceOnline]: '设备在线', |
| | |
| | | [EBizCode.TakeoffToPointProgress]: '一键起飞', |
| | | [EBizCode.DrcStatusNotify]: '飞行控制模式状态', |
| | | [EBizCode.JoystickInvalidNotify]: '设备端退出drc模式', |
| | | }; |
| | | } |
| | | |
| | | export let EDeviceTypeName; |
| | | (function (EDeviceTypeName) { |
| | | EDeviceTypeName[(EDeviceTypeName['Aircraft'] = 0)] = 'Aircraft'; |
| | | EDeviceTypeName[(EDeviceTypeName['Gateway'] = 2)] = 'Gateway'; |
| | | EDeviceTypeName[(EDeviceTypeName['Dock'] = 3)] = 'Dock'; |
| | | })(EDeviceTypeName || (EDeviceTypeName = {})); |
| | | EDeviceTypeName[(EDeviceTypeName['Aircraft'] = 0)] = 'Aircraft' |
| | | EDeviceTypeName[(EDeviceTypeName['Gateway'] = 2)] = 'Gateway' |
| | | EDeviceTypeName[(EDeviceTypeName['Dock'] = 3)] = 'Dock' |
| | | })(EDeviceTypeName || (EDeviceTypeName = {})) |
| | | |
| | | export let EHmsLevel; |
| | | (function (EHmsLevel) { |
| | | EHmsLevel[(EHmsLevel['NOTICE'] = 0)] = 'NOTICE'; |
| | | EHmsLevel[(EHmsLevel['CAUTION'] = 1)] = 'CAUTION'; |
| | | EHmsLevel[(EHmsLevel['WARN'] = 2)] = 'WARN'; |
| | | })(EHmsLevel || (EHmsLevel = {})); |
| | | EHmsLevel[(EHmsLevel['NOTICE'] = 0)] = 'NOTICE' |
| | | EHmsLevel[(EHmsLevel['CAUTION'] = 1)] = 'CAUTION' |
| | | EHmsLevel[(EHmsLevel['WARN'] = 2)] = 'WARN' |
| | | })(EHmsLevel || (EHmsLevel = {})) |
| | |
| | | <div class="control-cmd-wrapper"> |
| | | <div class="control-cmd-header"> |
| | | 远程调试 |
| | | <el-switch |
| | | v-model="debugStatus" |
| | | @change="onDeviceStatusChange" |
| | | active-text="开" |
| | | inactive-text="关" |
| | | class="debug-btn" |
| | | style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" |
| | | /> |
| | | <el-switch v-model="debugStatus" @change="onDeviceStatusChange" active-text="开" inactive-text="关" |
| | | class="debug-btn" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" /> |
| | | <el-divider /> |
| | | </div> |
| | | <div class="control-cmd-box"> |
| | |
| | | <div class="item-status">{{ cmdItem.status }}</div> |
| | | </div> |
| | | <div class="control-cmd-item-right"> |
| | | <el-button |
| | | :disabled="!debugStatus || cmdItem.disabled" |
| | | :loading="cmdItem.loading" |
| | | size="small" |
| | | type="primary" |
| | | @click="sendControlCmd(cmdItem, index)" |
| | | > |
| | | <el-button :disabled="!debugStatus || cmdItem.disabled" :loading="cmdItem.loading" size="small" type="primary" |
| | | @click="sendControlCmd(cmdItem, index)"> |
| | | {{ cmdItem.operateText }} |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-divider>无人机设置</el-divider> |
| | | |
| | | <!-- 设置 0:白热,1:黑热,2:描红,3:医疗,5:彩虹 1,6:铁红,8:北极,11:熔岩,12:热铁,13:彩虹 2 --> |
| | | <div class="control-cmd-box"> |
| | | <div class="control-cmd-item"> |
| | | <div class="control-cmd-item-left">调色盘样式</div> |
| | | <div class="control-cmd-item-right"> |
| | | <el-select @change="changs" v-model="valueStyle" placeholder="请选择"> |
| | | <el-option v-for="item in paletteOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import EventBus from '@/event-bus'; |
| | | import { EBizCode, ELocalStorageKey, ERouterName } from '@/types'; |
| | | import { useConnectWebSocket } from '@/hooks/use-connect-websocket'; |
| | | import { getWebsocketUrl } from '@/websocket/util/config'; |
| | | import { defineProps, ref, watch } from 'vue'; |
| | | import { cmdList as baseCmdList } from '@/types/device-cmd'; |
| | | import { useDockControl } from './use-dock-control'; |
| | | import { EDockModeCode } from '@/types/device'; |
| | | import { updateDeviceCmdInfoByOsd, updateDeviceCmdInfoByExecuteInfo } from '@/utils/device-cmd'; |
| | | import Store from '@/store'; |
| | | import EventBus from '@/event-bus' |
| | | import { EBizCode, ELocalStorageKey, ERouterName } from '@/types' |
| | | import { useConnectWebSocket } from '@/hooks/use-connect-websocket' |
| | | import { getWebsocketUrl } from '@/websocket/util/config' |
| | | import { defineProps, ref, watch, reactive } from 'vue' |
| | | import { cmdList as baseCmdList } from '@/types/device-cmd' |
| | | import { useDockControl } from './use-dock-control' |
| | | import { EDockModeCode } from '@/types/device' |
| | | import { updateDeviceCmdInfoByOsd, updateDeviceCmdInfoByExecuteInfo } from '@/utils/device-cmd' |
| | | import { setThermalCurrentPaletteStyle } from '@/api/device-setting' |
| | | |
| | | const props = defineProps(['sn', 'deviceInfo']); |
| | | const initCmdList = baseCmdList.map(cmdItem => Object.assign({}, cmdItem)); |
| | | const cmdList = ref(initCmdList); |
| | | import Store from '@/store' |
| | | |
| | | const valueStyle = ref(0) |
| | | |
| | | // 定义一个数据videoList |
| | | const videoList = reactive([]) |
| | | |
| | | // 调色盘选项数据 |
| | | const paletteOptions = [ |
| | | { label: '白热', value: 0 }, |
| | | { label: '黑热', value: 1 }, |
| | | { label: '描红', value: 2 }, |
| | | { label: '医疗', value: 3 }, |
| | | { label: '彩虹1', value: 5 }, |
| | | { label: '铁红', value: 6 }, |
| | | { label: '北极', value: 8 }, |
| | | { label: '熔岩', value: 11 }, |
| | | { label: '热铁', value: 12 }, |
| | | { label: '彩虹2', value: 13 }, |
| | | ] |
| | | |
| | | const props = defineProps(['sn', 'deviceInfo']) |
| | | const initCmdList = baseCmdList.map(cmdItem => Object.assign({}, cmdItem)) |
| | | const cmdList = ref(initCmdList) |
| | | // dock 控制指令 |
| | | const debugStatus = ref(props.deviceInfo.mode_code == EDockModeCode.Remote_Debugging); |
| | | const debugStatus = ref(props.deviceInfo.mode_code == EDockModeCode.Remote_Debugging) |
| | | |
| | | // 根据机场指令执行状态更新信息 |
| | | watch( |
| | | () => Store.getters.devicesCmdExecuteInfo, |
| | | devicesCmdExecuteInfo => { |
| | | // console.log('设备指令执行状态变化', devicesCmdExecuteInfo) |
| | | if (props.sn && devicesCmdExecuteInfo[props.sn]) { |
| | | updateDeviceCmdInfoByExecuteInfo(cmdList.value, devicesCmdExecuteInfo[props.sn]); |
| | | updateDeviceCmdInfoByExecuteInfo(cmdList.value, devicesCmdExecuteInfo[props.sn]) |
| | | } |
| | | }, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ); |
| | | ) |
| | | watch( |
| | | () => Store.state.device.videoSurveillance, |
| | | newObj => { |
| | | // console.log('视频类型监听中', newObj) |
| | | // if (newObj && newObj.live_status && newObj.live_status.length) { |
| | | // let arr = newObj.live_status || [] |
| | | // if (videoList.length == arr.length) { |
| | | // return |
| | | // } |
| | | // arr.forEach(element => { |
| | | // let video_id = element.video_id |
| | | // element.payIndex = video_id.split('/')[1].split('-')[1] |
| | | // }) |
| | | // // videoList.length = 0 // 清空数组 |
| | | // videoList.push(...arr) // 添加新元素 |
| | | // } |
| | | }, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ) |
| | | |
| | | // 根据设备osd信息更新信息 |
| | | watch( |
| | | () => Store.getters.deviceState, |
| | | value => { |
| | | if (props.sn && (value.currentSn===props.deviceInfo.child_sn || value.currentSn===props.deviceInfo.device_sn)) { |
| | | // console.log('设备状态变化', value) |
| | | if (props.sn && (value.currentSn === props.deviceInfo.child_sn || value.currentSn === props.deviceInfo.device_sn)) { |
| | | debugStatus.value = value.dockInfo[props.deviceInfo.device_sn]?.basic_osd?.mode_code === EDockModeCode.Remote_Debugging |
| | | const devices = {} |
| | | devices['device'] = value.deviceInfo[props.deviceInfo.child_sn] |
| | | devices['dock'] = value.dockInfo[props.deviceInfo.device_sn] |
| | | devices['gateway'] = value.gatewayInfo |
| | | updateDeviceCmdInfoByOsd(cmdList.value, devices); |
| | | updateDeviceCmdInfoByOsd(cmdList.value, devices) |
| | | } |
| | | }, |
| | | { |
| | | immediate: true, |
| | | deep: true, |
| | | } |
| | | ); |
| | | ) |
| | | |
| | | // 远程控制开关 |
| | | async function onDeviceStatusChange(status) { |
| | | let result = false; |
| | | async function onDeviceStatusChange (status) { |
| | | let result = false |
| | | if (status) { |
| | | result = await dockDebugOnOff(props.sn, true); |
| | | result = await dockDebugOnOff(props.sn, true) |
| | | } else { |
| | | result = await dockDebugOnOff(props.sn, false); |
| | | result = await dockDebugOnOff(props.sn, false) |
| | | } |
| | | console.log(result, '---1------'); |
| | | |
| | | if (!result) { |
| | | if (status) { |
| | | debugStatus.value = false; |
| | | debugStatus.value = false |
| | | } else { |
| | | debugStatus.value = true; |
| | | debugStatus.value = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | const { sendDockControlCmd, dockDebugOnOff } = useDockControl(); |
| | | const { sendDockControlCmd, dockDebugOnOff } = useDockControl() |
| | | |
| | | async function sendControlCmd(cmdItem, index) { |
| | | async function sendControlCmd (cmdItem, index) { |
| | | const params = { |
| | | sn: props.sn, |
| | | cmd: cmdItem.cmdKey, |
| | | action: cmdItem.action, |
| | | }; |
| | | const success = await sendDockControlCmd(params, true); |
| | | } |
| | | const success = await sendDockControlCmd(params, true) |
| | | if (success) { |
| | | updateDeviceSingleCmdInfo(cmdList.value[index]); |
| | | updateDeviceSingleCmdInfo(cmdList.value[index]) |
| | | } |
| | | } |
| | | |
| | | // webSocket 监听 |
| | | const messageHandler = async payload => { |
| | | if (!payload) { |
| | | return; |
| | | return |
| | | } |
| | | switch (payload.biz_code) { |
| | | case EBizCode.GatewayOsd: { |
| | | Store.commit('SET_GATEWAY_INFO', payload.data); |
| | | break; |
| | | Store.commit('SET_GATEWAY_INFO', payload.data) |
| | | break |
| | | } |
| | | // 飞行器 |
| | | case EBizCode.DeviceOsd: { |
| | | Store.commit('SET_DEVICE_INFO', payload.data); |
| | | break; |
| | | Store.commit('SET_DEVICE_INFO', payload.data) |
| | | break |
| | | } |
| | | // 机场 |
| | | case EBizCode.DockOsd: { |
| | | Store.commit('SET_DOCK_INFO', payload.data); |
| | | break; |
| | | Store.commit('SET_DOCK_INFO', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.MapElementCreate: { |
| | | Store.commit('SET_MAP_ELEMENT_CREATE', payload.data); |
| | | break; |
| | | Store.commit('SET_MAP_ELEMENT_CREATE', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.MapElementUpdate: { |
| | | Store.commit('SET_MAP_ELEMENT_UPDATE', payload.data); |
| | | break; |
| | | Store.commit('SET_MAP_ELEMENT_UPDATE', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.MapElementDelete: { |
| | | Store.commit('SET_MAP_ELEMENT_DELETE', payload.data); |
| | | break; |
| | | Store.commit('SET_MAP_ELEMENT_DELETE', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.DeviceOnline: { |
| | | Store.commit('SET_DEVICE_ONLINE', payload.data); |
| | | break; |
| | | Store.commit('SET_DEVICE_ONLINE', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.DeviceOffline: { |
| | | Store.commit('SET_DEVICE_OFFLINE', payload.data); |
| | | break; |
| | | Store.commit('SET_DEVICE_OFFLINE', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.FlightTaskProgress: |
| | | case EBizCode.FlightTaskMediaProgress: |
| | | case EBizCode.FlightTaskMediaHighestPriority: { |
| | | EventBus.emit('flightTaskWs', payload); |
| | | break; |
| | | EventBus.emit('flightTaskWs', payload) |
| | | break |
| | | } |
| | | case EBizCode.DeviceHms: { |
| | | Store.commit('SET_DEVICE_HMS_INFO', payload.data); |
| | | break; |
| | | Store.commit('SET_DEVICE_HMS_INFO', payload.data) |
| | | break |
| | | } |
| | | case EBizCode.VideoSurveillance: { |
| | | if (payload.data.live_status && payload.data.live_status.length) { |
| | | Store.commit('SAVE_VIDEO_SURVEILLANCE_INFO', payload.data) |
| | | } |
| | | break |
| | | } |
| | | case EBizCode.DeviceReboot: |
| | | case EBizCode.DroneOpen: |
| | |
| | | biz_code: payload.biz_code, |
| | | timestamp: payload.timestamp, |
| | | ...payload.data, |
| | | }); |
| | | break; |
| | | }) |
| | | break |
| | | } |
| | | case EBizCode.ControlSourceChange: |
| | | case EBizCode.FlyToPointProgress: |
| | | case EBizCode.TakeoffToPointProgress: |
| | | case EBizCode.JoystickInvalidNotify: |
| | | case EBizCode.DrcStatusNotify: { |
| | | EventBus.emit('droneControlWs', payload); |
| | | break; |
| | | EventBus.emit('droneControlWs', payload) |
| | | break |
| | | } |
| | | default: |
| | | break; |
| | | break |
| | | } |
| | | }; |
| | | } |
| | | |
| | | const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + props.deviceInfo.workspace_id; |
| | | const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + props.deviceInfo.workspace_id |
| | | // 监听ws 消息 |
| | | useConnectWebSocket(messageHandler, webSorketUrl); |
| | | useConnectWebSocket(messageHandler, webSorketUrl) |
| | | |
| | | // 添加 changs 方法 |
| | | async function changs (value) { |
| | | const payload = { |
| | | thermal_current_palette_style: value |
| | | } |
| | | console.log('payload1111111', payload) |
| | | console.log('deviceInfo22222222', props.sn) |
| | | console.log('deviceInfo22222222', props.deviceInfo.workspace_id) |
| | | let data = await setThermalCurrentPaletteStyle(props.sn, props.deviceInfo.workspace_id, payload) |
| | | if (data.code === 0) { |
| | | message.success('修改成功') |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | padding: 4px 15px; |
| | | |
| | | .control-cmd-item { |
| | | width: 320px; |
| | | height: 58px; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | ::v-deep { |
| | | .el-form { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | padding: 4px 15px; |
| | | } |
| | | |
| | | .el-form-item { |
| | | width: 320px; |
| | | height: 58px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | border: 1px solid #666; |
| | | margin: 8px 0; |
| | | padding: 0 8px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .el-select__wrapper { |
| | | width: 160px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <i class="el-icon-map-location"></i> 地图选点 |
| | | </el-button> |
| | | </avue-input-map> |
| | | <div v-if="form.location?.length >= 2" class="location-text">{{ form.address || '获取地址中...' }}</div> |
| | | <!-- <div v-if="form.location?.length >= 3"> |
| | | {{ form.location[2] || '获取地址中...' }} |
| | | </div> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <!-- 工单详情对话框 --> |
| | | <el-dialog v-model="detailVisible" title="工单详情" width="80%" append-to-body> |
| | | <div class="detail-container"> |
| | | <div class="event-title-center">{{ currentDetail.orderName || '事件名称' }}</div> |
| | | <!-- 工单状态流程 --> |
| | | <div class="custom-steps-container"> |
| | | <!-- 标题行 --> |
| | |
| | | <el-input v-model="currentDetail.orderName" placeholder="请输入工单名称" /> |
| | | </template> |
| | | <!-- 修复任务接收单位为下拉框 --> |
| | | <template v-else-if="currentDetail.status === 0 && row.label1 === '任务接收单位'"> |
| | | <template v-else-if="currentDetail.status === 0 && row.label1 === '发起单位'"> |
| | | <el-select v-model="currentDetail.department" placeholder="请选择任务接收单位" @change="handleDepartmentChange"> |
| | | <el-option v-for="item in departments" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | |
| | | <el-input type="textarea" v-model="currentDetail.content" placeholder="请输入工单内容" /> |
| | | </template> |
| | | <!-- 修复工单类型为下拉框 --> |
| | | <template v-else-if="currentDetail.status === 0 && row.label2 === '工单类型'&&hasProcessingBtnPermission()"> |
| | | <template v-else-if="currentDetail.status === 0 && row.label2 === '工单类型' && hasProcessingBtnPermission()"> |
| | | <el-select v-model="currentDetail.type" placeholder="请选择工单类型"> |
| | | <el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | |
| | | |
| | | <!-- 上传图片 --> |
| | | <div v-if="[3, 4].includes(currentDetail.status)" class="form-section" style="margin-bottom: 32px;"> |
| | | <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">上传图片</div> |
| | | <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card" |
| | | :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload" :file-list="[]" |
| | | :limit="1" accept="image/*"> |
| | | <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">上传图片</div> |
| | | <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false" |
| | | list-type="picture-card" :on-change="handleFileChange" :on-remove="handleUploadRemove" |
| | | :before-upload="beforeUpload" :file-list="[]" :limit="1" accept="image/*"> |
| | | <span |
| | | style="font-size: 32px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;">+</span> |
| | | </el-upload> |
| | | <div class="el-upload__tip" style="margin-top: 12px;" v-if="hasProcessedAndOverBtnPermission()"> |
| | | <div class="el-upload__tip" style="margin-top: 12px;" v-if="hasProcessedAndOverBtnPermission()"> |
| | | 支持 jpg/png 格式图片,单张不超过 5MB |
| | | </div> |
| | | </div> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="media-box"> |
| | | <div class="media-title">事件图片/事件视频</div> |
| | | <div class="media-title">事件图片</div> |
| | | <div class="media-content"> |
| | | <el-image v-if="currentDetail.mediaUrl" :src="currentDetail.mediaUrl" |
| | | :preview-src-list="[currentDetail.mediaUrl]" fit="cover" style="width: 100%; height: 300px;"> |
| | |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="handleBatchApprove">通过</el-button> |
| | | <el-button type="danger" @click="handleBatchReject">不通过</el-button> |
| | | <el-button type="primary" @click="handleBatchApprove">通过</el-button> |
| | | <el-button type="danger" @click="handleBatchReject">不通过</el-button> |
| | | <el-button @click="cancleBatchReject">取消</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | this.fetchTabCounts(); // 新增:初始化时获取 tab 数据 |
| | | console.log('permission.tickets_processing_btn', this.permission.tickets_processing_btn); |
| | | console.log('permission', this.permission.tickets_tab_pending); |
| | | console.log('权限检查:', this.permission); |
| | | }, |
| | | mounted() { |
| | | this.fetchTableData(); |
| | |
| | | editable: false, |
| | | }, |
| | | { |
| | | label: "任务接收单位", |
| | | label: "发起单位", |
| | | value: this.currentDetail.department, |
| | | editable: false, |
| | | }, |
| | |
| | | { label: "事件地址", value: this.currentDetail.address, editable: false }, |
| | | { label: "工单类型", value: this.currentDetail.type, editable: this.currentDetail.status === 0, type: "select", options: this.types }, |
| | | { label: "关联算法", value: this.currentDetail.aiType, editable: false }, |
| | | { label: "任务接收单位", value: this.currentDetail.department, editable: false }, |
| | | { label: "发起单位", value: this.currentDetail.department, editable: false }, |
| | | { label: "发起任务时间", value: this.currentDetail.startTime, editable: false }, |
| | | { label: "工单内容", value: this.currentDetail.content, editable: this.currentDetail.status === 0, type: "textarea" }, |
| | | ]; |
| | |
| | | const fields = [ |
| | | { label: "工单名称", value: this.currentDetail.orderName }, |
| | | { label: "工单类型", value: this.currentDetail.type }, |
| | | { label: "任务处理人", value: this.currentDetail.handler || '未分配' }, // 显示处理人 |
| | | { label: "关联任务", value: this.currentDetail.job_name || '暂无关联航线' }, |
| | | { label: "任务发起人", value: this.currentDetail.creator }, |
| | | { label: "当前状态", value: this.mapStatus(this.currentDetail.status) }, |
| | | { label: "事件地址", value: this.currentDetail.address }, // 包含经纬度信息 |
| | | { label: "关联算法", value: this.currentDetail.aiType }, |
| | | { label: "任务接收单位", value: this.currentDetail.department }, |
| | | { label: "发起单位", value: this.currentDetail.department }, |
| | | { label: "发起任务时间", value: this.currentDetail.startTime }, |
| | | { label: "工单内容", value: this.currentDetail.content }, |
| | | ]; |
| | |
| | | size: Number(this.page.pageSize), // 使用每页条数 |
| | | ai_type: this.filters.algorithm || undefined, // 添加算法参数 |
| | | // 添加 is_draft 参数,仅在"我发起的"标签页时设置为1 |
| | | is_draft: currentTab?.name === 'myTickets' ? 1 : undefined |
| | | is_draft: currentTab?.name === 'myTickets' ? 1 : undefined, |
| | | user_id: currentTab?.name === 'myTickets' ? this.userInfo.user_id : undefined, |
| | | }; |
| | | |
| | | const response = await getList(params); |
| | |
| | | let filteredRecords = records; |
| | | |
| | | // 如果是"我发起的"tab,过滤数据 |
| | | if (currentTab?.name === 'myTickets') { |
| | | filteredRecords = records.filter(item => |
| | | String(item.create_user_id) === String(item.user_id) |
| | | ); |
| | | } |
| | | // if (currentTab?.name === 'myTickets') { |
| | | // filteredRecords = records.filter(item => |
| | | // String(item.create_user_id) === String(item.user_id) |
| | | // ); |
| | | // } |
| | | |
| | | this.tableData = filteredRecords.map(item => { |
| | | const longitude = Number(item.longitude) || 0; |
| | |
| | | processing_details: item.processing_details || '', // 添加处理详情字段 |
| | | update_photo_url: item.update_photo_url || '', // 添加处理图片字段 |
| | | work_type: item.work_type !== undefined ? Number(item.work_type) : 0, // 保留work_type字段并转为数字 |
| | | job_name: item.job_name || '', |
| | | }; |
| | | }); |
| | | |
| | | // 更新总数显示 |
| | | if (currentTab?.name === 'myTickets') { |
| | | this.page.total = filteredRecords.length; |
| | | } else { |
| | | this.page.total = total || 0; |
| | | } |
| | | this.page.total = total || 0; |
| | | |
| | | await this.fetchTabCounts(); |
| | | } catch (error) { |
| | |
| | | } |
| | | } |
| | | finally { |
| | | this.submitLoading = false; |
| | | } |
| | | this.submitLoading = false; |
| | | } |
| | | }, |
| | | |
| | | async saveDraft() { |
| | |
| | | this.submitLoading = true; |
| | | try { |
| | | let handlerValue = this.form.handler; |
| | | if (!handlerValue || handlerValue === '未分配') { |
| | | handlerValue = undefined; |
| | | } |
| | | if (!handlerValue || handlerValue === '未分配') { |
| | | handlerValue = undefined; |
| | | } |
| | | const submitData = { |
| | | id: this.form.id, |
| | | eventName: this.form.name || undefined, |
| | |
| | | this.$message.error(error.message || '保存草稿失败,请稍后重试'); |
| | | } |
| | | finally { |
| | | this.submitLoading = false; |
| | | } |
| | | this.submitLoading = false; |
| | | } |
| | | }, |
| | | |
| | | async handleLocationChange(val) { |
| | | |
| | | |
| | | // 处理 Proxy 对象的值 |
| | | handleLocationChange(val) { |
| | | let locationValue = val.value; |
| | | if (locationValue && locationValue.length >= 3) { |
| | | // 确保我们获取到实际的数组值 |
| | | this.form.location = [locationValue[0], locationValue[1]]; |
| | | if (locationValue && locationValue.length >= 2) { |
| | | // 兼容第三项为地址 |
| | | this.form.location = [ |
| | | Number(locationValue[0]), |
| | | Number(locationValue[1]), |
| | | locationValue[2] || '' |
| | | ]; |
| | | this.form.address = locationValue[2] || ''; |
| | | } else { |
| | | this.form.location = []; |
| | |
| | | mediaUrl: row.photo_url || row.video_url || '', |
| | | updatePhotoUrl: row.update_photo_url || '', |
| | | photos: [], |
| | | job_name: row.job_name || '', // 新增 |
| | | }; |
| | | |
| | | try { |
| | |
| | | this.dispatchDialogVisible = true; // 打开派发对话框 |
| | | }, |
| | | hasProcessingBtnPermission() { |
| | | // undefined 或 false 都返回 false,只有 true 返回 true |
| | | console.log('权限检查:', this.permission); |
| | | return this.permission && this.permission.tickets_processing_btn === true; |
| | | }, |
| | | // undefined 或 false 都返回 false,只有 true 返回 true |
| | | console.log('权限检查:', this.permission); |
| | | return this.permission && this.permission.tickets_processing_btn === true; |
| | | }, |
| | | hasProcessedAndOverBtnPermission() { |
| | | // undefined 或 false 都返回 false,只有 true 返回 true |
| | | console.log('权限检查:', this.permission); |
| | |
| | | department: deptId, |
| | | handler: handlerId, // 使用映射后的处理人ID |
| | | algorithm: algorithmArr, // 回显为数组 |
| | | location: row.location, |
| | | address: row.address, |
| | | location: Array.isArray(row.location) && row.location.length >= 2 |
| | | ? [Number(row.location[0]), Number(row.location[1])] |
| | | : [], |
| | | address: row.address || '', |
| | | content: row.content, |
| | | photos: [], |
| | | }; |
| | | |
| | | this.form.location = Array.isArray(row.location) && row.location.length >= 2 |
| | | ? [ |
| | | Number(row.location[0]), |
| | | Number(row.location[1]), |
| | | row.location[2] || row.address || '' |
| | | ] |
| | | : []; |
| | | this.form.address = this.form.location[2] || ''; |
| | | // 设置地图中心点 |
| | | if (Array.isArray(this.form.location) && this.form.location.length >= 2) { |
| | | this.mapParams.center = [Number(this.form.location[0]), Number(this.form.location[1])]; |
| | | } else { |
| | | this.mapParams.center = null; // 没有经纬度时用默认 |
| | | } |
| | | // 如果有图片,添加到表单中 |
| | | if (row.photo_url) { |
| | | this.form.photos = [{ |
| | |
| | | color: #409eff; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .event-title-center { |
| | | text-align: center; |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | margin-bottom: 12px; |
| | | color: #333; |
| | | } |
| | | .custom-steps { |
| | | margin-top: -20px; |
| | | |