Commit Graph

368 Commits

Author SHA1 Message Date
iven
11777e3b68 docs(wiki): 多主题系统文档更新 + .gitignore 清理
- frontend.md: 4 套主题视觉人格 + 技术架构 + 温润东方详细 token
- index.md: 症状导航更新
- miniprogram.md: 小程序审计报告
- .gitignore: 排除 .logs/ plans/ playwright-report/ 临时文件
2026-04-28 00:20:20 +08:00
iven
30f2452933 fix(core): 迁移修复 + 配置调整
- auth_state: 新增字段
- config/default.toml: 配置更新
- migration 078/082: 修复 SQL 语法
- state/main: 启动逻辑调整
2026-04-28 00:20:11 +08:00
iven
e56cd73e49 feat(web): 多主题系统 — 4 套主题 + CSS 变量 + Ant Design 动态主题
- CSS 变量层: :root 默认 blue, [data-theme] 覆盖 warm/dark/emerald
- Ant Design: ConfigProvider 按 ThemeName 切换 token + algorithm
- ThemeSwitcher: 下拉面板含 4 主题色块预览 + localStorage 持久化
- useThemeMode: 从 store 读取主题名替代色值比对(修复 33 页面暗色失效)
- index.html: 添加 Noto Serif SC 字体(warm 主题衬线标题)
2026-04-28 00:20:02 +08:00
iven
50eae8b809 feat(miniprogram): 温润东方风全面 UI 重设计
73 文件变更,覆盖全部 40 个页面 SCSS + TabBar 图标 + 组件样式。
统一赤陶主色 #C4623A + 暖米背景 + 衬线标题字体 + 12px 圆角体系。
2026-04-28 00:19:52 +08:00
iven
fbb28e655d fix(miniprogram): submitRecord 补充 task_id 字段 — 后端 CreateFollowUpRecordReq 必填
Some checks failed
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
后端 CreateFollowUpRecordReq 要求 body 中包含 task_id 字段,
小程序端 followup.ts 和 doctor.ts 的 submitRecord/createFollowUpRecord
均未传递 task_id,导致 422 Unprocessable Entity。
2026-04-28 00:16:21 +08:00
iven
83162817ce fix(miniprogram): 修复 API 接口字段对齐 — 33 接口端到端验证
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
P0: submitRecord() 路径修正 POST /follow-up-records → POST /follow-up-tasks/{id}/records
    + 请求体从 {task_id, content:{text}} 改为 {result, patient_condition, executed_date}
P1: ConsultationSession.subject/last_message 改为可选(后端暂不返回)
P1: Appointment.department 改为可选(后端未 JOIN 医生表)
P1: FollowUpRecord 结构对齐后端扁平字段(executed_date/result/medical_advice 等)
P2: Article 增加 status 可选字段
2026-04-27 23:41:50 +08:00
iven
3177a704ff test(web): exprEvaluator + useDebouncedValue 单元测试 — 24 个用例
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
exprEvaluator(19): 等值/不等/AND/OR/NOT/括号/短路运算/
  missing field/type coercion/visibleWhen 便捷函数。
useDebouncedValue(5): 初始值/防抖/快速更新重置/自定义延迟/数值类型。
2026-04-27 23:24:25 +08:00
iven
5aec02e4ad test(health): 7 个模块集成测试 — 49 个用例全通过
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
新增 doctor(7)、diagnosis(7)、consent(6)、medication(8)、
dialysis_prescription(7)、follow_up_template(7)、daily_monitoring(7)
覆盖 CRUD、状态流、列表过滤、软删除、租户隔离、乐观锁。
2026-04-27 23:21:04 +08:00
iven
2d5b6d4c50 test(health): 文章/分类/标签集成测试 — 10 个用例全通过
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
覆盖文章 CRUD、状态流(draft→pending_review→published→draft)、
拒绝与重提交、列表过滤、软删除、租户隔离、分类 CRUD+隔离、
标签 CRUD+文章关联、乐观锁冲突。
2026-04-27 23:04:41 +08:00
iven
f58f1f73c5 test(health): 健康数据集成测试 — 8 个测试覆盖体征CRUD/化验报告CRUD+审阅/租户隔离
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
fix(auth): WechatSessionResp mock 缺少 unionid 字段
2026-04-27 22:27:36 +08:00
iven
7420a66291 test(health): 随访 + 咨询集成测试 — 9 个随访测试 + 8 个咨询测试覆盖 CRUD/状态/批量/消息/租户隔离
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-27 22:18:51 +08:00
iven
c53f5625bc fix(web,miniprogram): 端到端测试修复 + 小程序接口字段对齐
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
## 前端修复
- 修复 9 个 TypeScript 编译错误(未使用变量/undefined 守卫/vitest 类型)
- 重写 E2E auth fixture 使用真实 API 登录替代 mock token
- 更新 E2E 测试选择器适配当前 UI 布局
- Playwright 改为串行执行避免 token 唯一约束冲突
- E2E 测试从 0/10 通过提升到 10/10 通过

