From 2639f3bcb2f821dbc4907e54ea9ed48a54e532f2 Mon Sep 17 00:00:00 2001
From: xiaosi <2652281683@qq.com>
Date: Mon, 31 Aug 2026 10:11:45 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E9=A1=B5=E7=AD=BE=E4=B8=8E=E5=88=97=E8=A1=A8=E5=88=87=E6=8D=A2?=
=?UTF-8?q?=E5=88=B0=20TDesign?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/DevicesView/DevicesView.vue | 173 ++++++++++++++------------
1 file changed, 93 insertions(+), 80 deletions(-)
diff --git a/src/views/DevicesView/DevicesView.vue b/src/views/DevicesView/DevicesView.vue
index e5d5755..b691eba 100644
--- a/src/views/DevicesView/DevicesView.vue
+++ b/src/views/DevicesView/DevicesView.vue
@@ -20,10 +20,10 @@
-
-
-
-
+
+
+
+
@@ -353,17 +323,48 @@ function matchesFilters(d) {
const haystack = [d.name, d.code, d.sn, d.location, d.binding].filter(Boolean).join(' ').toLowerCase()
return haystack.includes(q)
}
+const docksTabLabel = computed(() => `机巢设备 ${devices.docks.length}`)
+const dronesTabLabel = computed(() => `无人机 ${devices.drones.length}`)
+
+const dockColumns = [
+ { colKey: 'name', title: '机巢设备', width: '18%' },
+ { colKey: 'status', title: '状态' },
+ { colKey: 'binding', title: '绑定无人机' },
+ { colKey: 'mode', title: '控制模式' },
+ { colKey: 'location', title: '设备位置' },
+ { colKey: 'version', title: '软件版本' },
+ { colKey: 'updated', title: '最近上报' },
+ { colKey: 'actions', title: '操作', width: '20%' }
+]
+
+const droneColumns = [
+ { colKey: 'name', title: '无人机', width: '18%' },
+ { colKey: 'status', title: '状态' },
+ { colKey: 'binding', title: '所属机巢' },
+ { colKey: 'battery', title: '电量' },
+ { colKey: 'mode', title: '飞行模式' },
+ { colKey: 'mission', title: '当前任务' },
+ { colKey: 'updated', title: '最近上报' },
+ { colKey: 'actions', title: '操作', width: '22%' }
+]
+
+const tableColumns = computed(() => (tab.value === 'docks' ? dockColumns : droneColumns))
+const tableData = computed(() => (tab.value === 'docks' ? filteredDocks.value : filteredDrones.value))
+
const filteredDocks = computed(() => devices.docks.filter(matchesFilters))
const filteredDrones = computed(() => devices.drones.filter(matchesFilters))
-function setTab(next) {
- tab.value = next
+function onTabChange() {
resetFilters()
drawerOpen.value = false
}
+function handleRowClick({ row }) {
+ openDrawer(row.id)
+}
+
function resetFilters() {
search.value = ''
statusFilter.value = ''
@@ -557,6 +558,18 @@ async function doUpgrade() {
.drawer-section-title :deep(.t-button) {
font-size: 11px;
}
+.device-asset-tabs :deep(.t-tabs__nav-container) {
+ padding: 0 18px;
+}
+.device-asset-tabs :deep(.t-tabs__nav-wrap) {
+ margin-left: 0;
+}
+.asset-table-wrap :deep(.t-table) {
+ background: transparent;
+}
+.asset-table-wrap :deep(.t-table__body tr) {
+ cursor: pointer;
+}