husq
2023-09-21 67338a9d75216fd17bf5d679e585c21a9f10a451
src/pages/page-web/projects/tsa.vue
@@ -247,7 +247,7 @@
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'
@@ -281,10 +281,10 @@
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)
@@ -310,8 +310,8 @@
  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,
@@ -326,9 +326,16 @@
    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(() => {
@@ -360,6 +367,7 @@
    if (res.code !== 0) {
      return
    }
    const snList: any[] = []
    onlineDevices.data = []
    onlineDocks.data = []
    res.data.forEach((gateway: any) => {
@@ -395,7 +403,10 @@
      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)
  })
}