## 小程序接口一致性修复(P0-P3)
- P0: consultation.ts type→consultation_type, unread_count→unread_count_patient
- P0: followup.ts task_type→follow_up_type, due_date→planned_date, description→content_template
- P1: appointment.ts calendarView 展平嵌套结构, available_count 计算 max-current
- P1: doctor.ts HealthSummary 适配后台实际返回结构
- P2: doctor.ts PatientStats/ConsultationStats/FollowUpStats 字段名对齐
- P3: article.ts 新增 buildCategoryTree 工具函数
2026-04-27 22:09:21 +08:00
iven
e1d9f97d79 test(health): 扩展预约集成测试 +3 — 状态流转/取消/乐观锁冲突
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-27 22:01:38 +08:00
iven
fdbbc47a60 test(health): 扩展患者集成测试 +3 — 更新乐观锁/PII加密验证/姓名搜索
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-27 21:58:57 +08:00
iven
dc09cc4e2a test(health): 设备读数集成测试 — 8 个测试覆盖批量摄入/设备绑定/聚合/查询/校验/租户隔离
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-27 21:54:50 +08:00
iven
55a7d7a03e test(health): 告警系统集成测试 — 8 个测试覆盖规则 CRUD/引擎评估/状态流转/cooldown/租户隔离
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-27 21:48:12 +08:00
iven
3aaa0a9598 test(health): 透析记录集成测试 — 8 个测试覆盖 CRUD/PII/状态流转/租户隔离/乐观锁/软删除
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
2026-04-27 21:42:24 +08:00
iven
88d01b5d84 test(health): 积分系统集成测试 — 12 个测试覆盖 FIFO/签到/兑换/隔离
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 签到积分首次/连续签到
- 自定义事件积分增加
- FIFO 消费、精确消费、部分消费、余额不足
- 账户自动创建、兑换订单创建
- 交易记录查询、租户隔离
2026-04-27 21:21:04 +08:00
iven
6997bb1d90 test: Phase 0 测试基础设施 — TestApp + MSW + 覆盖率工具 + CI
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- TestApp struct 封装 TestDb + HealthState + tenant_id/operator_id
- TestFixture 工厂方法: create_patient/create_doctor/create_schedule/create_appointment
- 前端 MSW v2 handlers (auth) + server setup + vitest 集成
- vitest coverage v8 配置 + test:coverage script
- GitHub Actions CI: backend (check + test + clippy) + frontend (tsc + test + build)
2026-04-27 21:12:08 +08:00
iven
41af241238 refactor(web): 前端工程化 — 组件拆分 + 名称缓存统一
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- useHealthStore 新增 batchResolvePatientNames/batchResolveDoctorNames
  批量解析方法(去重 → 过滤已缓存 → 5 并发批次加载)
- PointsOrderList 移除局部 nameCache,改用 useHealthStore 全局缓存
- PluginCRUDPage (871L) 拆分为 usePluginData + DetailDrawer +
  ImportModal + PluginCRUDPageInner,原文件改为 re-export
