# Monitor DockDeviceCard Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** 将 Monitor 侧栏机巢设备卡抽成 `DockDeviceCard` 薄展示组件;选中/多选/过滤仍由页面持有。 **Architecture:** 新增 `DockDeviceCard.vue`(dock + 选中态 props,emit `select` / `toggle-select`)。`droneSummary` / `droneTag` 迁入组件;飞行高度通过可选 `altitudeOf(id)` 回调。继续使用 `prototype.css`。 **Tech Stack:** Vue 3 ` ``` - [ ] **Step 2: MonitorView 替换 device-list 循环** 将 `device-list` 内 `template v-for` + 整段 `article.device-card` 替换为: ```html
暂无匹配设备
``` script: ```js import DockDeviceCard from '@/components/DockDeviceCard.vue' function droneAltitude(id) { return devices.asset(id)?.altitude } ``` 删除页面内的 `droneSummary`、`droneTag` 函数(已迁入组件)。 保留:`groupedDocks`、`filteredDocks`、`filterCounts`、`selectedDockIds`、`isDockCardActive`、`setDockSelection`、`selectAllDocks`、`clearDockSelection`、搜索、filter-row、multi-select-bar、地图与控制。 确认 `select` / `setDockSelection` 可直接作为事件处理器(`select(id)`、`setDockSelection(id, checked)`)。 - [ ] **Step 3: 静态核对** ```bash rg -n 'DockDeviceCard|device-card|droneSummary|droneTag' src/components/DockDeviceCard.vue src/views/MonitorView/MonitorView.vue ``` Expected: - 组件内有 `device-card` / `droneSummary` / `droneTag` - MonitorView 使用 `DockDeviceCard`,无内联 `article.device-card`,无页面级 `function droneSummary` - [ ] **Step 4: Commit** ```bash git add src/components/DockDeviceCard.vue src/views/MonitorView/MonitorView.vue git commit -m "refactor: 抽取 Monitor DockDeviceCard 侧栏设备卡" ``` --- ### Task 2: 浏览器冒烟 **Files:** 无代码改动(验收) - [ ] **Step 1: 打开 /monitor** - 侧栏有 `article.device-card` - filter-row(全部/在线/告警)仍在 - multi-select-bar 仍在 - [ ] **Step 2: 交互** - 点击机巢主行:选中态 / 右侧聚焦仍工作 - 点击绑定无人机行:选中无人机 - checkbox 勾选:`multi-selected` 样式;全选/取消选择可用 - [ ] **Step 3: 回归** - map-type 卫星/地图仍在 - 无 console error - [ ] **Step 4: 记录结果** 失败则修组件事件/class 后补 commit;通过则完成。 --- ## 约束 - 工作目录:`/Users/qingyuan/CodeProject/laic-frontend` - 不改后台;精确 git add;中文 commit - 跳过全量单测;静态核对 + 浏览器冒烟