feat: expand vehicle data platform capabilities

This commit is contained in:
lingniu
2026-07-27 16:46:15 +08:00
parent e3a1f80f86
commit 3c4bece72c
650 changed files with 62155 additions and 2552 deletions

View File

@@ -0,0 +1,42 @@
# 接入身份治理连续性审计
## 结论
本轮把接入管理中原本只读的“来源身份待绑定”卡片改造成可完成、可恢复、可审计的处置任务。管理员现在可以在同一个治理工作面中核对来源证据、搜索并选择现有权威车辆、明确确认风险、提交绑定、取得审计回执,并根据车辆档案缺口继续补全主档。
## 关键变化
1. 治理列表新增“开始认领”,不再只描述问题。
2. 认领任务沿用既有治理 SideSheet桌面 640 px 宽,移动端为近全高 bottom sheet内容独立滚动返回与确认操作固定。
3. 认领分为核对来源、选择主车辆、确认并留痕三步;候选项只来自现有权威车辆,不允许手填或猜测 VIN。
4. 保存前必须勾选证据确认;说明支持最多 500 字,冲突和失效来源均有可见反馈。
5. `accessGovernance=claim&accessIdentity=...` 保存任务位置;失效深链会解释可能原因并返回治理列表。
6. 后端事务同时校验来源注册、权威 VIN 和既有手机号绑定,更新 `vehicle_identity_binding``jt808_registration`,并写入不可变 `vehicle_access_identity_audit`
7. 成功回执显示操作者、时间、审计编号、目标 VIN 和车辆档案完整度;档案不完整时直达 `/vehicles/:vin#vehicle-archive-panel`
8. 认领完成后未解析队列即时从 1 归零;关闭工作面后键盘焦点返回治理入口。
## 浏览器证据
- 桌面1440 × 1000验证治理列表、认领入口、三步任务、候选车辆、预览和固定操作区。
- 移动390 × 844验证近全高 bottom sheet、单一内容滚动、固定底栏、提交回执和档案补全入口。
- 失效深链:能展示“待认领来源已失效”及返回动作。
- 焦点:关闭治理抽屉后 `document.activeElement` 恢复为 `aria-label="打开接入治理"` 的按钮。
截图:
- `before/02-desktop-governance.png``before/04-mobile-governance.png`:只读基线。
- `after/01-desktop-governance.png``after/03-mobile-governance.png`:同状态下新增明确认领入口。
- `after/02-desktop-claim-review.png``after/04-mobile-claim-review.png`:桌面与移动端确认状态。
- `after/05-mobile-claim-success.png`:审计回执和 7 项档案待补结果。
- `comparison-before-after.png`:同视口基线与结果的组合审阅图。
## 回归
- Go`go test ./...`
- Web 定向生产入口、API 客户端与接入页面 51 项测试通过。
- Web 全量78 个测试文件、485 项测试通过。
- 构建:`tsc -b`、Vite production build、发布资产校验通过接入页产物约 44.22 kB / gzip 13.94 kB。
## 无障碍边界
已验证对话框名称、步骤/候选列表语义、必选确认、禁用提交、状态回执、失效恢复和关闭后的焦点返回。当前自动化仍会报告 Semi UI 内部 `findDOMNode` 弃用警告;尚未完成 VoiceOver 人工通读、强制色彩模式和浏览器缩放 200% 的整轮人工验收,这些不作为本轮已完成能力声明。

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

View File

