docs: T40 UI 审计报告 + wiki 更新 + Docker 配置

- T40 UI 审计计划和结果文档(docs/qa/)
- wiki 更新:miniprogram 设计系统合规审计记录 + index 关键数字更新
- 审计 V2 完整报告(docs/audits/v2/)
- 讨论记录文档(docs/discussions/)
- 设计规格和实施计划(docs/superpowers/)
- 角色测试计划和结果(docs/qa/role-test-*)
- Docker 生产部署配置
This commit is contained in:
iven
2026-05-13 23:29:42 +08:00
parent 212c08b7ae
commit df1d85bfde
78 changed files with 10345 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
---
title: Web 前端
updated: 2026-04-28
updated: 2026-05-10
status: stable
tags: [frontend, react, antd, vite, spa]
---
@@ -12,7 +12,7 @@ tags: [frontend, react, antd, vite, spa]
## 1. 设计决策
- **组件库优先** — Ant Design 6不自造轮子
- **状态集中** — Zustand 管理全局状态(5 个 store
- **状态集中** — Zustand 管理全局状态(6 个 store
- **API 层分离** — HTTP 调用封装到 `src/api/`(含 health/ 和 ai/ 子目录),组件不直接 fetch
- **代理开发** — Vite 代理 `/api` 到后端 3000 端口
- **HashRouter** — 不需要服务端 fallback 配置,部署更稳健
@@ -132,7 +132,7 @@ React 19.2.4 / Ant Design 6.3.5 / React Router 7.14.0 / Zustand 5.0.12 / Vite 8.
| `/plugins/:pluginId/:entityName` | 插件 CRUD动态生成 |
| `/plugins/:pluginId/tabs|tree|graph|dashboard|kanban/:name` | 插件多视图页面 |
**健康管理路由22 条)**:
**健康管理路由25 条)**:
| 路径 | 页面 |
|------|------|
@@ -158,8 +158,10 @@ React 19.2.4 / Ant Design 6.3.5 / React Router 7.14.0 / Zustand 5.0.12 / Vite 8.
| `/health/ai-analysis` | AI 分析历史 |
| `/health/ai-prompts` | AI Prompt 管理 |
| `/health/ai-usage` | AI 用量统计 |
| `/health/media-library` | 媒体库管理(上传/文件夹/网格浏览) |
| `/health/banners` | 轮播图管理(表格+Drawer 表单+排序) |
### 健康模块共享组件11 个)
### 健康模块共享组件13 个)
| 组件 | 用途 |
|------|------|
@@ -174,6 +176,8 @@ React 19.2.4 / Ant Design 6.3.5 / React Router 7.14.0 / Zustand 5.0.12 / Vite 8.
| `HealthRecordsTab` | 患者详情-健康档案标签页 |
| `FollowUpTab` | 患者详情-随访标签页 |
| `ImagePreview` | 图片预览组件 |
| `MediaPicker` | 媒体库选图组件(复用于轮播图选图、文章封面选图) |
| `resolveMediaUrl()` | 媒体 URL 工具函数(`src/utils/media.ts`):自动处理路径前缀 + JWT token 拼接 |
### 集成契约
@@ -196,7 +200,7 @@ React 19.2.4 / Ant Design 6.3.5 / React Router 7.14.0 / Zustand 5.0.12 / Vite 8.
| `message.ts` | unreadCount, recentMessages, SSE 实时推送连接, 请求去重 |
| `plugin.ts` | plugins 列表, 动态菜单, schema 缓存, 请求去重 |
### 健康模块 API 文件10 个)
### 健康模块 API 文件12 个)
| 文件 | 覆盖端点 |
|------|---------|
@@ -207,6 +211,8 @@ React 19.2.4 / Ant Design 6.3.5 / React Router 7.14.0 / Zustand 5.0.12 / Vite 8.
| `followUp.ts` | 随访任务 + 记录 |
| `consultations.ts` | 咨询会话 + 消息 + 导出 |
| `articles.ts` | 健康文章 |
| `media.ts` | 媒体库 CRUD + 文件夹管理 + 批量操作 |
| `banners.ts` | 轮播图 CRUD + 排序 |
| `points.ts` | 积分系统 |
| `deviceReadings.ts` | 设备数据采集 |
| `alerts.ts` | 健康预警 |
@@ -250,8 +256,9 @@ React 19.2.4 / Ant Design 6.3.5 / React Router 7.14.0 / Zustand 5.0.12 / Vite 8.
### 代理配置
```
http://localhost:5174/api/* → http://localhost:3000/* (API)
ws://localhost:5174/ws/* ws://localhost:3000/* (WebSocket)
http://localhost:5174/api/* → http://localhost:3000/* (API)
http://localhost:5174/uploads/* → http://localhost:3000/* (媒体文件,需 JWT)
ws://localhost:5174/ws/* → ws://localhost:3000/* (WebSocket)
```
## 5. 活跃问题 + 陷阱
@@ -271,6 +278,7 @@ ws://localhost:5174/ws/* → ws://localhost:3000/* (WebSocket)
| 日期 | 变更 |
|------|------|
| 2026-05-10 | **媒体库 + 轮播图管理**:新增 MediaLibrary 页面(上传/文件夹/网格浏览、BannerManage 页面(表格+Drawer+排序、MediaPicker 组件(复用于轮播图和文章封面选图);新增 `resolveMediaUrl()` 工具函数统一处理媒体 URLVite 代理新增 `/uploads`;健康路由 22→25 条,共享组件 11→13 个API 文件 10→12 个 |
| 2026-05-01 | 审计发现更新CRITICAL 权限码拼写错误alert→alerts、前端测试极低、AI SSE 无入口 |
| 2026-04-28 | UI/UX 重构 Phase 5小程序端 8 项优化):首页健康资讯+空状态引导、Hub sparkline bar+打卡合并、日常监测 3 分组折叠+异常高亮、预约时段灰显、咨询消息日期分组+图片预览、医护异常横幅+搜索、趋势图骨架屏 |
| 2026-04-28 | UI/UX 重构 Phase 44 个表单 Modal→DrawerForm患者 4 分组/预约 3 分组+排班校验/随访 2 分组/积分商品 2 分组) |