From e064422b4af97fd8e3fea8b0ff0f835421b3757f Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Fri, 28 Aug 2026 16:40:57 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0=20TDesign=20?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=BF=81=E7=A7=BB=E7=AC=AC=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按 Devices → Tasks → Firmwares 分任务替换 select/input/number/time。 --- ...6-08-28-tdesign-form-controls-migration.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 docs/superpowers/plans/2026-08-28-tdesign-form-controls-migration.md diff --git a/docs/superpowers/plans/2026-08-28-tdesign-form-controls-migration.md b/docs/superpowers/plans/2026-08-28-tdesign-form-controls-migration.md new file mode 100644 index 0000000..69c779f --- /dev/null +++ b/docs/superpowers/plans/2026-08-28-tdesign-form-controls-migration.md @@ -0,0 +1,180 @@ +# TDesign Form Controls Migration (Wave 1) 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:** 将 Devices / Tasks / Firmwares 三页业务表单控件迁移到 TDesign,统一 select/input/number/time 体验,不改业务逻辑与后台。 + +**Architecture:** 页面内把原生控件替换为 `t-select` / `t-input` / `t-input-number` / `t-time-picker` / `t-switch`;选项提成 `options` 数组;保持现有 `v-model` 类型与提交校验。Vite 已配置 `TDesignResolver`,无需手动全局注册。 + +**Tech Stack:** Vue 3、`tdesign-vue-next`、现有 `prototype.css` 布局容器 + +**Spec:** `docs/superpowers/specs/2026-08-28-tdesign-form-controls-migration-design.md` + +--- + +### Task 1: DevicesView 表单控件迁移 + +**Files:** +- Modify: `src/views/DevicesView/DevicesView.vue` +- Modify (若含原生 input): `src/components/DockEditModal.vue` + +- [ ] **Step 1: 增加 options 常量** + +```js +const statusOptions = [ + { label: '全部状态', value: '' }, + { label: '在线', value: 'online' }, + { label: '任务中', value: 'mission' }, + { label: '告警', value: 'alarm' }, + { label: '离线', value: 'offline' }, + { label: '待连接', value: 'pending' }, +] +const bindingOptions = [ + { label: '全部绑定状态', value: '' }, + { label: '已绑定', value: 'bound' }, + { label: '未绑定', value: 'unbound' }, +] +``` + +升级固件 options 用 computed: + +```js +const upgradeFirmwareOptions = computed(() => + firmwareList.value.map((f) => ({ label: firmwareOptionLabel(f), value: f.id })) +) +``` + +- [ ] **Step 2: 工具栏替换** + +```vue +