@@ -0,0 +1,36 @@
# 账号授权连续性验收
## 结果
账号管理已补齐大规模权限配置中的三个关键保护:草稿差异持续可见、权限收回保存前展示精确影响、切换客户或离开页面前阻止未保存内容丢失。详情内新增“切换客户”入口,桌面和移动端都无需先退出配置工作区。
## 验收证据
- [桌面权限差异预览](./desktop-access-diff.jpg)1440 × 900菜单与车辆收回同时显示保存操作固定在底部。
- [桌面草稿切换确认](./desktop-switch-draft.jpg)1440 × 900显示当前草稿、目标客户与服务器影响。
- [移动端权限收回确认](./mobile-access-reduction-confirm.jpg)390 × 844确认框在首屏内完整呈现“收回 1 个菜单、移除 1 辆车”。
## 设计对照
采用已实现稿作为接受基线:
- `../ui-ux-20260720/desktop-users-implemented.png`
- `../ui-ux-20260720/mobile-users-implemented.png`
通过真实浏览器截图与原图检查完成五点对照:
1. 信息架构:保留“目录 → 详情 → 登录身份/菜单/车辆”的既有层级,只在详情顶部增加可达的客户切换入口。
2. 视觉密度:差异条和切换条各占一行,未引入新的卡片嵌套;主要操作仍固定在底部。
3. 任务连续性:草稿、切换、关闭和权限收回均明确说明影响,保存后详情继续保持打开。
4. 状态语义:新增使用蓝/绿/橙/红表达新增、调整、收回与停用,危险动作仍使用独立确认层。
5. 响应式与可访问性1440 × 900 和 390 × 844 均无横向溢出;切换器、差异区、确认框均有可识别名称和键盘语义。
首屏固定文案与接受基线一致;新增文案仅在账号详情和动态草稿状态中出现,没有改变页面入口含义。检查未发现需要继续修正的实质性偏差。
## 验证
- `UsersPage.test.tsx`14 / 14 通过。
- Web 全量测试75 个文件、445 / 445 通过。
- 生产构建:通过,`web_build_gate=ok`78 个发布资源。
- 已知输出仅为 React Router 未来版本提示、Semi UI `findDOMNode` 提示和 Sass `@import` 弃用提示,不影响本轮功能。

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,49 @@
# 账号批量导入失败恢复审计
## 结论
当前健康度:良好。账号管理已经从“只能逐个创建”升级为可恢复的批量任务流:管理员可以下载模板、上传 CSV、在创建前完成服务端预检、原位修复单行问题并只创建校验通过的账号。部分成功时保留失败项不要求重新上传整份文件。
## 1. 基线:入口与任务能力
基线页只有“新建客户账号”,批量开户需要重复进入表单,错误也无法集中定位。
![改造前账号目录](before/01-account-directory-desktop.jpg)
## 2. 桌面端:预检优先
桌面端使用 900px 宽任务抽屉同时容纳文件摘要、预检状态、逐行结果和固定底部操作。测试文件共 3 行1 行可创建、1 行用户名冲突、1 行车辆未接入。
![桌面端批量预检](after/01-account-import-preflight-desktop.jpg)
## 3. 桌面端:原位修复
首个失败项会自动展开,管理员可直接修改账号、密码、状态、菜单和 VIN修改后重新预检不丢失已解析的其他行。
![桌面端逐行修复](after/02-account-import-repair-desktop.jpg)
## 4. 移动端:单滚动任务面板
390 × 844 下切换为 94dvh 底部任务面板,摘要、结果和修复区使用同一内容滚动,主操作固定在底部。实测弹层宽 390px、文档宽 390px无横向溢出。
![移动端批量预检](after/03-account-import-preflight-mobile.jpg)
## 5. 行为与恢复规则
- CSV 表头固定为 `username,displayName,password,status,customerRef,tenantRef,menuKeys,vehicleVins`,每次最多 50 个账号。
- 预检复用单账号创建的用户名、密码、菜单和 VIN 校验规则,并检测文件内重复及库内用户名冲突。
- 创建按行隔离事务;单行失败不会回滚已成功账号,结果保留行号、错误类型和修复入口。
- 部分成功后,主操作明确为“仅保留 N 个失败项”;目录刷新后仍保留原搜索、状态、页码与导入窗口 URL 状态。
- 直接访问 `?userImport=open` 可恢复导入工作区;关闭窗口只移除导入参数。
## 6. 无障碍与验证
- 弹层具有“批量导入客户账号”名称,关闭按钮具有中文动作名称;区域、结果列表、字段和主操作均可由语义树识别。
- 已验证桌面和移动端主链路、深链恢复、文件上传、服务端预检、逐行修复和创建回执。
- 自动化测试覆盖 CSV 引号解析、模板输出、URL 保持、预检、修复与创建;全量前端 76 个文件、467 个测试通过API 全量测试通过,生产构建门禁通过。
- 当前限制:本轮未用专用读屏器完成逐键走查,也未用仪器量化所有状态色对比度;键盘语义以浏览器语义树和组件自动化测试为依据。
- 沿用平台现有 Semi UI、图标、颜色和任务抽屉系统因此没有生成新的位图或装饰资产。
## 后续
账号模块下一项是外部身份源接入反馈;平台级下一轮优先处理历史导出保留期、账号级字段视图同步与大任务分页。

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -0,0 +1,29 @@
# 账号目录与编辑深链复核
## 本轮结果
1. 账号目录搜索、状态、页码与每页数量写入 URL刷新、分享与前进/后退可恢复工作位置。
2. 选中账号与登录身份、菜单权限、车辆权限编辑阶段可被精确还原;桌面侧栏与移动端全屏工作区使用同一来源。
3. 目录由一次性长列表改为 10/20/50 个账号分页,移动端固定为每页 10 个,避免超长滚动。
4. 深链账号已删除时显示“账号链接已失效”及清除入口;账号被当前筛选隐藏时保留详情并提示回到所在目录。
5. 账号内部切换和关闭仍复用原有未保存草稿确认,不因 URL 化绕过风险保护。
## 视觉证据
- `before/01-directory-desktop.jpg`:基线长目录,无页码与工作位置恢复提示。
- `after/01-deep-linked-editor-desktop.jpg`:第 2 页账号直接恢复到车辆权限阶段。
- `after/02-invalid-link-recovery-desktop.jpg`:失效账号链接修复提示。
- `after/03-deep-linked-editor-mobile.jpg`:移动端直接恢复到菜单权限阶段,主操作保持固定。
## 验证范围
- 桌面1440 × 1000。
- 移动端390 × 844。
- 自动化:账号页 17 个测试,包括路由规范化、深链恢复、失效链接修复和既有授权编辑流程。
- 可访问性:新增失效链接使用 `role="alert"`,范围外详情使用 `role="status"`;分页与编辑页签保留原生可访问名称。
## 已知限制
- 外部身份源接入仍只展示来源标签,尚未覆盖绑定失败、重新认证与冲突合并流程。
- 批量账号导入尚未建立逐行失败恢复和可下载错误报告。
- 浏览器视觉复核覆盖关键桌面/移动状态,未替代真实读屏器与全键盘人工走查。

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

View File