- PluginGraphPage (765L) 拆分为 useGraphData + useGraphCanvas hooks
- StatisticsDashboard (580L) 拆分为 useStatsData + HealthDataCenter
2026-04-27 20:56:27 +08:00
iven
fdceed7284 feat(web): useApiRequest 添加 loading + usePaginatedData 泛型筛选
- useApiRequest 新增 loading 状态,execute 自动管理 loading 生命周期
- usePaginatedData 支持泛型筛选参数 (filters: F),函数重载保持旧签名兼容
- 新增 filters/setFilters 状态,fetchFn 调用时传入当前 filters
- 向后兼容:旧调用点无需修改
2026-04-27 20:26:00 +08:00
iven
22ef5b6d1f feat(core): 审计日志哈希链 — prev_hash + record_hash + 完整性验证
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 迁移 087: audit_logs 表添加 prev_hash/record_hash 列 + 索引
- audit_service::record() 写入时查询前一条 record_hash 作为 prev_hash
- SHA256(id+action+resource_type+resource_id+created_at+prev_hash) 计算 record_hash
- verify_hash_chain() 验证链完整性,返回 (总记录数, 断链数)
2026-04-27 19:38:39 +08:00
iven
633bf8c62d feat(auth): data_scope 行级数据权限 — DataScope 枚举 + 中间件加载
- TenantContext 新增 permission_data_scopes: HashMap<String, DataScope>
- DataScope 枚举: All/SelfOnly/Department/DepartmentTree
- JWT 中间件查询 role_permissions.data_scope 填充到上下文
- rbac::get_data_scope() 供 service 层按权限获取数据范围
- 默认 All,完全向后兼容现有行为
2026-04-27 19:31:19 +08:00
iven
d5c9654370 fix(db): 修复迁移 084/085 SQL 语法 + RLS 动态表名查询
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 084/085: PostgreSQL DELETE 不支持 LIMIT,改用 ctid IN (SELECT ... LIMIT)
- 086: RLS 迁移改为动态查询 information_schema 获取含 tenant_id 的表,
  避免硬编码表名不一致问题
- 全量测试 490 个通过(含 27 个集成测试 + RLS 验证)
2026-04-27 18:52:03 +08:00
iven
bcaeb0beef feat(server): tenant RLS 中间件 — SET app.current_tenant_id
- 新增 tenant_rls_middleware:JWT 解析后 SET 租户 ID,请求结束 RESET
- 挂载到 protected router 的 JWT 层之后
- SET 失败仅 warn 不阻断(RLS 是安全网,主隔离在应用层)
- RESET 防止连接池复用时租户上下文泄漏
2026-04-27 18:41:28 +08:00
iven
b7b9f50d00 feat(db): RLS 策略迁移 — 80 张 tenant_id 表启用行级安全
- 所有含 tenant_id 的表(基础 34 + 健康 28 + 其他 18)启用 RLS
- 策略:未设置 app.current_tenant_id 时允许全部,设置后按 tenant_id 过滤
- down 方法完整回退(DROP POLICY + DISABLE ROW LEVEL SECURITY)
2026-04-27 18:40:07 +08:00
iven
3197dde33c feat(core): 事件归档 + 消费者幂等性 — 迁移 084/085 + 清理任务
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 迁移 084: domain_events_archive 归档表 + cleanup_old_published_events()
- 迁移 085: processed_events 去重表 + cleanup_old_processed_events()
- erp-core: is_event_processed() / mark_event_processed() 幂等性辅助
- erp-server: tasks::start_event_cleanup() 每 24h 归档 >90 天事件
2026-04-27 18:12:43 +08:00
iven
97bb592688 feat(core): build_event_payload 统一信封 — 28 处事件发布全部迁移
- erp-core 添加 build_event_payload(),自动注入 schema_version + occurred_at
- erp-health 12 个 service(25 处)、erp-auth(1 处)、erp-workflow(2 处)
  全部迁移到统一信封格式
