Browse Source

docs: 增加 TDesign 表单迁移第二轮实现计划

覆盖 Users / OperationLogs / Account / DeviceDetail。
main
xiaosi 3 weeks ago
parent
commit
e5b71e7601
  1. 76
      docs/superpowers/plans/2026-08-28-tdesign-form-controls-migration-wave2.md

76
docs/superpowers/plans/2026-08-28-tdesign-form-controls-migration-wave2.md

@ -0,0 +1,76 @@
# TDesign Form Controls Migration (Wave 2) 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:** 将 Users / OperationLogs / Account / DeviceDetail 剩余业务表单控件迁移到 TDesign,与第一轮约定一致。
**Architecture:** 原生 `select/input/number/password/email``t-select` / `t-input` / `t-input-number`;选项提成 `options`;保持 `v-model``@change=reload` 语义。参考第一轮 Devices/Tasks/Firmwares 写法与 scoped 宽度适配。
**Tech Stack:** Vue 3、`tdesign-vue-next`、现有布局 class
**Spec:** `docs/superpowers/specs/2026-08-28-tdesign-form-controls-migration-design.md`(映射约定沿用;本轮覆盖原「后续轮次」页面)
---
### Task 1: UsersView
**Files:**
- Modify: `src/views/UsersView/UsersView.vue`
- [ ] keyword → `t-input` clearable(保留 `@keyup.enter="reload"`,可加 `@clear="reload"`
- [ ] `roleFilter``t-select` + options:`''/admin/user`,`@change="reload"`
- [ ] 必要 scoped CSS(`.asset-search .t-input { width:100% }`)
- [ ] Commit: `feat: 用户管理表单控件切换到 TDesign`
---
### Task 2: OperationLogsView
**Files:**
- Modify: `src/views/OperationLogsView/OperationLogsView.vue`
- [ ] keyword → `t-input` clearable
- [ ] `statusFilter``t-select` + options:`''/sent/acked/timeout/terminal`,`@change="reload"`
- [ ] Commit: `feat: 操作日志表单控件切换到 TDesign`
---
### Task 3: AccountView
**Files:**
- Modify: `src/views/AccountView/AccountView.vue`
- [ ] `trafficAmount``t-input-number`(min=1;旁注 GB)
- [ ] 发票资料:title / taxpayerNumber / email → `t-input`(email 可用 `type="email"` 或默认)
- [ ] 若存在订单 `<select v-model="invoiceOrderId">``t-select` + computed options;否则只换已有 input
- [ ] 编辑资料弹窗 name/email → `t-input`
- [ ] 修改密码弹窗 → `t-input type="password"`(可 `type="password"`
- [ ] Commit: `feat: 账户中心表单控件切换到 TDesign`
---
### Task 4: DeviceDetailView
**Files:**
- Modify: `src/views/DeviceDetailView/DeviceDetailView.vue`
- [ ] `alarmStatusFilter``t-select` + options:`''/active/resolved`
- [ ] 本页若无其它业务 input 则不动
- [ ] Commit: `feat: 设备详情告警筛选切换到 TDesign`
---
### Task 5: 验收
- [ ] `rg '<select' src/views/UsersView src/views/OperationLogsView src/views/AccountView src/views/DeviceDetailView` → 0
- [ ] 浏览器冒烟:admin 验 Users + Firmwares 不回归;user 验 OperationLogs + Account;DeviceDetail 告警筛选
- [ ] 全站业务页原生 select 清零(或仅剩明确标注的非表单例外)
---
## 约定(同第一轮)
1. `:options="[{label,value}]"`;空筛选用 `''`
2. 不改后台;不 `git add -A`
3. 跳过全量测试;浏览器冒烟
4. 尺寸 medium;最少 CSS 调宽
Loading…
Cancel
Save