@@ -0,0 +1,35 @@
# 账号外部身份源连续性审计
审计日期2026-07-23。范围覆盖账号目录、外部身份详情、身份映射缺失、桌面侧栏和移动端底部侧栏。
## 结论
1. 修复了本地接口 404 被伪装成“还没有客户账号”的异步状态错误。真实失败现在明确说明“这不是空目录”,保留筛选并提供原位重试。
2. `DATA_MODE=mock` 且未启用 SQL 身份库时提供可操作的本地账号目录,覆盖本地账号、已连接 OneOS、缺少映射的 RuoYi 和停用账号;创建、编辑、批量预检/创建仍可在本地验证。
3. 目录新增本地/外部身份数量与“身份待关联”状态;身份源进入搜索范围,缺少映射不再被菜单或车辆就绪状态掩盖。
4. 编辑器展示身份源、脱敏外部主体、映射状态与凭据归属。外部登录密码、锁定和多因素认证明确归属上游,本平台继续维护启停、菜单和车辆范围。
5. 外部身份密码输入在前端只读,生产 SQL 路径与本地演示路径都以 `EXTERNAL_IDENTITY_PASSWORD_READ_ONLY` 拒绝越界写入。
## 当前运行证据
- 基线桌面:[目录错误被伪装为空目录](before/01-desktop-directory-error-as-empty.png)
- 基线移动端:[移动目录错误被伪装为空目录](before/02-mobile-directory-error-as-empty.png)
- 改进桌面:[真实账号目录与身份状态](after/01-desktop-directory.png)
- 改进桌面:[OneOS 映射与凭据归属](after/02-desktop-external-identity.png)
- 改进桌面:[RuoYi 映射缺失与处置说明](after/03-desktop-identity-warning.png)
- 改进移动端:[紧凑账号目录](after/04-mobile-directory.png)
- 改进移动端:[外部身份详情](after/05-mobile-external-identity.png)
- 同屏对照:[桌面前后对照](comparison-desktop-before-after.png) · [移动端前后对照](comparison-mobile-before-after.png)
## 验证
- 1440 × 980目录、已连接外部身份、缺失映射告警均通过真实浏览器检查。
- 390 × 844目录单滚动、详情固定操作区和外部身份摘要通过真实浏览器检查。
- 语义:身份映射使用 `status` / `alert`;外部凭据输入为 disabled目录条目无障碍名称包含身份源与映射状态从目录打开后关闭详情会把焦点返回原账号按钮。
- 自动化:`UsersPage.test.tsx` 20 项通过Web 生产构建通过;`apps/api/internal/app` 测试通过。
## 已知边界
- 当前没有可写的上游身份适配器管理接口,因此缺失映射只能说明上游/适配器处置边界,不能在本平台直接补写外部主体。
- 外部身份真实同步延迟、重复主体冲突和上游停用回流仍需要生产身份源样本验证。
- 本轮完成语义 DOM、键盘焦点和禁用态验证未执行 VoiceOver/NVDA 人工听读;由深链直接打开详情时没有原始触发按钮,关闭后焦点回到页面主体。

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -0,0 +1,34 @@
# 自动化创建工作区审计
审计日期2026-07-23
## 结论
- 编辑器尺寸、单滚动区和固定操作栏已经满足桌面与移动端任务工作区要求,本轮保留原有结构。
- 原首步以空规则名打开,立即显示“请填写自动化名称”并禁用下一步;移动端只看到灰色按钮,原因不够清晰。
- 新首步默认生成 `速度 > 80 km/h`,条件变化会同步推荐名称和实时摘要,下一步立即可用。
- 用户手动改名后不再被条件变化覆盖,并可通过“恢复推荐名称”重新启用自动同步。
- 模板、既有规则编辑和复制副本继续保留其显式业务名称。
## 证据
1. `01-before-automation-list.png`桌面自动化列表基线1440 × 900。
2. `02-before-create-step1.png`桌面创建首步改进前1440 × 900。
3. `03-before-create-mobile.png`移动创建首步改进前390 × 844。
4. `04-after-create-mobile.png`移动创建首步改进后390 × 844。
5. `05-after-create-desktop.png`桌面创建首步改进后1440 × 900。
6. `06-before-after-desktop-comparison.jpg`:同视口前后并排比较;左侧为空名称、即时错误和禁用按钮,右侧为推荐名称、同步摘要和可用主操作。
## 验证
- `AlertsPage.test.tsx`42/42。
- Web 正式测试504/504。
- Go API`go test ./...` 全部通过。
- 生产构建:`web_build_gate=ok`
- 真实交互390 × 844 下将阈值从 80 改为 90规则名称同步为 `速度 > 90 km/h`,底部“下一步:车辆范围”保持可用。
## 无障碍边界
- 规则名称保留显式文本标签,提示文本不额外抢占 `status` 实时区域,草稿状态仍是编辑器内唯一状态播报。
- 步骤导航、主操作和关闭/放弃草稿流程均保留原有语义与键盘焦点管理。
- 本轮通过 DOM 无障碍快照与键盘可达控件检查;尚未执行独立读屏软件的端到端人工朗读测试。

View File

