From 0b58700ce0eeef47687a2102eba2a08b2daa3068 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Tue, 10 Oct 2023 17:03:06 +0800
Subject: [PATCH] 添加设备、计划库的默认文字
---
src/pages/page-web/projects/implement.vue | 125 +++--------------------------------------
1 files changed, 9 insertions(+), 116 deletions(-)
diff --git a/src/pages/page-web/projects/implement.vue b/src/pages/page-web/projects/implement.vue
index 3a5b3b6..007b745 100644
--- a/src/pages/page-web/projects/implement.vue
+++ b/src/pages/page-web/projects/implement.vue
@@ -7,7 +7,6 @@
<a-col :span="3"></a-col>
</a-row>
</div>
-
<div>
<div>
<a-row style="padding: 15px 0">
@@ -16,17 +15,15 @@
当前设备
</a-col>
</a-row>
-
<a-row>
<a-col :span="1"></a-col>
<a-col :span="22">
-
<div v-if="onlineDocks.data.length === 0" style="height: 150px; color: white;">
<a-empty style="color: #fff;" :image="simpleImage" description="暂无数据"
:image-style="{ height: '60px' }" />
</div>
<div v-else class="fz12" style="color: white;">
- <div @click="selectOnlineDock(dock)" v-for="dock in onlineDocks.data" :key="dock.sn"
+ <div v-for="dock in onlineDocks.data" :key="dock.sn"
:style="{ background: '#3c3c3c', 'margin-bottom': '10px' }">
<div style="border-radius: 2px; height: 60%; width: 100%;"
class="flex-row flex-justify-between flex-align-center">
@@ -34,11 +31,7 @@
<!-- // 机场设备标题 -->
<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 class="text-hidden" style="max-width: 200px;">{{ dock.gateway.callsign}} - {{ dock.callsign ?? 'No Drone'}}
</div>
</a-tooltip>
</div>
@@ -59,7 +52,7 @@
</div>
</div>
<div class="mr5 flex-align-center flex-row"
- style="width: 85px; margin-right: 0; height: 18px;">
+ style="width: 125px; margin-right: 0; height: 18px;">
<div v-if="hmsInfo[dock.gateway.sn]" class="flex-align-center flex-row">
<div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
@@ -77,7 +70,7 @@
:overlayStyle="{ width: '200px', height: '300px' }">
<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;">
+ style="margin-left: 3px; width:107px; height: 16px;">
<span class="word-loop">{{
hmsInfo[dock.gateway.sn][0].message_zh }}</span>
</div>
@@ -116,7 +109,7 @@
</a-popover>
</div>
<div v-else class="width-100"
- style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
+ style="height: 90%; background: rgba(0, 0, 0, 0.35)">N/A</div>
</div>
</div>
<!-- // 机场是否启动 -->
@@ -135,7 +128,7 @@
</div>
</div>
<div class="mr5 flex-align-center flex-row"
- style="width: 85px; margin-right: 0; height: 18px;">
+ style="width: 125px; margin-right: 0; height: 18px;">
<div v-if="hmsInfo[dock.sn]" class="flex-align-center flex-row">
<div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
@@ -153,7 +146,7 @@
:overlayStyle="{ width: '200px', height: '300px' }">
<div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
- style="margin-left: 3px; width: 62px; height: 16px;">
+ style="margin-left: 3px; width:107px; height: 16px;">
<span class="word-loop">{{ hmsInfo[dock.sn][0].message_zh
}}</span>
</div>
@@ -192,7 +185,7 @@
</a-popover>
</div>
<div v-else class="width-100"
- style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
+ style="height: 90%; background: rgba(0, 0, 0, 0.35)">N/A</div>
</div>
</div>
</div>
@@ -203,36 +196,27 @@
</a-col>
</a-row>
</div>
-
</div>
</div>
</template>
<script lang="ts" setup>
import {
- PlusOutlined,
- MinusOutlined,
RocketOutlined,
- EyeInvisibleOutlined,
- EyeOutlined,
RobotOutlined,
DoubleRightOutlined,
- FileTextOutlined,
} from '@ant-design/icons-vue'
import { useRoute } from 'vue-router'
import { ERouterName, EHmsLevel } from '/@/types/enums'
import { computed, onMounted, reactive, ref, watch, WritableComputedRef } from 'vue'
import { EDeviceTypeName, ELocalStorageKey } from '/@/types'
-import JessibucaVideo from '/@/components/Jessibuca/Jessibuca.vue'
-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'
import { getDeviceTopo, getUnreadDeviceHms, updateDeviceHms } from '/@/api/manage'
const route = useRoute()
const store = useMyStore()
-const workspaceId = ref(localStorage.getItem(ELocalStorageKey.WorkspaceId)!)
+const workspaceId = computed(() => store.state.common.projectId || localStorage.getItem(ELocalStorageKey.WorkspaceId))
const hmsVisible = new Map<string, boolean>()
const deviceInfo = computed(() => store.state.deviceState.deviceInfo)
const dockInfo = computed(() => store.state.deviceState.dockInfo)
@@ -254,19 +238,6 @@
const onlineDevices = reactive({
data: [] as OnlineDevice[]
})
-
-const historyCheckArr = reactive({
- data: [] as OnlineDevice[]
-})
-
-const historyDocks = reactive({
- data: [] as OnlineDevice[]
-})
-
-const osdVisible = ref({} as OSDVisible)
-const onlineCheck = ref(false)
-const historyCheck = ref(false)
-
watch(
() => onlineCheckArr.data,
(newVal) => {
@@ -298,58 +269,6 @@
scorllHeight.value = parent?.clientHeight - parent?.firstElementChild?.clientHeight
})
-// 在线设备全选
-function onlineCheckBoxChange (item: any) {
- onlineDocks.data.forEach(e => {
- e.selected = !e.selected
- })
-
- if (item.target.checked) {
- onlineCheckArr.data = onlineDocks.data
- } else {
- onlineCheckArr.data = []
- }
-}
-
-function historyCheckBoxChange (item: any) {
- historyDocks.data.forEach(e => {
- e.selected = !e.selected
- })
-
- historyCheckArr.data = historyDocks.data
-}
-
-// 在线机场点击
-function selectOnlineDock (item: OnlineDevice) {
- // 当前已被选中,排除
- if (item.selected) {
- onlineCheckArr.data = onlineCheckArr.data.filter(e => e.sn !== item.sn)
- } else {
- // 当前未被选中,push
- onlineCheckArr.data.push(item)
- }
- item.selected = !item.selected
- if (onlineCheckArr.data.length === onlineDocks.data.length) {
- onlineCheck.value = true
- } else {
- onlineCheck.value = false
- }
-}
-
-function selectHistoryDock (item: OnlineDevice) {
- // 当前已被选中,排除
- if (item.selected) {
- historyCheckArr.data = historyCheckArr.data.filter(e => e.sn !== item.sn)
- } else {
- // 当前未被选中,push
- historyCheckArr.data.push(item)
- }
- item.selected = !item.selected
- if (historyCheckArr.data.length === historyDocks.data.length) {
- historyCheck.value = true
- }
-}
-
// 监听ws 消息
// useConnectWebSocket(messageHandler)
function getOnlineTopo () {
@@ -373,9 +292,6 @@
domain: gateway?.domain
},
payload: [],
-
- // 是否选中
- selected: false
}
child?.payloads_list.forEach((payload: any) => {
device.payload.push({
@@ -405,7 +321,6 @@
hmsInfo.value[sn] = res.data
}
})
- console.info(hmsInfo.value)
}
function getOnlineDeviceHms () {
@@ -423,28 +338,6 @@
deviceSnList.forEach(sn => {
getUnreadHms(sn)
})
-}
-
-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)
}
</script>
--
Gitblit v1.9.3