# 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`