| | |
| | | <script lang="ts" setup> |
| | | import { computed, onMounted, reactive, ref, watch, WritableComputedRef } from 'vue' |
| | | import { EDeviceTypeName, ELocalStorageKey } from '/@/types' |
| | | import noData from '/@/assets/icons/no-data.png' |
| | | import rc from '/@/assets/icons/rc.png' |
| | | import { OnlineDevice, EModeCode, OSDVisible, EDockModeCode, DeviceOsd, EDockModeText, EModeText } from '/@/types/device' |
| | | import { useMyStore } from '/@/store' |
| | |
| | | } from '@ant-design/icons-vue' |
| | | import { EHmsLevel } from '/@/types/enums' |
| | | import { cesiumOperation } from '/@/hooks/use-cesium-tsa' |
| | | let droneEntity |
| | | |
| | | const { appContext } = getCurrentInstance() |
| | | const global = appContext.config.globalProperties |
| | |
| | | const cesium = cesiumOperation() |
| | | // 添加机场标注 |
| | | watch(() => store.state.deviceState, data => { |
| | | 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 = { |
| | | longitude: data.deviceInfo[data.currentSn].longitude, |
| | | latitude: data.deviceInfo[data.currentSn].latitude, |
| | | billboard: { |
| | | image: getResource('drone.png'), |
| | | outlineWidth: 0, |
| | | width: 36, |
| | | height: 36, |
| | | scale: 1.0, |
| | | } |
| | | // cesium.removeById('drone_fly') |
| | | if (!droneEntity) { |
| | | droneEntity = cesium.getEntityById('drone_fly') |
| | | } |
| | | cesium.addPoint(setting) |
| | | console.log(data.deviceInfo[data.currentSn], '====deviceInfo====') |
| | | if (droneEntity) { |
| | | const orientation = { |
| | | heading: data.deviceInfo[data.currentSn].attitude_head, |
| | | pitch: data.deviceInfo[data.currentSn].attitude_pitch, |
| | | roll: data.deviceInfo[data.currentSn].attitude_roll |
| | | } |
| | | cesium.updateEntityPosition(data.deviceInfo[data.currentSn].longitude, data.deviceInfo[data.currentSn].latitude, 'drone_fly', orientation) |
| | | } else { |
| | | // 无人机图标 |
| | | const setting = { |
| | | longitude: data.deviceInfo[data.currentSn].longitude, |
| | | latitude: data.deviceInfo[data.currentSn].latitude, |
| | | id: 'drone_fly', |
| | | billboard: { |
| | | image: getResource('drone.png'), |
| | | outlineWidth: 0, |
| | | width: 36, |
| | | height: 36, |
| | | scale: 1.0, |
| | | }, |
| | | heading: data.deviceInfo[data.currentSn].attitude_head, |
| | | pitch: data.deviceInfo[data.currentSn].attitude_pitch, |
| | | roll: data.deviceInfo[data.currentSn].attitude_roll |
| | | } |
| | | cesium.addPoint(setting) |
| | | } |
| | | // if (osdVisible.value.visible && osdVisible.value.sn !== '') { |
| | | // deviceInfo.value.device = data.deviceInfo[osdVisible.value.sn] |
| | | // } |
| | | } |
| | | if (data.currentType === EDeviceTypeName.Dock && data.dockInfo[data.currentSn]) { |
| | | if (snCode.value.includes(data.currentSn)) return |
| | | snCode.value.push(data.currentSn) |
| | | // 机场图标位置 |
| | | const setting = { |
| | | longitude: data.dockInfo[data.currentSn].basic_osd?.longitude, |