2026-04-27 18:01:05 +08:00
iven
d31d7beb1f feat(server): outbox relay 改为 LISTEN/NOTIFY + 30s 兜底轮询
- EventBus::publish() 持久化后执行 NOTIFY outbox_channel
- outbox relay 使用 sqlx::PgListener 监听 + tokio::select! 竞争
- 30s 兜底轮询防止 NOTIFY 丢失,断线自动重连
- 轮询间隔从 5s 提升到 30s,事件延迟降至 <100ms
2026-04-27 17:50:38 +08:00
iven
8d55d98f4f feat(health): daily_monitoring.created 事件发布
日常监测记录创建后发布 domain event,payload 包含 record_id、
patient_id、record_date 及关键体征数据。
2026-04-27 17:42:12 +08:00
iven
13b23e90f4 feat(health): 消息推送集成 — 定时任务启动 + 预约提醒事件
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- erp-server: 启动逾期随访检查(6h)、积分过期(24h)、预约提醒(1h) 定时任务
- appointment_service: 新增 send_reminders 扫描明日确认预约发送事件
- erp-message: 订阅 appointment.reminder 事件,向患者发送提醒消息
2026-04-27 14:51:40 +08:00
iven
dc5879228e feat(health): 随访模板系统 — follow_up_template + template_field 全栈
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
新增随访模板和模板字段两张表及完整 CRUD:
- 迁移 083: follow_up_template + follow_up_template_field
- Entity: 模板(名称/类型/适用范围/状态) + 字段(标签/键名/类型/选项/校验)
- DTO: 创建时内嵌字段列表、更新支持全量替换字段
- Service: 随访类型+字段类型校验、级联软删除
- Handler: 5 端点 + RBAC 权限
- 路由: /api/v1/health/follow-up-templates
2026-04-27 14:40:28 +08:00
iven
ca96310a84 feat(health): 透析方案管理 CRUD — dialysis_prescription 全栈
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
新增透析方案实体和完整 CRUD:
- Entity: 20 字段含抗凝/血管通路/透析参数
- DTO: f64 类型适配 utoipa ToSchema
- Service: 抗凝类型 + 血管通路类型校验
- Handler: 5 端点 + RBAC 权限控制
- 路由: /api/v1/health/dialysis-prescriptions
2026-04-27 14:26:41 +08:00
iven
19cb2bf8bf feat(health): 批量随访操作 — batch_create/assign/complete 三个端点
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
POST /health/follow-up-tasks/batch-create — 多患者同配置批量创建
POST /health/follow-up-tasks/batch-assign — 批量分配负责人
POST /health/follow-up-tasks/batch-complete — 批量标记完成

含参数校验(上限 100)、部分失败报告、事件发布、审计日志。
2026-04-27 14:01:58 +08:00
iven
a36720cbbc feat(health): 补全事件发布 — consent/points/article 6 个领域事件
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- consent.granted/revoked: 知情同意授权/撤销
- points.earned/exchanged: 积分获得/兑换
- article.published/rejected: 文章审核发布/拒绝

所有事件通过 EventBus 发布,支持跨模块订阅和审计追溯。
2026-04-27 13:33:11 +08:00
iven
a5646ddbb3 perf(health): 随访列表内联负责人名称 — 消除 N+1 查询
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
follow_up list_tasks 批量查询 users 表获取 assigned_to_name,
前端移除 doctorLabels 逐条请求缓存,直接使用后端内联字段。
2026-04-27 13:22:46 +08:00
iven
2519ad8fee feat(auth): 微信 session_key 迁移到 Redis — 内存降级兜底
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
session_key 从全局 HashMap 迁移到 Redis(SET key EX 300 / GETDEL),
Redis 不可用时自动降级到内存缓存,提升多实例部署安全性。
2026-04-27 13:05:25 +08:00
iven
a4daa8f49c feat(server): 健康检查增强 — 新增 /health/ready 就绪检查
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 保留 /health 轻量存活检查
- 新增 /health/ready 含 DB ping + Redis ping 并行检测
- 返回 status(ok/degraded/unavailable) + 各组件延迟和错误信息
2026-04-27 12:54:16 +08:00
iven
a2c1b5ece8 feat(db): 注册透析处方迁移 + AI Prompt 种子数据(4 个默认模板)
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 注册遗漏的 m20260427_000081_create_dialysis_prescription 迁移
- 新增 000082 种子迁移:插入 4 个 AI Prompt 模板
  (化验单解读/趋势分析/体检方案/报告摘要)