@@ -0,0 +1,66 @@
# 自动化配置工作区重构
## 目标
把原本偏小、依赖整窗滚动的自动化弹窗改成可连续完成“事件与条件 → 车辆范围 → 执行动作 → 测试并发布”的近全屏工作区。桌面端让步骤、当前表单、实时摘要和主操作同屏;移动端固定步骤与操作区,只滚动当前表单。
## 设计与实现证据
- `automation-editor-desktop-concept.png`:使用内置 Image Gen 生成并选定的 1440 × 900 高保真设计基准。
- `automation-editor-desktop-implementation.png`:真实 React / Semi UI 在 1440 × 900 的桌面实现。
- `automation-editor-mobile-implementation.png`:真实页面在 390 × 844 的移动实现。
内置 Image Gen 最终提示以 `ui-mockup` 为用途,要求近全屏弹窗、固定头尾、四步横向导航、左侧当前表单、右侧 320px 实时摘要,并明确禁止小型居中弹窗、卡片墙、渐变、装饰图和可见外层滚动条。
## 实现结果
- 桌面弹窗由最多 1068px 扩展为最多 1360px视口四周保留 12px 安全边距;最大高度使用 `100dvh - 24px`
- 弹窗头部、步骤导航和底部操作区固定;常规数值规则在 1440 × 900 无需滚动即可完成第一步。
- 左侧表单只在围栏地图或车辆长列表等确有需要时独立滚动;右侧摘要始终保持可见。
- 四个触发类型在桌面改为单行排列,减少无意义纵向占用。
- 校验和保存错误进入固定底部操作区,不再隐藏在滚动内容末端。
- 移动端高度提升到最多 `96dvh`;步骤导航由两行 112px 压缩为单行 58px页面本身不滚动当前表单是唯一滚动容器。
- 移动端摘要保留紧凑标题,隐藏重复的三段明细与发布说明;完整摘要仍在测试发布步骤呈现。
- 自动化搜索、状态、协议与选中规则写入 URL刷新、分享和前进/后退可以恢复工作位置。
- 筛选隐藏当前规则时自动修复为首个可见规则;没有匹配项时清空详情,避免“列表为空但仍显示旧规则”的幽灵详情。
## Fidelity ledger
| 检查项 | 概念要求 | 实现结果 |
| --- | --- | --- |
| 工作区尺寸 | 接近填满 1440 × 900 | 已实现1360 × 876四周 12px |
| 信息同屏 | 步骤、表单、摘要、操作同屏 | 已实现;桌面第一步无需滚动 |
| 滚动边界 | 外层不滚动,长内容局部滚动 | 已实现;桌面页面 900/900移动页面 844/844 |
| 表单效率 | 四触发类型单行,字段双列 | 已实现;常规规则首屏完整 |
| 实时摘要 | 约 320px、持续可见 | 已实现;桌面 320px × 545px |
| 固定操作 | 取消、上一步、下一步持续可见 | 已实现;桌面与移动均固定在底部 |
| 移动导航 | 紧凑步骤与单一内容滚动 | 已实现58px 单行步骤,表单局部滚动 |
| 视觉系统 | 白、冷灰、克制蓝、细边框 | 已实现;沿用平台与 Semi UI 令牌 |
| 路由恢复 | 配置入口外的工作位置可分享 | 已实现;筛选和选中规则由 URL 驱动 |
实现与概念在主要结构、密度、尺寸、固定边界和视觉层级上忠实一致,没有实质性偏差。
## 首屏文案对比
- 概念使用“数值或状态 / 车辆静止 / 车辆离线”;实现保留领域内更精确的“数值触发 / 长时间静止 / 长时间离线”。
- 概念使用“大于”;实现继续显示 API 契约操作符 `>`,避免编辑与事件契约出现两套语义。
- 概念使用“60 秒”;实现同时显示输入值 `60` 与格式化辅助文本“1 分钟”,便于直接编辑又便于理解。
## 有意差异
- 实现保留现有平台导航与真实表单控件,不复制概念图中的装饰性触发图标。
- 移动端不常驻完整实时摘要,因为它会重复当前表单信息并增加约 300px 滚动;紧凑标题与最终测试摘要仍保留。
- 围栏地图、车辆快捷选择属于真实长内容,允许左侧当前表单独立滚动,不能为追求“零滚动”裁剪功能。
## 验证
- `AlertsPage.test.tsx`35 项测试通过,包括创建入口、四步流程、移动 bottom sheet、桌面 review、URL 恢复、幽灵详情修复和未保存草稿保护。
- 事件中心与历史页定向回归63 项测试全部通过;全量前端 75 个文件 / 442 项测试通过;生产构建及发布资产校验通过。
- 桌面 1440 × 900弹窗 1360 × 876左侧表单 `scrollHeight = clientHeight = 543`;页面无纵向滚动;切换车辆范围后底部操作与摘要位置不变。
- 移动 390 × 844弹层 390 × 810步骤栏 58px页面无纵向滚动第一步当前表单只需 127px 局部滚动。
- 桌面与移动均实际填写名称并进入“车辆范围”,步骤标题、固定操作区和摘要/导航位置保持稳定。
- 概念图和两张实现截图均以原始分辨率复核。
## Image Gen 说明
设计基准使用内置 Image Gen 模式生成,没有使用 CLI 回退。最终项目资产保存在本目录的 `automation-editor-desktop-concept.png`

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -0,0 +1,28 @@
# 自动化规则治理审计2026-07-23
## 结果
- 规则库检索、状态、协议、当前/归档范围、摘要与 10/20/50 条分页均由服务端执行,前端不再加载完整规则集后本地筛选。
- 当前规则和审计归档使用同一规则数据源与 URL 状态;归档范围不显示编辑、启停或版本恢复写操作。
- 归档只接受已停用规则,要求当前版本和 4200 字原因;归档会清理评估器候选与状态,但保留配置、版本、事件与通知。
- 恢复同样要求当前版本与原因,并明确保持停用;归档与恢复都写入不可变版本审计。
- 规则库、创建/更新、启停、归档与恢复均为管理员能力;评估器与兼容规则列表主动排除归档规则。
## 验证
- `go test ./...`:后端完整测试通过。
- `pnpm exec vitest run src/api/client.test.ts src/v2/pages/AlertsPage.test.tsx`82 项定向测试通过。
- `pnpm test -- --run`:前端 78 个测试文件、522 项测试全部通过。
- `pnpm build`TypeScript、Vite 生产构建和发布资产门禁通过,共生成 83 项发布资源。
- `bash deploy/install-web-release.test.sh`:发布安装脚本测试通过,并覆盖迁移 `036_alert_rule_archive.sql`
- 本地 Mock API 已验证 `/api/v2/alerts/rules/library` 返回完整范围摘要和分页契约,并以一次性 Mock 数据验证归档回执。
- Codex 内置浏览器连接不可用,因此没有使用其他浏览器替代,也没有生成“改造后”截图冒充真实验收结果。
## 基线证据
- `01-rule-library-before-desktop.png`:改造前桌面规则库,仅有客户端筛选与日常规则列表。
- 待内置浏览器恢复后补测 1440×900 桌面布局、390×844 移动布局、归档/恢复 URL 回放和键盘焦点顺序。
## 发布约束
先执行 `deploy/migrations/036_alert_rule_archive.sql`,再发布 API/Web 并重启两个告警评估器。归档演示和浏览器验收只能使用 Mock 数据,禁止在生产规则上为了截图执行生命周期写操作。

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,27 @@
# 自动化运行记录范围审计
## 问题
自动化详情曾请求全局最近 6 条事件,再在浏览器中按当前规则过滤。高频规则会挤掉其他规则的真实命中,导致详情错误显示“暂无运行记录”。
## 修复
1. 运行记录查询随当前选中规则发送 `ruleId`,由事件服务在完整授权范围内筛选后返回最近 6 条。
2. 标题明确展示“当前自动化最近 n / 总数”,避免把预览误解为全部记录。
3. 桌面详情和移动端摘要都提供“运行记录”入口,进入带规则筛选的完整事件流,并保留返回原自动化的上下文。
## 视觉证据
- `01-before-global-six-run-scope-desktop.png`:修复前的模糊范围说明。
- `02-after-rule-scoped-run-history-desktop.png`:修复后的当前规则计数与完整入口。
- `03-rule-filtered-event-stream-desktop.png`:桌面完整事件流与返回上下文。
- `04-rule-run-entry-mobile.png`:移动端详情中的运行记录入口。
- `05-before-after-run-scope-comparison.png`:桌面前后对比。
- `06-rule-filtered-event-stream-mobile.png`:移动端完整事件流。
## 验证
- `AlertsPage.test.tsx`44 项通过,新增规则范围查询与完整事件流 URL 回归。
- Web 正式套件510 项通过。
- API`go test ./...` 全部通过。
- 生产构建Web、开放门户和 API 二进制全部通过。

View File

