| | |
| | | </a-row> |
| | | </div> |
| | | <div class="scrollbar" :style="{ height: scorllHeight + 'px' }"> |
| | | <!--机场--> |
| | | <a-collapse :bordered="false" expandIconPosition="right" accordion style="background: #232323;"> |
| | | <a-collapse-panel :key="EDeviceTypeName.Dock" header="机场" style="border-bottom: 1px solid #4f4f4f;"> |
| | | <div v-if="onlineDocks.data.length === 0" style="height: 150px; color: white;"> |
| | |
| | | <div style="border-radius: 2px; height: 100%; width: 100%;" |
| | | class="flex-row flex-justify-between flex-align-center"> |
| | | <div style="float: left; padding: 0px 5px 8px 8px; width: 88%"> |
| | | <!-- // 机场设备标题 --> |
| | | <div style="width: 80%; height: 30px; line-height: 30px; font-size: 16px;"> |
| | | <a-tooltip :title="`${dock.gateway.callsign} - ${dock.callsign ?? 'No Drone'}`"> |
| | | <div class="text-hidden" style="max-width: 200px;">{{ dock.gateway.callsign }} - {{ dock.callsign ?? |
| | | 'No Drone' }}</div> |
| | | </a-tooltip> |
| | | </div> |
| | | <!-- // 机场设备状态 --> |
| | | <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;"> |
| | | <div class="flex-align-center flex-row"> |
| | | <span class="ml5 mr5"> |
| | | <RobotOutlined /> |
| | | </span> |
| | | 132 |
| | | <div class="font-bold text-hidden" style="max-width: 80px;" |
| | | :style="dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'"> |
| | | {{ dockInfo[dock.gateway.sn] ? EDockModeCode[dockInfo[dock.gateway.sn].basic_osd?.mode_code] : |
| | | EDockModeCode[EDockModeCode.Disconnected] }} |
| | | {{ dockInfo[dock.gateway.sn] ? EDockModeText[dockInfo[dock.gateway.sn].basic_osd?.mode_code] : |
| | | EDockModeText[EDockModeCode.Disconnected] }} |
| | | </div> |
| | | </div> |
| | | <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;"> |
| | |
| | | <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution' : |
| | | hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'" |
| | | style="margin-left: 3px; width: 62px; height: 16px;"> |
| | | <span class="word-loop">{{ hmsInfo[dock.gateway.sn][0].message_en }}</span> |
| | | <span class="word-loop">{{ hmsInfo[dock.gateway.sn][0].message_zh }}</span> |
| | | </div> |
| | | <template #content> |
| | | <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false" |
| | |
| | | <template #header="{ isActive }"> |
| | | <div class="flex-row flex-align-center" style="width: 130px;"> |
| | | <div style="width: 110px;"> |
| | | <span class="word-loop">{{ hms.message_en }}</span> |
| | | <span class="word-loop">{{ hms.message_zh }}</span> |
| | | </div> |
| | | <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 " |
| | | class="flex-row flex-align-center flex-justify-center" |
| | |
| | | <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div> |
| | | </div> |
| | | </div> |
| | | <!-- // 机场是否启动 --> |
| | | <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;"> |
| | | <div class="flex-row"> |
| | | <span class="ml5 mr5"> |
| | |
| | | </span> |
| | | <div class="font-bold text-hidden" style="max-width: 80px" |
| | | :style="deviceInfo[dock.sn] && deviceInfo[dock.sn].mode_code !== EModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'"> |
| | | {{ deviceInfo[dock.sn] ? EModeCode[deviceInfo[dock.sn].mode_code] : |
| | | EModeCode[EModeCode.Disconnected] }} |
| | | {{ deviceInfo[dock.sn] ? EModeText[deviceInfo[dock.sn].mode_code] : |
| | | EModeText[EModeCode.Disconnected] }} |
| | | </div> |
| | | </div> |
| | | <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;"> |
| | |
| | | <div style="float: right; background: #595959; height: 100%; width: 40px;" |
| | | class="flex-row flex-justify-center flex-align-center"> |
| | | <div class="fz16" |
| | | @click="switchVisible($event, dock, true, dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected)"> |
| | | @click="switchVisible($event, dock, true, dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected, dock.gateway.sn)"> |
| | | <a v-if="osdVisible.gateway_sn === dock.gateway.sn && osdVisible.visible"> |
| | | <EyeOutlined /> |
| | | </a> |
| | |
| | | </div> |
| | | </a-collapse-panel> |
| | | </a-collapse> |
| | | |
| | | <!--设备--> |
| | | <a-collapse :bordered="false" expandIconPosition="right" accordion style="background: #232323;"> |
| | | <a-collapse-panel :key="EDeviceTypeName.Aircraft" header="在线设备" style="border-bottom: 1px solid #4f4f4f;"> |
| | | <div v-if="onlineDevices.data.length === 0" style="height: 150px; color: white;"> |
| | |
| | | </div> |
| | | </a-collapse-panel> |
| | | </a-collapse> |
| | | |
| | | <!-- 测试视频播放组件 --> |
| | | <!-- <JessibucaVideo videoUrl="https://www.ainfo.top:700/rtp/34020000001110000101_34020000001310000001.flv" /> --> |
| | | </div> |
| | | <Drawer title="项目设置" :styleDrawer="styleDrawer" v-model:show="showDrawer"> |
| | | <DockConfig /> |
| | | </Drawer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { styleDrawer } from './common/common' |
| | | import { useConnectWebSocket } from '/@/hooks/use-connect-websocket' |
| | | import { flyTo } from '/@/hooks/use-center-point' |
| | | import { computed, onMounted, reactive, ref, watch, WritableComputedRef } from 'vue' |
| | | import { EDeviceTypeName, ELocalStorageKey } from '/@/types' |
| | | import Drawer from '/@/components/Drawer/Drawer.vue' |
| | | import JessibucaVideo from '/@/components/Jessibuca/Jessibuca.vue' |
| | | import noData from '/@/assets/icons/no-data.png' |
| | | import { Empty } from 'ant-design-vue' |
| | | import rc from '/@/assets/icons/rc.png' |
| | | import { OnlineDevice, EModeCode, OSDVisible, EDockModeCode, DeviceOsd } from '/@/types/device' |
| | | import { OnlineDevice, EModeCode, OSDVisible, EDockModeCode, DeviceOsd, EDockModeText, EModeText } from '/@/types/device' |
| | | import { useMyStore } from '/@/store' |
| | | import { getDeviceTopo, getUnreadDeviceHms, updateDeviceHms } from '/@/api/manage' |
| | | import { RocketOutlined, EyeInvisibleOutlined, EyeOutlined, RobotOutlined, DoubleRightOutlined } from '@ant-design/icons-vue' |
| | | import { EHmsLevel } from '/@/types/enums' |
| | | import { UranusMqtt } from '/@/mqtt/index' |
| | | import DockConfig from './components/DockConfig.vue' |
| | | |
| | | const { appContext } = getCurrentInstance() |
| | | const global = appContext.config.globalProperties |
| | | const route = useRoute() |
| | | const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE |
| | | // const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE |
| | | const store = useMyStore() |
| | | const username = ref(localStorage.getItem(ELocalStorageKey.Username)) |
| | | const workspaceId = ref(localStorage.getItem(ELocalStorageKey.WorkspaceId)!) |
| | | const osdVisible = ref({} as OSDVisible) |
| | | const hmsVisible = new Map<string, boolean>() |
| | | const scorllHeight = ref() |
| | | const showDrawer = ref(false) |
| | | const onlineDevices = reactive({ |
| | | data: [] as OnlineDevice[] |
| | | }) |
| | | |
| | | const onlineDocks = reactive({ |
| | | data: [ |
| | | { |
| | | model: '我是model字段', |
| | | callsign: '我是callsign字段', |
| | | sn: '我是sn字段', |
| | | mode: '我是mode字段', |
| | | gateway: { |
| | | model: 'gateway.model', |
| | | callsign: 'gateway.callsign', |
| | | sn: '我是gateway.sn字段', |
| | | mode: '我是gateway.mode字段', |
| | | }, |
| | | payload: [ |
| | | { |
| | | index: 1, |
| | | model: '2', |
| | | control_source: 'A', |
| | | payload_sn: 'payload_sn', |
| | | payload_index: 'payload_index', |
| | | payload_name: 'payload_name', |
| | | }, |
| | | ] |
| | | }, |
| | | ] as unknown as OnlineDevice[] |
| | | data: [] as OnlineDevice[] |
| | | }) |
| | | |
| | | const deviceInfo = computed(() => store.state.deviceState.deviceInfo) |
| | |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | // flyTo(global.$viewer, route.params.longitude as unknown as number, route.params.latitude as unknown as number) |
| | | // getOnlineTopo() |
| | | // setTimeout(() => { |
| | | // watch(() => store.state.deviceStatusEvent, |
| | | // data => { |
| | | // getOnlineTopo() |
| | | // if (data.deviceOnline.sn) { |
| | | // getUnreadHms(data.deviceOnline.sn) |
| | | // } |
| | | // }, |
| | | // { |
| | | // deep: true |
| | | // } |
| | | // ) |
| | | // getOnlineDeviceHms() |
| | | // }, 3000) |
| | | getOnlineTopo() |
| | | setTimeout(() => { |
| | | watch(() => store.state.deviceStatusEvent, |
| | | data => { |
| | | getOnlineTopo() |
| | | if (data.deviceOnline.sn) { |
| | | getUnreadHms(data.deviceOnline.sn) |
| | | } |
| | | }, |
| | | { |
| | | deep: true |
| | | } |
| | | ) |
| | | getOnlineDeviceHms() |
| | | }, 3000) |
| | | const element = document.getElementsByClassName('scrollbar').item(0) as HTMLDivElement |
| | | const parent = element?.parentNode as HTMLDivElement |
| | | scorllHeight.value = parent?.clientHeight - parent?.firstElementChild?.clientHeight |
| | |
| | | // const { data |
| | | } |
| | | // 监听ws 消息 |
| | | useConnectWebSocket(messageHandler) |
| | | // useConnectWebSocket(messageHandler) |
| | | function getOnlineTopo () { |
| | | getDeviceTopo(workspaceId.value).then((res) => { |
| | | if (res.code !== 0) { |
| | |
| | | }) |
| | | } |
| | | |
| | | function switchVisible (e: any, device: OnlineDevice, isDock: boolean, isClick: boolean) { |
| | | showDrawer.value = !showDrawer.value |
| | | // if (!isClick) { |
| | | // e.target.style.cursor = 'not-allowed' |
| | | // return |
| | | // } |
| | | // if (device.sn === osdVisible.value.sn) { |
| | | // osdVisible.value.visible = !osdVisible.value.visible |
| | | // } else { |
| | | // osdVisible.value.sn = device.sn |
| | | // osdVisible.value.callsign = device.callsign |
| | | // osdVisible.value.model = device.model |
| | | // osdVisible.value.visible = true |
| | | // osdVisible.value.gateway_sn = device.gateway.sn |
| | | // osdVisible.value.is_dock = isDock |
| | | // osdVisible.value.gateway_callsign = device.gateway.callsign |
| | | // osdVisible.value.payloads = device.payload |
| | | // } |
| | | // store.commit('SET_OSD_VISIBLE_INFO', osdVisible) |
| | | function switchVisible (e: any, device: OnlineDevice, isDock: boolean, isClick: boolean, sn?: any) { |
| | | // showDrawer.value = !showDrawer.value |
| | | if (!isClick) { |
| | | e.target.style.cursor = 'not-allowed' |
| | | return |
| | | } |
| | | if (device.sn === osdVisible.value.sn) { |
| | | osdVisible.value.visible = !osdVisible.value.visible |
| | | } else { |
| | | osdVisible.value.sn = device.sn |
| | | osdVisible.value.callsign = device.callsign |
| | | osdVisible.value.model = device.model |
| | | osdVisible.value.visible = true |
| | | osdVisible.value.gateway_sn = device.gateway.sn |
| | | osdVisible.value.is_dock = isDock |
| | | osdVisible.value.gateway_callsign = device.gateway.callsign |
| | | osdVisible.value.payloads = device.payload |
| | | } |
| | | store.commit('SET_OSD_VISIBLE_INFO', osdVisible) |
| | | store.commit('SET_HMSInfo_DetailSn', sn) |
| | | } |
| | | |
| | | function getUnreadHms (sn: string) { |
| | |
| | | transform: translateX(-100%); |
| | | -webkit-transform: translateX(-100%); |
| | | } |
| | | }</style> |
| | | } |
| | | </style> |