From d918e01ffc39d74ead5824a07b9daea4c7fa6a6f Mon Sep 17 00:00:00 2001
From: xiaosi <2652281683@qq.com>
Date: Mon, 31 Aug 2026 14:05:29 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8A=BD=E5=8F=96=20Monitor=20Dock?=
=?UTF-8?q?DeviceCard=20=E4=BE=A7=E6=A0=8F=E8=AE=BE=E5=A4=87=E5=8D=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/DockDeviceCard.vue | 72 +++++++++++++++++++++++++++
src/views/MonitorView/MonitorView.vue | 69 ++++++-------------------
2 files changed, 86 insertions(+), 55 deletions(-)
create mode 100644 src/components/DockDeviceCard.vue
diff --git a/src/components/DockDeviceCard.vue b/src/components/DockDeviceCard.vue
new file mode 100644
index 0000000..429d819
--- /dev/null
+++ b/src/components/DockDeviceCard.vue
@@ -0,0 +1,72 @@
+
+
+
+ $emit('toggle-select', dock.id, checked)"
+ />
+
+
+
+
+
+
+ 检测到设备告警{{ dock.updated }}
+
+
+ 最后在线 {{ dock.updated }}网络中断
+
+
+
+
+
diff --git a/src/views/MonitorView/MonitorView.vue b/src/views/MonitorView/MonitorView.vue
index 153dfd2..73062e3 100644
--- a/src/views/MonitorView/MonitorView.vue
+++ b/src/views/MonitorView/MonitorView.vue
@@ -24,47 +24,17 @@
-
-
-
- setDockSelection(dock.id, checked)"
- />
-
-
-
-
-
-
- 检测到设备告警{{ dock.updated }}
-
-
- 最后在线 {{ dock.updated }}网络中断
-
-
-
-
+
暂无匹配设备
@@ -406,6 +376,7 @@ import mapHelper from '@/core/mapHelper'
import mapConfig, { MAP_STYLES, MAP_OVERVIEW, MAP_VIEW } from '@/config/map'
import { applyChineseLabels } from '@/utils/mapLabels'
import LivePlayer from '@/components/LivePlayer.vue'
+import DockDeviceCard from '@/components/DockDeviceCard.vue'
import { getLivePlayURL, heartbeatLive, joinLive, leaveLive } from '@/api/live'
import request from '@/utils/http'
import * as urls from '@/config/urls'
@@ -1375,20 +1346,8 @@ function isDockCardActive(dock) {
return selectedId.value === dock.id || dock.children.some((c) => c.id === selectedId.value)
}
-function droneSummary(drone) {
- if (drone.statusClass === 'mission') {
- const alt = devices.asset(drone.id)?.altitude
- if (alt != null) return `飞行中 · ${alt} m`
- return '飞行中'
- }
- if (drone.statusClass === 'offline') return '设备离线'
- return drone.battery && drone.battery !== '--' ? `已入巢 · 充电 ${drone.battery}` : '已入巢'
-}
-
-function droneTag(drone) {
- if (drone.statusClass === 'mission') return '飞行中'
- if (drone.statusClass === 'offline') return '离线'
- return '在巢'
+function droneAltitude(id) {
+ return devices.asset(id)?.altitude
}
function goDetail() {