@@ -0,0 +1,68 @@
# 自动化版本历史与安全恢复验收
## 结论
自动化从“只能看到当前 vN”补齐为可审计、可比较、可安全恢复的版本工作流。恢复不会覆盖旧记录而是生成新版本恢复配置时始终保持当前启停状态避免历史版本意外启动或停止真实自动化。
## 审计步骤
1. **入口与可发现性**:桌面详情头新增“版本历史”;移动列表新增独立 42 × 42 px 历史按钮,未挤占规则主点击区。
2. **信息层级**:侧栏先给出当前版本、运行状态、历史数量,再按时间倒序展示版本、动作、操作人、时间、范围和执行动作。
3. **差异与决策**:每个历史版本标明与当前配置的实质差异数;配置相同的版本显示“无需恢复”,不提供无效操作。
4. **高风险确认**:恢复前明确目标版本、新版本号、变更数和“保持启用/停用”;说明确认前不会写入事件或发送真实通知。
5. **结果连续性**:恢复成功后列表、详情和版本侧栏原位更新,新产生的 `rollback` 版本出现在时间线顶部。
## 实现边界
- 后端新增版本列表与恢复 API并继续复用乐观锁当前版本变化时拒绝过期恢复请求。
- 审计快照兼容既有 create/update/enable/disable 记录,新增 rollback 动作。
- 恢复只复制规则配置,启停状态取当前线上状态。
- 管理员可以查看和恢复;恢复路由显式保持管理员权限。
- 桌面侧栏与移动 bottom sheet 共用一套数据和操作语义。
## 截图证据
### 改造前
- `audit-before/01-automation-detail-desktop.jpg`:桌面仅显示当前版本号,无历史入口。
- `audit-before/02-automation-list-mobile.jpg`:移动端仅有复制与启停入口。
### 改造后
- `audit-after/01-version-history-desktop.jpg`:桌面版本时间线与差异状态。
- `audit-after/02-rollback-confirm-desktop.jpg`:恢复影响确认。
- `audit-after/03-rollback-success-desktop.jpg`:恢复后生成新版本并原位刷新。
- `audit-after/04-version-history-mobile.jpg`:移动端全高版本工作区。
## 视觉保真检查5 点)
1. **结构**:保持事件中心原有“列表 + 常驻详情”,版本能力作为右侧任务层叠加,不改主导航。
2. **布局**:桌面 560 px 侧栏;移动使用 94dvh bottom sheet、固定底部操作区和单一内容滚动区。
3. **样式**复用平台蓝、现有边框、810 px 圆角、Semi 图标和 Workspace 组件,没有引入第二套视觉语言。
4. **交互**:桌面和移动均可查看、选择版本、确认恢复、看到结果;相同版本不显示恢复按钮。
5. **响应式**1440 × 900 与 390 × 844 均无横向溢出;移动触控入口和主要按钮不小于 42 px。
## 首屏文案差异
- 保留:`事件中心``自动化列表`、规则名称、运行状态与创建/编辑入口。
- 新增:桌面详情头的 `版本历史`;移动端使用图标按钮并提供完整可访问名称 `查看版本历史:{规则名}`
- 未新增冗余说明卡;审计和风险文案只在版本工作区与确认步骤出现。
## 验证
- Go 全量测试:`go test ./...` 通过。
- Web 正式测试集75 个文件、455 个测试通过。
- Web 生产构建与发布资产门禁通过。
- 真实浏览器完成桌面与移动入口、版本列表、恢复确认、恢复成功回写检查。
- 额外运行的旧版 `src/test/App.test.tsx` 存在 14 个与本次改动无关的既有里程/旧路由断言失败;正式测试脚本按项目配置排除该旧版套件。
## 无障碍检查与限制
- 版本面板、摘要、时间线、确认框和所有按钮均有角色与可访问名称;移动图标按钮不依赖图标含义。
- 状态不是只靠颜色表达,同时提供“当前版本”“差异”“无需恢复”“保持启用/停用”等文本。
- 浏览器 DOM 验证确认对话框焦点与关闭入口可达。
- 本轮未使用实体屏幕阅读器或硬件触控设备;语义、焦点与 390 px 模拟触控尺寸已验证,实体设备朗读顺序仍应在发布前抽检。
## 健康度
**健康,可发布(有已知非阻塞限制)**:核心任务链、并发保护、角色权限、桌面/移动布局、空/错/成功状态均已验证;剩余限制是实体辅助技术抽检,以及平台审计队列中的历史批量操作、差异批量处置和账号深链,继续放入下一轮。

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,46 @@
# 事件中心重构规格
## 产品结论
“告警”不是一级数据模型,而是事件的一种处置策略。三类协议统一进入事件域:
`协议事件源 → 标准事件契约 → 自动化匹配 → 动作/通知 → 运行记录`
事件中心只保留三个一级任务:
1. **事件流**:查看所有业务事件,只有需要人工介入的事件标记为“待关注”。
2. **自动化**:用“当、如果、就”配置触发、范围和动作。
3. **通知记录**:审计通知送达与已读状态,不与事件处置混为一谈。
## 三类协议
| 协议 | 事件源角色 | 标准事件类型示例 |
| --- | --- | --- |
| GB/T 32960 | 整车与新能源遥测 | `vehicle.telemetry.reported` |
| JT/T 808 | 位置、行驶与终端状态 | `vehicle.location.reported` |
| 宇通 MQTT | 厂商扩展遥测 | `vehicle.oem.telemetry.reported` |
统一事件最小契约:`event.type``source.protocol``subject.vin``occurred_at``received_at`。协议专有字段保留在 payload 中,不渗透到自动化框架。
## 参考模式
- PagerDuty Event Orchestration事件进入后按内容匹配嵌套规则并执行动作。
- Amazon EventBridge事件源进入总线规则匹配后路由到一个或多个目标。
- Grafana Alerting规则判断、通知策略和联系点分离。
本产品采用相同分层,但保留车辆业务语义和协议证据。
## 视觉系统
- 背景:真白与冷灰,不使用暖白或渐变光晕。
- 主色:羚牛蓝;红/橙仅用于确实需要关注的事件或执行失败。
- 容器:列表、轨道、分栏和表格优先,避免卡片墙与多层嵌套。
- 签名组件:接收 → 匹配 → 动作 → 结果的细蓝色执行轨迹。
- 桌面主工作区:事件流 70%,检查器 30%;移动端检查器变为底部 SideSheet。
## 视觉概念
- `event-stream-concept.png`:事件流与执行检查器。
- `automation-concept.png`:自动化主从布局、三阶段流程与运行记录。
图片仅是布局与视觉规格;文本、表格、按钮和交互均由 React 组件实现。

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -0,0 +1,89 @@
# 事件中心生产可用性审计
审计日期2026-07-22
审计范围:事件流、事件详情、自动化列表、自动化编辑器、通知记录、移动端事件流
目标用户:重要客户的一线值守、运营管理员与平台管理员
## 用户任务
1. 在大量车辆事件中快速找到需要人工处理的事件。
2. 判断事件是否可信,理解车辆、协议、观测值、规则和发生时间。
3. 接手、补充说明、完成或忽略事件,并追溯每一步操作。
4. 配置可理解、可验证、可审计的事件自动化。
5. 区分事件状态、自动化执行状态和通知送达状态。
## 当前截图证据
截图保存在:
`/Users/lingniu/.codex/visualizations/2026/07/22/019f8768-39da-7c50-a074-6c21efb5a42e/event-center-audit-2/`
1. `01-event-stream-current.jpg`:事件流默认状态。
2. `02-event-detail-current.jpg`:事件详情展开状态。
3. `03-automation-current.jpg`:自动化列表与详情。
4. `04-automation-editor-current.jpg`:自动化创建侧栏。
5. `05-notifications-current.jpg`:通知记录。
6. `06-mobile-event-stream-current.jpg`390 × 844 移动端事件流。
## 已确认的优点
- 已经把 GB/T 32960、JT/T 808、宇通 MQTT 抽象到统一事件模型。
- 事件、自动化规则、通知记录已经拥有独立的数据状态和 API。
- 事件详情具备观测值、匹配条件、动作历史、备注和车辆/轨迹/原始数据入口。
- 自动化支持数值、电子围栏、长时间静止、长时间离线四类触发,并有版本控制。
- 移动端已经改为列表而不是压缩桌面表格。
## 生产阻塞
### P0通知记录布局失效
通知卡片的标题、正文、通道和时间被拆成横向三列,正文所在区域出现大面积空白,通道标签被压缩为“站...”。这不是视觉偏好,而是信息结构错误;客户无法快速确认“什么事件、通过什么通道、何时送达、是否已读”。
### P0事件详情的处置动作不在稳定可见区
详情侧栏宽度不足VIN 与表格字段被截断;关键处置输入和动作位于首屏下方,同时底部又固定了车辆、轨迹、原始事件三个导航动作。值守人员打开事件后不能立即完成主任务。
### P1事件前置控制层过多
用户在看到第一条事件前依次经过:页面分区、筛选栏、状态统计条、协议接入条。状态统计和协议接入信息重复占据垂直空间,却没有直接帮助当前处置任务。
### P1自动化工作区同时展示过多层级
运行概览、规则列表、推荐模板、流程、运行记录和事件契约同时争夺注意力;推荐模板在窄列中逐字换行。事件契约对管理员有价值,但不应默认占据主要工作区。
### P1自动化编辑器缺少分步完成感
编辑器把“当、如果、就”的全部字段放进一条长滚动侧栏。保存按钮与当前错误距离过远,用户无法快速知道还差哪一步,也没有样本事件匹配测试。
### P1排版与可访问性风险
- 多处说明文字接近 1011px浅灰文字对比度偏低。
- 状态同时依赖颜色、圆点和极小文字,长时间值守可读性不足。
- 详情与编辑器需要继续验证键盘焦点顺序、焦点锁定、Esc 关闭与状态变更播报。
- 截图不能证明完整 WCAG 合规;仍需语义、键盘和自动化可访问性测试。
## 成熟产品带来的结构原则
- Datadog Events Explorer搜索、分面、保存视图和事件侧栏是一套连续探索流程而不是独立的仪表盘区块。
<https://docs.datadoghq.com/events/explorer/navigate/>
- PagerDuty事件详情必须把状态变化、人工动作和通知统一放入可过滤时间线。
<https://support.pagerduty.com/main/docs/incidents>
- Sentry列表负责筛选和优先级详情活动流负责完整生命周期。
<https://docs.sentry.io/product/issues/issue-details/>
- Grafana Alerting规则与由规则产生的事件实例是两个不同对象状态生命周期也必须分开表达。
<https://grafana.com/docs/grafana/latest/alerting/fundamentals/>
- Amazon EventBridge自动化核心是事件模式匹配和明确目标并需要用样本事件测试匹配结果。
<https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html>
## 重构验收要求
1. 默认首屏直接呈现事件,不再展示独立 KPI 与协议接入统计带。
2. 事件搜索、状态视图、协议、类型和时间范围构成一套统一查询模型。
3. 事件详情默认展示:身份、证据、规则、时间线和主处置动作;主动作无需滚动即可完成。
4. 状态采用“待处理 / 处理中 / 已恢复 / 已完成 / 已忽略”,事件状态、自动化运行、通知送达互不混用。
5. 自动化采用“事件触发 → 条件/范围 → 单一动作”的可测试编辑流程,并保留版本审计。
6. 通知改为正常的审计列表,明确事件、严重度、通道、送达时间、阅读状态。
7. 桌面、1024px 笔记本和 390px 移动端均无横向溢出、截断主操作或逐字换行。
8. 加载、空数据、错误、无权限、保存冲突和动作失败均有明确可恢复反馈。
9. 核心流程具备键盘可达、可见焦点、语义标签和状态更新播报。
10. 生产构建、前端测试、API 测试、视觉对照和 ECS 发布门禁全部通过后才可交付。

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -0,0 +1,106 @@
# 事件中心生产重构 Design QA
## Automation Editor Fidelity Correction — 2026-07-22
- reported issue: the production implementation opened desktop automation creation/editing in a full-height right SideSheet, while the selected source uses a centered modal.
- source: `automation-editor-desktop.png` (`1487 × 1058`, edit/review state after a successful sample test).
- implementation: `qa/automation-editor-modal-final-desktop.png` (`1487 × 1058`, the same edit/review/test-success state).
- combined comparison: `qa/compare-automation-editor-modal-final.png`, source left and implementation right, inspected at original detail.
- focused geometry: centered `1068 × 936` modal at the source viewport; at `1280 × 720` it remains centered and contracts to `1068 × 672` without document overflow.
- interaction: existing desktop automations open directly in review/test mode; create/template flows enter editable configuration first; publishing is disabled until the sample event test succeeds; mobile retains the bottom SideSheet.
- accessibility: the dialog, configuration summary, sample event test, execution trace, close control, edit controls and publishing controls all have stable accessible names.
- verification: `AlertsPage.test.tsx` passed `15 / 15`; TypeScript, Vite production build and artifact gate passed.
- production release: `automation-modal-fidelity-20260722145249`; ECS Web archive SHA-256 matched locally/remotely, the atomic Web installer passed its asset smoke, authenticated health reported this exact release, and the platform plus both alert evaluators remained active.
- intentional deviation: the footer uses `返回编辑` instead of the source's `保存草稿`, because the current API has no draft lifecycle and the UI does not pretend to persist one.
- pass history: P1 right-SideSheet mismatch fixed; P2 close-button alignment and unresolved modal color-token issue found during comparison, fixed and rechecked.
final result: passed
- selected direction: A「事件收件箱」
- product model: `Event → Automation → Execution → Delivery`
- protocol scope: `GB32960``JT808``YUTONG_MQTT`
- local prototype: `http://127.0.0.1:20301/alerts`
- browser method: Codex in-app Browser / IAB
- desktop viewport: `1487 × 1058`
- mobile viewport: `390 × 844`
## Visual Evidence
| Surface | Source | Implementation | Combined comparison |
| --- | --- | --- | --- |
| Event inbox | `event-inbox-desktop.png` | `qa/event-inbox-desktop.png` | `qa/compare-event-inbox.png` |
| Automation workspace | `automation-workspace-desktop.png` | `qa/automation-workspace-desktop.png` | `qa/compare-automation-workspace.png` |
| Delivery audit | `notification-audit-desktop.png` | `qa/notification-audit-desktop.png` | `qa/compare-notification-audit.png` |
| Automation editor | `automation-editor-desktop.png` | `qa/automation-editor-modal-final-desktop.png` | `qa/compare-automation-editor-modal-final.png` |
| Mobile event list | `event-inbox-mobile.png` | `qa/event-inbox-mobile.png` | same-viewport visual review |
| Mobile event detail | `event-inbox-mobile.png` | `qa/event-detail-mobile.png` | same-viewport visual review |
All paths are relative to this directory. Every combined comparison was inspected at original detail with the source on the left and implementation on the right.
## Fidelity Ledger
| Surface | Required fidelity | Implementation evidence | Result |
| --- | --- | --- | --- |
| Information architecture | The default task is to triage events, with automations and notification records as adjacent workspaces. | Text tabs preserve one clear primary task; the event stream is the default view. | Passed |
| Event contract | Alerts must be abstracted into canonical events independent of protocol. | Event rows and detail expose canonical event type, category, source protocol, source identifier, occurred/received timestamps, automation and execution state. | Passed |
| Event inbox | Operators need scan-first density and a stable inspector. | Compact table, semantic status tabs, selected-row state and a fixed `400px` inspector match the chosen direction. | Passed |
| Triage actions | Acknowledgement, completion and ignore must stay reachable. | Sticky footer actions remain visible at desktop `720px` height and in the mobile full-height sheet. | Passed |
| Automation model | Configuration should read as “when / if / then”. | Split workspace and four-step editor cover event trigger, conditions, actions, sample test and publish. | Passed |
| Execution evidence | Every event needs automation and execution traceability. | Inspector presents event facts, original event fields and execution timeline without mixing them into the list. | Passed |
| Delivery audit | Notification is a delivery result, not the event itself. | Independent delivery table and inspector expose channel, recipient, attempts, provider message ID, read state and delivery timeline. | Passed |
| Responsive continuity | Mobile must retain the same task model and actions. | `390 × 844` list and detail states use a full-height sheet, no horizontal overflow and visible actions. | Passed |
| Visual system | Reuse the existing product shell and Semi UI semantics. | Existing logo, navigation, typography, blue selection, neutral surfaces and red/orange/green status colors are preserved. | Passed |
## Interaction And Accessibility Checks
- Search, protocol filters, advanced filters, status tabs, reset and refresh are functional and keyboard-reachable.
- Event rows expose an accessible detail action; inspector and editor provide named close controls.
- Automation selection, edit, enable state and publish flow are connected to the existing API contract.
- Notification records support filter, mark-all-read and per-delivery inspection.
- Mobile list and detail have zero horizontal overflow at `390 × 844`.
- Canonical event tests, page interaction tests and production-entry tests passed `30 / 30`.
- Go API tests passed with `go test ./...`.
- Production build and route byte gate passed; vehicle route is `29,999` bytes against the `30,000` byte limit.
## Source-to-Implementation Comparison
1. Both use the same shell, cool-gray canvas, white work surfaces and brand-blue selection.
2. Both keep text tabs above a table-led event inbox, rather than competing dashboard cards.
3. Both use a narrow right inspector and preserve context while moving between events.
4. Both use semantic status color only for state and urgency, not decoration.
5. Both keep the event action bar anchored at the bottom of the inspector.
6. The implementation intentionally moves time range and scope into advanced filters to reduce the first-row query burden.
7. The implementation adds an explicit “全部事件” status tab and names the source column “协议”, improving discoverability for the three-protocol product.
8. The implementation turns the editor from a visual summary into a complete, editable four-step production form while preserving the selected visual hierarchy.
## Copy Differences
- “告警中心” becomes “事件中心” across the product surface.
- “告警列表” becomes “事件流”; “告警规则” becomes “自动化”.
- “通知” is consistently described as “通知记录 / 送达”, separating delivery from the event itself.
- Technical labels use stable contract terms such as “事件类型”, “执行状态”, “来源协议” and “服务商消息 ID”.
## Intentional Deviations And Follow-up
- The current local mock backend predates the new API binary, so a local sample can still display `vehicle.geofence.changed`; the new API normalizes this to `vehicle.geofence.exited` after release.
- The UI and contract support multiple delivery channels, while the current environment only has in-app delivery configured. Email, SMS or enterprise IM require provider credentials and are not simulated.
- The remaining full-Web-suite failures are fourteen stale mileage-page copy assertions in unrelated worktree changes. The event-center test surface, Go suite and production build are green.
## Result
No open P0, P1 or P2 issue was found in the event-center desktop, mobile, automation-editor or delivery-audit flows.
## Production Release Evidence
- release: `event-center-production-20260722120255`
- previous release: `event-center-simplified-20260722102200`
- artifact verification: local and ECS SHA-256 matched for the Web archive and Linux API binary
- release switch: immutable release directory plus atomic symlink switch; automatic rollback remained armed until all gates passed
- Web smoke: `76` current assets and `117` compatibility assets verified byte-for-byte
- authenticated health: `/api/ops/health` reported the exact new release
- runtime: platform API, alert evaluator and alert stream evaluator all remained `active`
- real event evidence: canonical events included `vehicle.connectivity.offline / connectivity / JT808 / pending` and the same event type from `YUTONG_MQTT`
- real automation evidence: `9` automations loaded, `2` enabled
- real delivery evidence: `in_app / delivered / JT808`, with vehicle VIN/plate, provider message ID and attempt count populated
final result: passed

