| | |
| | | const getResource = (name: string) => { |
| | | return new URL(`/src/assets/icons/${name}`, import.meta.url).href |
| | | } |
| | | const hasFlownToLocation = ref(false) |
| | | // 获取ws连接过来的sn设备号 |
| | | const snCode = ref<string[]>([]) |
| | | // 添加机场标注 |
| | | 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 (snCode.value.includes(data.currentSn)) return |
| | | snCode.value.push(data.currentSn) |
| | | // cesium.removeAllPoint() |
| | | if (data.currentType === EDeviceTypeName.Aircraft && data.deviceInfo[data.currentSn]) { |
| | | // 无人机图标 |
| | | const setting = { |
| | |
| | | } |
| | | } |
| | | cesium.addPoint(setting) |
| | | if (hasFlownToLocation.value) return |
| | | cesium.flyTo(setting) |
| | | hasFlownToLocation.value = true |
| | | // cesium.flyTo(setting) |
| | | } |
| | | }, { |
| | | deep: true, |
| | |
| | | osdVisible.value.gateway_callsign = device.gateway.callsign |
| | | osdVisible.value.payloads = device.payload |
| | | } |
| | | store.commit('SET_OSD_VISIBLE_INFO', osdVisible) |
| | | console.log(osdVisible.value, 'value') |
| | | store.commit('SET_OSD_VISIBLE_INFO', osdVisible.value) |
| | | store.commit('SET_HMSInfo_DetailSn', sn) |
| | | } |
| | | |