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 @@
-
- - -
+ + + +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
机巢设备状态绑定无人机控制模式设备位置软件版本最近上报操作
无人机状态所属机巢电量飞行模式当前任务最近上报操作
-
- - {{ d.name }}{{ d.code }} -
-
{{ d.status }}{{ d.binding }}{{ d.mode }}{{ d.location }}{{ d.version }}{{ d.updated }} -
- 固件升级 - 远程控制 - 详情 - 删除 -
-
暂无符合条件的设备
-
- - {{ d.name }}{{ d.code }} -
-
{{ d.status }}{{ d.binding }}{{ d.battery }}{{ d.mode }}{{ d.mission }}{{ d.updated }} -
- 航线上传 - 远程控制 - 详情 -
-
暂无符合条件的设备
+ + + + + +
@@ -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; +}