View File

@@ -0,0 +1,105 @@
# 事件中心生产设计基线(方案 A事件收件箱
## 产品模型
事件中心不是“告警列表”。它由四个可追溯对象组成:
1. `Event`:三类协议统一抽象出的不可变事实。
2. `Automation`:按“当—如果—就”匹配事件并产生动作。
3. `Execution`:事件从接收、命中、通知到人工处置的执行轨迹。
4. `Delivery`:通知动作的排队、发送、送达、已读或失败审计。
事件页负责处理事件,自动化页负责定义规则,通知记录页只负责审计送达;三者不再混用状态。
## 视觉源
- `event-inbox-desktop.png`:桌面事件收件箱与常驻详情面板,主视觉基线。
- `automation-workspace-desktop.png`:自动化清单、逻辑画布、运行记录和契约面板。
- `automation-editor-desktop.png`:四步编辑器与样例事件测试。
- `notification-audit-desktop.png`:通知送达表与送达详情。
- `event-inbox-mobile.png`:移动端边到边事件列表与全高详情。
## 设计令牌
| 角色 | 值 | 用法 |
| --- | --- | --- |
| 页面背景 | `#F6F8FB` | 工作区底色 |
| 表面 | `#FFFFFF` | 表格、面板、抽屉 |
| 主文字 | `#17243D` | 标题、关键数据 |
| 次文字 | `#65748A` | 标签、元数据 |
| 边框 | `#E2E8F0` | 表格分隔、控件轮廓 |
| 主色 | `#1267E8` | 选中、焦点、主操作 |
| 危险 | `#D43C3C` | 待处理、失败 |
| 警示 | `#C66A16` | 地理围栏、重要提示 |
| 成功 | `#278254` | 恢复、完成、送达 |
| 中性 | `#78869A` | 忽略、禁用 |
- 仅使用真实白色表面,不使用奶油色、渐变或装饰性光晕。
- 圆角:控件 `6px`,面板 `8px`;不使用大圆角卡片容器。
- 阴影:默认无阴影,仅详情面板/模态焦点允许 `0 8px 28px rgba(23,36,61,.12)`
- 间距:`4 / 8 / 12 / 16 / 24 / 32px`;桌面主 gutter `16px`
## 字体与密度
- 字体沿用系统中文无衬线栈;正文与控件均显式定义。
- 页面标题 `20px/28px 700`;面板标题 `16px/24px 650`;正文/控件 `14px/20px 500`;元数据 `12px/18px 400`
- 表头 `12px/18px 600`;事件行最小高度 `72px`;移动事件行最小高度 `108px`
- 桌面控件高度 `40px`,移动触控目标不小于 `44px`
## 容器模型
- 顶部只保留文本标签页与单行查询工具栏。
- 事件流:主表格 + 选中时 400px 常驻详情;不再显示 KPI 条和协议来源条。
- 自动化340px 列表 rail + 逻辑画布 + 最近运行表;事件契约作为窄 inspector。
- 通知记录:单一审计表 + 400px 送达详情;禁止碎片化三列。
- 移动端:边到边列表;详情为全高 sheet处置按钮粘底。
## 事件契约
三类协议只影响来源,不改变事件顶层字段:
```text
event.id
event.type
event.category
event.title
subject.type = vehicle
subject.vin
subject.plate
source.protocol = GB32960 | JT808 | YUTONG_MQTT
source.event_id
occurred_at
received_at
automation.id
automation.version
execution.state = pending | processing | recovered | completed | ignored
payload.*
```
事件类型必须由触发语义生成,例如:
- `vehicle.geofence.exited`
- `vehicle.telemetry.soc_low`
- `vehicle.motion.acceleration_high`
- `vehicle.connectivity.offline`
- `vehicle.mileage.daily_completed`
禁止把分类和指标简单拼接成重复或实现细节型名称。
## 状态与交互
- 事件状态:`待处理 / 处理中 / 已恢复 / 已完成 / 已忽略`
- 点击事件行选中并打开详情;键盘 Enter/Space 等价。
- 过滤条件写入 URL切换标签页保留未提交草稿。
- 人工处置采用版本号并发控制,成功后同步刷新列表、汇总、详情和通知。
- 自动化编辑器:`事件 → 条件 → 动作 → 测试并发布`;发布前可运行样例事件测试。
- 通知送达与已读是独立维度;失败记录必须可见失败原因与重试入口。
- 所有异步区域覆盖加载、空、错误、重试与陈旧数据保留状态。
## 响应式与无障碍
- `>= 1180px`:表格 + 常驻 inspector。
- `7681179px`:表格全宽,详情用覆盖式 side sheet。
- `< 768px`:事件行列表 + 全高 detail sheet过滤器为 bottom sheet。
- 焦点环使用 2px 主色外框;状态不只依赖颜色;图标按钮有可读标签。
- 支持键盘、200% 文本缩放、`prefers-reduced-motion`、安全区和长 VIN/中文文本换行。

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Some files were not shown because too many files have changed in this diff Show More