2026-04-27 12:50:16 +08:00
iven
a1bc62cd5e fix(plugin): WASM 集成测试自动构建 Component — OnceLock 线程安全
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
测试无法找到 .component.wasm 文件导致 6 个测试全部失败。
改进 wasm_path() 使用 OnceLock 保证只转换一次,
自动从编译产物通过 wasm-tools component new 生成。
2026-04-27 12:34:52 +08:00
iven
7c0f0ce906 docs(miniprogram): 新增 MCP 联调章节 — 操作指南 + 已知限制 + 故障排查
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- wiki/miniprogram.md §6: 完整 MCP 联调文档
  - 前置条件与建立连接
  - 16 个 MCP 工具使用说明
  - 绕过微信登录的 storage 注入流程
  - TabBar 页面列表与导航注意事项
  - 已知限制:screenshot 超时、navigateTo 超时、auth 重定向
  - e2e 验证脚本说明
- wiki/index.md: 新增 3 条 MCP 相关症状导航
2026-04-27 12:13:52 +08:00
iven
bab0d6619b feat(health): 用药记录实体 — CRUD 全栈
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 迁移 080: medication_record 表(18 字段 + 频率/给药途径校验)
- Entity/DTO/Service/Handler 全链路
- 端点: GET/POST/PUT/DELETE /health/medications + /health/patients/{id}/medications
- 软删除 + 乐观锁 + 审计日志
2026-04-27 11:45:49 +08:00
iven
67f2d07809 feat(health): 体征增加体温/SpO2/血糖类型字段
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- 迁移 079: vital_signs 表新增 body_temperature/spo2/blood_sugar_type 列
- Entity/DTO/Service 全链路支持新字段
- blood_sugar_type: fasting/postprandial/random/ogtt
- daily_monitoring 兼容层补全新字段为 None
2026-04-27 11:31:40 +08:00
iven
7e66561a5f fix(health): 统一随访类型为 5 种 — phone/outpatient/home_visit/online/wechat
- validation.rs: face_to_face 替换为 outpatient,新增 home_visit/wechat
- FollowUpTaskList.tsx: 新增 online 选项,与后端对齐
- 迁移 078: follow_up_task + follow_up_record face_to_face → outpatient
2026-04-27 11:20:57 +08:00
iven
6a7d83ec4d refactor(health): 集中管理事件类型常量 + 积分过期发布事件
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- event.rs 新增 20 个事件类型常量(PATIENT_CREATED 等)
- 10 个 service 文件引用常量替代硬编码字符串
- expire_points 增加 EventBus 参数,处理完成后发布 points.expired 事件
- start_points_expiration_checker 传入 EventBus
2026-04-27 11:11:33 +08:00
iven
47df2e2aa6 perf(web): manualChunks 拆分 heavy deps + lazy ProcessDesigner/ProcessViewer
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
- vite.config.ts 添加 vendor-charts/plots/graphs, vendor-flow, vendor-editor 独立 chunk
- vendor-antd 从 3000kB 降至 1532kB,charts 独立 1459kB
- ProcessDesigner/ProcessViewer 改为 React.lazy 按需加载
- 移除 PluginGraphPage 遗留的 animFrameRef 未使用变量
2026-04-27 10:11:12 +08:00
iven
af44476c0f perf(web): PluginGraphPage 替换持续 rAF 循环为按需重绘
移除持续 requestAnimationFrame 循环,改为数据变更 useEffect 触发
单次重绘 + ResizeObserver 监听容器变化,静态页面 CPU 占用大幅降低。
2026-04-27 09:58:51 +08:00
iven
1c7184b6bc perf(web): PluginCRUDPage columns 包裹 useMemo 避免重渲染
columns 依赖 fields/resolvedLabels/labelMeta,搜索输入时不再重建列定义。
2026-04-27 09:57:41 +08:00
iven
0929825ae7 perf(health): alert_engine 批量预加载 + 内存匹配替代逐规则DB查询
批量查询 cooldown 期间所有 alerts 和最近 hourly 记录,
在内存中完成 cooldown 检查和规则匹配。
N规则评估从 2N+ 次查询降为 2 次批量查询。
2026-04-27 09:55:39 +08:00
iven
0a387c189a perf(health): get_health_summary 4次串行查询改为 tokio::join! 并行
总延迟从 sum(4次查询) 降为 max(4次查询),预估延迟降低约75%。
2026-04-27 09:52:31 +08:00