feat(web): 对齐和信后台页壳并落地工业 UI 评审与 Skills 盘点

统一控制台列表/表单页壳与 Hexin 样式,补充 industrial-ui-review、管理员评审证据,以及 Skills 资产盘点与 test-strategy 消歧。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
unknownandCursor committed 2026-11-19 17:44:26 +08:00
1 parent 48d1735c17
commit c7a23837f4
74 files changed
+3839 -601

No files matched your search

@@ -0,0 +1,112 @@
# Task Context Pack
## Task Goal
控制台已开发页(除登录)对齐和信企业 UI:单卡、约 32px、列表/表单 Pattern;AppShell 纳入;S0→S9 顺序;每页 Playwright 截图。
## Knowledge Posture
- Mode: standard
- Maturity: L1
## Current Slice Or Group
S0(待编码批准):AppShell + ListPageShell/FormPageShell + 列表 CSS
## Gate Policy
- Recommended: strict
- Selected: **autonomous**
- finalApprovalRequired: true
- Policy Notes: 片间可对已批准的 simple/standard 且 risk_score≤3 连续推进;分析→编码与最终批准仍停。每页仍截图检查。
## Requirement Source
`.task/2026-11-19/ui-hexin-align/requirement.md`
## Implementation Source
`.task/2026-11-19/ui-hexin-align/implementation-plan.md`
## Involved Modules Or Knowledge Areas
- console AppShell/业务 Vue
- design tokens + element-theme
- frontend-ui 列表/页脚约定
- 参考 syops AdminListPage(只对齐 Pattern,不整库拷贝)
## Loaded Rules
- `.cursor/rules/element-admin-ui.mdc`
- `.cursor/rules/sy-standards.mdc` → element-plus / frontend-stack / visual-ux(主色 D41)
- Marionettist gates(AGENTS.md)
## Loaded Docs
- `docs/ui/ELEMENT_MIGRATION.md`
- `docs/current/frontend-ui.md`
- `D:\FDE\SP\design-system\` DESIGN.md, PAGE_PATTERNS.md
- `docs/project/knowledge-map.md`(frontend 段)
## Allowed Modification Scope
当前片 S0:
- `web/apps/console/src/AppShell.vue`
- `web/apps/console/src/shared/**`(新壳组件与 CSS)
- `web/apps/console/src/styles.css`(import)
- tokens/element-theme 仅补缺
- `docs/evidence/ui-hexin/`
后续片见 implementation-plan 各片 Allowed。
## Forbidden Modification Scope
- `LoginPanel.vue` 与登录流程
- 后端、权限编码、Alembic
- 第二 UI 库、无授权业务功能
- 未批准片的业务页大改(S0 期间)
## Key Existing Entrypoints
- Shell: `AppShell.vue` → `RouterView`
- Routes: `router.ts`(hash)
- Lists: `DatasourceList` / `QueryList` / `MappingList` / `AlarmList`
- Forms: `DatasourceEdit` / `QueryEdit` / `QueryVersionView` / `MappingEdit` / `AlarmDetail`
- Home: `HomeView.vue`
- Tokens: `web/design/tokens.css` → `shared/styles/element-theme.css`
- E2E: `web/apps/console/e2e/*.spec.ts`;config `playwright.config.ts`
- Ref: `D:\PROJECT\syops\frontend\src\features\admin\components\AdminListPage.vue`
## Execution Mode
sequential;autonomous 下 S0 批准后可连续 S1…S9(各 standard/simple、risk≤3)
## Validation Commands
- 模块 e2e(按片):`pnpm --dir web/apps/console exec playwright test e2e/<module>.spec.ts`(以 package 脚本为准)
- 截图:`docs/evidence/ui-hexin/S{n}-*.png`
- 最终:相关 console e2e 回归
## Assumptions
- 映射列表 API 分页能力以现有 client 为准;无分页则不伪造数据
- 保留现有 `data-testid` 优先,结构变时最小改 e2e
- 面包屑下不重复页面大标题(frontend-ui)
## Risks
- 共享骨架改动影响所有后续页选择器
- MappingList 历史实现与列表约定差距大
- Tailwind 与 EP 共存间距类名不一致
## Stop Conditions
- 未获「开始编码」确认前不改代码
- 需伪造后端分页/改业务语义时停问
- e2e 大面积失败且非样式引起时停问
- 任务结束需最终批准
## Delivery Notes
- 主 Agent 可在本任务内连续实现+截图;不自动 commit/push
@@ -0,0 +1,297 @@
# UI Hexin Align Implementation Plan
## Requirement Source
`.task/2026-11-19/ui-hexin-align/requirement.md`
用户确认:autonomous;S0 先;AppShell 纳入。
## Scope Summary
共享壳层与列表/表单骨架,再逐页套用;功能不变;登录除外;每页 Playwright 截图。
## Involved Modules Or Areas
- `web/apps/console` 壳层与业务 Vue
- `web/design/tokens.css`、`shared/styles/element-theme.css`(仅必要时微调)
- `web/apps/console/e2e/*`(截图/回归,不改 login 语义)
- 参考:`D:\PROJECT\syops\...\AdminListPage.vue`、`components-ds.css`、`element-trial.css`
## Loaded Rules
- `.cursor/rules/element-admin-ui.mdc`
- `AGENTS.md` project-local UI/Marionettist
- `standards://frontend/element-plus`(最新)、`frontend-stack`、`visual-ux`(主色以 D41 为准)
## Loaded Docs
- `docs/ui/ELEMENT_MIGRATION.md`
- `docs/current/frontend-ui.md`
- `D:\FDE\SP\design-system\` DESIGN / PAGE_PATTERNS / COMPONENTS
- `docs/project/knowledge-map.md`(frontend 路由)
## Global Forbidden Scope
- `LoginPanel.vue`、登录文案与登录专用样式大改
- 后端 `apps/`、`alembic/`、权限编码
- 依赖大升级、第二 UI 库
- 未确认的业务语义变更
## Execution Strategy
- Complexity: complex
- Default Execution: sequential
- Parallel Execution: not-needed
- Fallback Execution: sequential
- Merge Owner: primary agent
- Conflict Resolution Rule: 共享骨架与 CSS 由 S0 拥有;后续页只消费槽位,冲突回退改骨架
## Gate Policy Notes
- Selected: **autonomous**
- 分析→编码门禁、最终批准仍停
- 片间:`gateClass` 为 `simple`/`standard` 且 `risk_score <= 3`、无 critic/显式停时可连续推进
- 每页仍产出截图报告;不因 autonomous 跳过视觉检查
## Slice Dependency Graph
| Slice | Depends On | Can Run In Parallel With | Fallback Order | Shared Files | Merge Owner | Conflict Risk |
| --- | --- | --- | --- | --- | --- | --- |
| S0 | — | — | 1 | AppShell, shared layout CSS/components | primary | medium |
| S1 | S0 | — | 2 | HomeView | primary | low |
| S2 | S0 | — | 3 | DatasourceList | primary | low |
| S3 | S0 | — | 4 | DatasourceEdit | primary | low |
| S4 | S0 | — | 5 | QueryList | primary | low |
| S5 | S0 | — | 6 | QueryEdit, QueryVersionView | primary | low |
| S6 | S0 | — | 7 | MappingList | primary | medium |
| S7 | S0 | — | 8 | MappingEdit | primary | medium |
| S8 | S0 | — | 9 | AlarmList | primary | low |
| S9 | S0 | — | 10 | AlarmDetail | primary | low |
## Implementation Slices
### Slice S0: AppShell + 共享列表/表单骨架
#### Goal
侧栏/主区留白对齐;新增轻量 `ListPageShell`/`FormPageShell`(或等价)+ 必要 CSS(单卡、32px、筛选/分页槽位);暂不强制改完所有业务页。
#### Allowed Modification Scope
- `web/apps/console/src/AppShell.vue`
- `web/apps/console/src/shared/**`(新组件与 list/form CSS)
- `web/apps/console/src/styles.css`(仅 import)
- `web/design/tokens.css`/`element-theme.css`(仅缺 token 时)
- `docs/evidence/ui-hexin/`(壳层基线截图)
- 可选:最小 unit/story 级无强制
#### Forbidden Scope
- 业务列表/编辑页大改(留给后续片)
- LoginPanel、后端
#### Execution
- Mode: sequential
- Depends On: —
- Gate Class: standard
- Risk Score: 3
- Gate Reasons: shared-layout-foundation
- Validation Level: slice
#### Steps
1. 对照 HXOPS AdminListPage/admin-table-section,落本仓轻量壳与 CSS
2. 微调 AppShell 内容区内边距与侧栏视觉(主色 soft active 已有则保持)
3. Playwright 打开已登录壳(如概览)截图基线
#### Validation Command
- 控制台 e2e:`pnpm --filter console exec playwright test e2e/health.spec.ts`(或项目惯用命令)+ 截图 `docs/evidence/ui-hexin/S0-shell.png`
#### Done Criteria
- 骨架可被后续页 import;壳层无登录改动;有截图
#### Rollback Notes
删除共享组件/CSS import;还原 AppShell
---
### Slice S1: 概览 HomeView
#### Goal
概览页套用表面卡片与 32px 边距;健康卡不重复页面标题噪音。
#### Allowed Modification Scope
- `HomeView.vue`;证据截图;必要时 e2e/health 选择器
#### Forbidden Scope
- 其他业务模块
#### Execution
- Gate Class: simple
- Risk Score: 1
- Gate Reasons: visual-only
- Validation: Playwright + `docs/evidence/ui-hexin/S1-home.png`
---
### Slice S2: 数据源列表
#### Goal
`DatasourceList` 套用 ListPageShell;水平 32px;筛选/表/分页槽位;行为不变。
#### Allowed Modification Scope
- `DatasourceList.vue`;相关 e2e 选择器若因结构变;截图
#### Execution
- Gate Class: standard
- Risk Score: 2
- Validation: `e2e/datasources.spec.ts` 相关 + `S2-datasource-list.png`
---
### Slice S3: 数据源新建/详情
#### Goal
`DatasourceEdit` 套用 FormPageShell;固定居中页脚;正文滚动。
#### Allowed Modification Scope
- `DatasourceEdit.vue`;e2e/截图
#### Execution
- Gate Class: standard
- Risk Score: 2
- Validation: datasources e2e 子集 + create/detail 截图
---
### Slice S4: 查询列表
#### Goal
同 S2 模式套 `QueryList`。
#### Allowed Modification Scope
- `QueryList.vue`;e2e/截图
#### Execution
- Gate Class: standard
- Risk Score: 2
---
### Slice S5: 查询编辑 + 版本只读
#### Goal
`QueryEdit`、`QueryVersionView` 表单壳与页脚;预览区视觉从属于本页。
#### Allowed Modification Scope
- `QueryEdit.vue`、`QueryVersionView.vue`;必要时 `PreviewPanel.vue` 边距;e2e/截图
#### Execution
- Gate Class: standard
- Risk Score: 3
- Gate Reasons: multi-file-form
---
### Slice S6: 映射列表
#### Goal
按列表规范重做/大改 UI:单卡、筛选查询重置、操作列宽、分页区(若 API 已支持则接上;否则先视觉分页槽位与空态,不伪造后端能力)。硬编码文案逐步 i18n 若工作量可控,否则本片至少统一样式。
#### Allowed Modification Scope
- `MappingList.vue`;`mappings` locales 若已有入口;e2e/mappings;截图
#### Execution
- Gate Class: standard
- Risk Score: 3
- Gate Reasons: largest-visual-gap
---
### Slice S7: 映射编辑
#### Goal
`MappingEdit`/`RuleGroup` 布局与页脚对齐 FormPageShell;功能不变。
#### Allowed Modification Scope
- `MappingEdit.vue`、`RuleGroup.vue`(仅布局);e2e/截图
#### Execution
- Gate Class: standard
- Risk Score: 3
---
### Slice S8: 报警列表
#### Goal
`AlarmList` 套 ListPageShell。
#### Allowed Modification Scope
- `AlarmList.vue`;alarms e2e/截图
#### Execution
- Gate Class: standard
- Risk Score: 2
---
### Slice S9: 报警详情
#### Goal
`AlarmDetail` 套 Form/Detail 壳;页脚操作居中。
#### Allowed Modification Scope
- `AlarmDetail.vue`;e2e/截图
#### Execution
- Gate Class: standard
- Risk Score: 2
## Validation Strategy
- 每片:结构断言(testid 尽量保留)+ 全页截图 1440×900(及可选 1280)
- 片末可跑该模块既有 Playwright;全量 console e2e 在 S9 后或最终批准前
- 证据:`docs/evidence/ui-hexin/S{n}-*.png`
## Knowledge Sync
- 仅当布局约定相对 `frontend-ui.md` 有语义变化时更新该文档;纯实现不扩 knowledge-map
## Stop Conditions
- 分析→编码:需用户确认开工
- 映射 API 不支持分页却要伪造数据:停问
- 选择器大破导致无法回归:停问或最小修复 e2e
- 最终批准:`finalApprovalRequired: true`
+43
View File
@@ -0,0 +1,43 @@
# Task Intake Result
## Task Type
refactor(前端 UI/布局对齐和信企业 Design System;排除登录页)
## Current Understanding
- 目标:已开发控制台业务页(除 `LoginPanel`)按新 UI 规范调整样式与布局;不便改可按旧功能重做页面。
- 规范真源:`D:\FDE\SP\design-system\`(DESIGN / PAGE_PATTERNS / COMPONENTS)+ 本仓 `docs/ui/ELEMENT_MIGRATION.md`、`docs/current/frontend-ui.md`、tokens `#0284c7`(D41)。
- Token/EP 桥接已接入;主要缺口是 **单层卡片骨架、左右约 32px 对齐、列表筛选区/分页槽位** 与 HXOPS `AdminListPage` 同构,而非业务逻辑重写。
- 用户要求:**先列页面 → 逐页改 → 每页 Playwright + 截图验收**。
- 登录页明确 **排除**。
## Gate Policy
- config/default: `balanced`
- allowTaskOverride: true
- recommended: `strict`(逐页改 + 截图验收,希望每页后停顿)
- selected: (待用户确认)
- reason or override reason: 用户明确要求一页一改并检查;与 `strict` 切片门禁更匹配
- effective: 确认前按 default `balanced`;确认后写 task-local
- finalApprovalRequired: true
## Blocking Questions
1. 门禁选 `strict`(推荐,每页后停)还是 `balanced`/`autonomous`?
2. 是否同意先做 **S0 共享壳层 + 列表/表单骨架**,再按下方顺序逐页?
3. `AppShell`(侧栏/面包屑)是否纳入本轮?默认建议纳入。
## Non-blocking Assumptions
- 不改后端 API/权限语义;映射列表功能缺口(分页/排序/i18n)在改 UI 时可顺带对齐 `frontend-ui.md` 列表约定,不扩展新业务能力。
- 证据目录拟用 `docs/evidence/ui-hexin/`。
- 参考实现:`D:\PROJECT\syops\frontend\...\AdminListPage.vue`,本仓可做轻量同构组件,不拷贝整个 HXOPS。
## Recommended Next Step
用户确认门禁与改造顺序后 → `implementation-slicer` + `context-pack-builder` → 从 S0 或用户指定的第一页开工。
## Suggested Prompt For Next Step
确认:`gatePolicy.selected=strict`;范围含 AppShell;按 intake 清单顺序从 S0 骨架开始。
@@ -0,0 +1,35 @@
# UI 对齐和信企业规范 — 冻结范围
## Goal
将 Watchman 控制台已开发页面(**排除登录页**)的样式与布局对齐和信企业 Design System + 本仓 `frontend-ui.md`/`ELEMENT_MIGRATION.md`。功能语义保持不变。
## Confirmed Decisions
- `gatePolicy.selected` = **autonomous**
- 先做 **S0**:`AppShell` + 共享列表/表单骨架,再按页推进
- **纳入** `AppShell`
- 每页改完用 Playwright 截图检查;证据目录 `docs/evidence/ui-hexin/`
- 登录页 `LoginPanel` / 登录相关 e2e **不改**
## In Scope
- `AppShell` 侧栏、面包屑、内容区留白
- 共享列表/详情页骨架(轻量同构 HXOPS `AdminListPage`:单卡、约 32px、筛选/表/分页槽位)
- 页面:概览、数据源列表/编辑、查询列表/编辑/版本、映射列表/编辑、报警列表/详情
- 现有 Playwright 用例回归;新增/更新截图证据
## Out of Scope
- 登录页视觉与流程
- 后端 API、权限点、业务状态机
- 新业务功能(映射列表可对齐已有列表约定的分页/筛选**视觉与交互形态**,不新增未授权能力)
- 引入第二 UI 库;拷贝整个 HXOPS
## Acceptance
- 业务页内容区为单层表面卡片(或等价),水平对齐约 32px
- 列表:筛选「查询才请求」、表体滚动、分页在卡底;符合 `frontend-ui.md`
- 详情/表单:页脚按钮居中固定,正文可滚
- Primary/字阶/圆角走 tokens;无页面散落 hex 改主色
- 每页有 Playwright 截图证据;关键现有 e2e 不因纯样式改动失败
@@ -0,0 +1,26 @@
{
"taskId": "2026-11-19/ui-hexin-align",
"type": "refactor",
"phase": "review-complete-awaiting-final-approval",
"allowedToCode": false,
"currentSlice": "S9",
"lastGate": "slices-S0-S9-done-awaiting-final",
"nextCommand": "final-approval",
"slicesDone": ["S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9"],
"validation": {
"typecheck": "pass",
"uiHexinE2e": "9 passed",
"regression": "health+datasources+mappings 22 passed",
"evidence": "docs/evidence/ui-hexin/"
},
"gatePolicy": {
"recommended": "strict",
"selected": "autonomous",
"effective": "autonomous",
"finalApprovalRequired": true,
"allowTaskOverride": true,
"defaultMode": "balanced",
"overrideReason": "user-selected-autonomous"
},
"updatedAt": "2026-11-19T08:06:00Z"
}
+8 -8
View File
@@ -1,17 +1,17 @@
{
"taskId": "2026-11-19/m06-alarm-center",
"type": "feature",
"phase": "done",
"taskId": "2026-11-19/ui-hexin-align",
"type": "refactor",
"phase": "review-complete-awaiting-final-approval",
"allowedToCode": false,
"currentSlice": "S6",
"lastGate": "user-closed-done-local",
"nextCommand": "none",
"currentSlice": "S9",
"lastGate": "slices-S0-S9-done-awaiting-final",
"nextCommand": "final-approval",
"gatePolicy": {
"recommended": "strict",
"selected": "autonomous",
"effective": "autonomous",
"recommended": "strict",
"finalApprovalRequired": true,
"allowTaskOverride": true
},
"updatedAt": "2026-11-19T07:25:00Z"
"updatedAt": "2026-11-19T08:06:00Z"
}