| | |
| | | import rc from '/@/assets/icons/rc.png' |
| | | import { OnlineDevice, EModeCode, OSDVisible, EDockModeCode, DeviceOsd, EDockModeText, EModeText } from '/@/types/device' |
| | | import { useMyStore } from '/@/store' |
| | | import { getDeviceTopo, getUnreadDeviceHms, updateDeviceHms } from '/@/api/manage' |
| | | import { getDeviceTopo, getUnreadDeviceHms, updateDeviceHms, testBind } from '/@/api/manage' |
| | | import { RocketOutlined, EyeInvisibleOutlined, EyeOutlined, RobotOutlined, DoubleRightOutlined } from '@ant-design/icons-vue' |
| | | import { EHmsLevel } from '/@/types/enums' |
| | | import { cesiumOperation } from '/@/hooks/use-cesium-tsa' |
| | |
| | | const getResource = (name: string) => { |
| | | return new URL(`/src/assets/icons/${name}`, import.meta.url).href |
| | | } |
| | | const cesium = cesiumOperation(global.$viewer) |
| | | const hasFlownToLocation = ref(false) |
| | | // 添加机场标注 |
| | | watch(() => store.state.deviceState, data => { |
| | | const cesium = cesiumOperation(global.$viewer) |
| | | cesium.removeAllPoint() |
| | | if (data.currentType === EDeviceTypeName.Gateway && data.gatewayInfo[data.currentSn]) { |
| | | // deviceTsaUpdateHook.moveTo(data.currentSn, data.gatewayInfo[data.currentSn].longitude, data.gatewayInfo[data.currentSn].latitude) |
| | |
| | | if (data.currentType === EDeviceTypeName.Dock && data.dockInfo[data.currentSn]) { |
| | | // 机场图标位置 |
| | | const setting = { |
| | | longitude: data.dockInfo[data.currentSn].basic_osd?.longitude || 115.85666327144976, |
| | | latitude: data.dockInfo[data.currentSn].basic_osd?.latitude || 28.62452712442823, |
| | | longitude: data.dockInfo[data.currentSn].basic_osd?.longitude, |
| | | latitude: data.dockInfo[data.currentSn].basic_osd?.latitude, |
| | | billboard: { |
| | | image: getResource('dock.png'), |
| | | outlineWidth: 0, |
| | |
| | | hasFlownToLocation.value = true |
| | | } |
| | | }, { |
| | | deep: true |
| | | deep: true, |
| | | }) |
| | | |
| | | const bind = async (sn: string) => { |
| | | const res = await testBind(sn) |
| | | if (res.code === 0) { |
| | | Promise.resolve(true) |
| | | } else { |
| | | Promise.resolve(false) |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | getOnlineTopo() |
| | | setTimeout(() => { |
| | |
| | | if (res.code !== 0) { |
| | | return |
| | | } |
| | | const snList: any[] = [] |
| | | onlineDevices.data = [] |
| | | onlineDocks.data = [] |
| | | res.data.forEach((gateway: any) => { |
| | |
| | | if (gateway.status && EDeviceTypeName.Gateway === gateway.domain) { |
| | | onlineDevices.data.push(device) |
| | | } |
| | | snList.push(gateway.device_sn) |
| | | bind(gateway.device_sn) |
| | | }) |
| | | store.commit('SET_SN_LIST', snList) |
| | | }) |
| | | } |
| | | |