Files
yunke/docs/superpowers/plans/2026-08-08-yunke-delete-accountlist.md
T

71 lines
2.9 KiB
Markdown

# 删除 AccountList 页 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: superpowers:subagent-driven-development or superpowers:executing-plans.
**Goal:** 删除冗余 AccountList 页,`/accounts` 客户端重定向 `/staff`,清导航/注释;保留后端 `getAccounts`。
**Spec:** `docs/superpowers/specs/2026-08-08-yunke-delete-accountlist-design.md`(总 spec §115-122 收尾)。
## 关键事实(grep 已核实)
- `router/index.ts:25-29` `/accounts` route;`MainLayout.vue:126` menu-item;`StaffList.vue:27,836` 注释;`api/index.ts:123` `getAccounts`(保留)。
## Task 1: 删除 AccountList + 重定向
**Files:** `router/index.ts`(改)、`views/AccountList.vue`(删)、`layouts/MainLayout.vue`(改)、`views/StaffList.vue`(改注释)。
- [ ] **Step 1: `router/index.ts` — 删 `/accounts` route + 加 redirect**
把
```typescript
{
path: '/accounts',
name: 'accounts',
component: () => import('@/views/AccountList.vue'),
meta: { title: '账号列表' },
},
```
替换为重定向(放原位置):
```typescript
{
path: '/accounts',
redirect: { name: 'staff' },
},
```
- [ ] **Step 2: 删 `yunkes/src/views/AccountList.vue`**
```bash
git rm yunkes/src/views/AccountList.vue
```
- [ ] **Step 3: `layouts/MainLayout.vue` — 删 `/accounts` menu-item**
删除 `<el-menu-item index="/accounts"> ... </el-menu-item>`(约 line 126,含其内容)。确认其它菜单项不受影响。
- [ ] **Step 4: `views/StaffList.vue` — 更新 2 处注释**
- line ~27:` * Row click opens the all-fields drawer reused from AccountList.vue.` → ` * Row click opens the all-fields drawer (built via accountFields.ts).`
- line ~836:`<!-- All-fields drawer (reused from AccountList.vue / accountFields.ts) -->` → `<!-- All-fields drawer (built via accountFields.ts) -->`
- [ ] **Step 5: vue-tsc + grep 兜底**
```bash
cd /d/refactor/yunke/yunkes && npx vue-tsc -b # exit 0(无悬空 AccountList import)
```
grep `AccountList` 在 `yunkes/src` 应无残留 UI 引用(`api/index.ts` 的 getAccounts 不算)。
- [ ] **Step 6: 浏览器实测**
访问 `http://localhost:5173/accounts` → URL 变 `/staff`、StaffList 渲染;导航菜单无「账号」;StaffList 正常(`getAccounts` 工作)。
- [ ] **Step 7: Commit**
```bash
git add yunkes/src/router/index.ts yunkes/src/layouts/MainLayout.vue yunkes/src/views/StaffList.vue
git commit -m "chore(ui): 删除冗余 AccountList 页,/accounts 重定向 /staff(总 spec 收尾)"
```
End with blank line + `Co-Authored-By: Claude <noreply@anthropic.com>`。
(`AccountList.vue` 已 Step 2 `git rm` 暂存,一并入 commit。)
## 验收
- `vue-tsc -b` exit 0;grep 无 AccountList UI 残留。
- 浏览器:`/accounts`→`/staff` 客户端重定向 + StaffList 渲染;菜单无「账号」;getAccounts 仍工作。
## 风险
- 悬空 import → vue-tsc 报错(grep + 编译兜底)。
- redirect 用 `name:'staff'`(staff 路由存在,已核实)。