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;
+}