iven
92c1c3c17d
feat(web): AI 分析详情增加建议面板 — 风险等级+建议列表+审批操作
...
- 新增 suggestions API 层(list/approve/getComparison)
- 展开分析详情时自动加载关联的 AI 建议列表
- 风险等级彩色标签(低/中/高)
- 建议类型、原因、执行状态展示
- 待审批建议支持批准/拒绝操作
2026-05-01 09:17:18 +08:00
iven
931edc3025
fix(security): 补全 XSS sanitize + 修复 sender_id 身份伪造
...
安全审计修复:
- 补全 6 个 DTO 的 sanitize 方法(diagnosis/consent/alert/medication_record/medication_reminder/follow_up_template)
- 4 个 handler 添加 .sanitize() 调用(diagnosis/consent/alert_rule/medication_record)
- 修复咨询消息 sender_id/sender_role 从客户端提交改为服务端从 JWT 提取
- 修复小程序 AI 报告 markdownToHtml XSS(添加 sanitizeHtml 过滤)
2026-04-30 10:21:52 +08:00
iven
d2dfac82e3
refactor(web): 移除 4 个未使用的 API 函数 — exportSessions/generateTrend/assignDoctor/removeDoctor
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-30 08:34:35 +08:00
iven
26a9781d4f
feat(health): 药物提醒后端 API + 后台任务统一 + dead code 清理
...
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
P1-3: medication_reminder 全栈实现
- migration 000096: 创建 medication_reminder 表(含患者关联/提醒时间/频率)
- entity + dto + service + handler: 完整 CRUD(乐观锁/软删除/审计日志)
- 路由注册: GET /patients/{id}/medication-reminders, POST/PUT/DELETE
- HealthError 新增 MedicationReminderNotFound
P2-4: 后台任务启动统一
- appointment_reminder 迁移到 HealthModule::on_startup()(启动时立即执行 + 周期循环)
- 删除 main.rs 中重复的 overdue_checker/points_expiration/appointment_reminder 调用
- 所有 Health 后台任务现由模块 on_startup 统一管理
P2-5: Web dead code 清理
- 删除 healthData.ts 中 getMiniTrend/getMiniToday(小程序专用端点,Web 无调用)
- 删除 patients.ts 中 getHealthSummary(标记 TODO 未使用)
2026-04-30 07:18:22 +08:00
iven
facc8b0d24
refactor(dialysis+health): 透析统计从 erp-health 迁移到 erp-dialysis,消除跨 crate 残留
...
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-dialysis: 新建 dialysis_stats_dto/handler/service,注册 /health/admin/statistics/dialysis 路由
- erp-health: 删除 get_dialysis_statistics 及 helper、DialysisStatisticsResp、
DialysisRecordNotFound/DialysisPrescriptionNotFound、validate_dialysis_status* 及 9 个测试、
DoctorDashboard.pending_dialysis_review、module 路由
- Web: HealthDataStats 移除 dialysis 字段,新增 getDialysisStats() 独立 API,
useStatsData 并行 fetch,HealthDataCenter 接受独立 dialysisData prop
- 小程序: DoctorDashboard 移除 pending_dialysis_review,医护工作台移除"待审透析"卡片
2026-04-29 07:56:21 +08:00
iven
cac61637ce
feat(health): Web 管理端设备数据集成补全 — Phase 2
...
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
- 新增告警三页面(仪表盘/列表/规则)+ 设备管理菜单种子数据
- 新增设备管理后端 API(GET /devices + DELETE /devices/{id})
- 新增设备数据查看组件 DeviceReadingsTab(原始数据 + 小时聚合)
- 新增设备管理页面 DeviceManage(列表/筛选/解绑)
- 患者详情页新增设备数据 Tab
2026-04-29 06:28:30 +08:00
iven
27c32e5561
feat(web): 实时告警仪表盘页面 + SSE Hook + 告警详情面板
...
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
- 新增 AlertDashboard 页面:实时告警列表 + 统计摘要 + 详情面板
- 新增 useAlertSSE Hook:封装 SSE 连接、自动重连、事件分发
- 新增 AlertDetailPanel 组件:告警详情展示 + 确认/忽略/恢复操作
- alertApi.list 添加 doctor_id 参数支持
- 注册 /health/alert-dashboard 路由 + 面包屑映射
2026-04-28 19:59:51 +08:00
iven
e5546efa41
refactor(web): alerts + deviceReadings API 迁移为对象风格导出
...
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
- alerts.ts: listAlerts → alertApi.list, acknowledgeAlert → alertApi.acknowledge 等
- deviceReadings.ts: batchCreateReadings → deviceReadingApi.batchCreate 等
- AlertList/AlertRuleList 引用处同步更新
- 其余 19 个函数式 API 文件记为待迁移(旧文件不强制迁移)
2026-04-28 19:47:48 +08:00
iven
2f42ebff1d
feat: 仪表盘角色自适应重构 — 4角色视图 + 后端个人工作量API
...
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
后端:
- 新增 GET /health/admin/statistics/personal-stats 接口
- PersonalStatsResp: 13个个人维度统计字段
- 按医生/护士/管理员/运营角色聚合工作量数据
前端:
- useDashboardRole hook: 按优先级 doctor>nurse>admin>operator 匹配角色
- DoctorDashboard: 今日工作台(日程/审核/消息/统计卡)
- NurseDashboard: 随访监控台(异常提醒/队列/上报率)
- AdminDashboard: 管理中心(5KPI + 健康数据Tab)
- OperatorDashboard: 运营中心(积分/文章/活动)
- StatisticsDashboard.tsx 重写为角色路由组件
- 删除旧区块:快捷入口/积分排行Top10/最近活动
2026-04-28 07:54:08 +08:00
iven
a5646ddbb3
perf(health): 随访列表内联负责人名称 — 消除 N+1 查询
...
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
f934ca0eaf
perf(web): ConsultationList/FollowUpTaskList 移除 N+1 nameCache
...
后端已内联 patient_name/doctor_name,前端移除逐条查询。
Session/FollowUpTask 接口添加 name 可选字段。
FollowUpTaskList 保留 assignee 的 getUser 查询(users 表未内联)。
2026-04-27 09:47:37 +08:00
iven
5f83080ab8
feat(web): 告警管理前端页面 + 路由注册 + bugfix
...
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
新增:
- AlertList 告警列表页: 状态筛选/确认/忽略操作
- AlertRuleList 告警规则页: 创建/编辑/启停管理
- alerts + deviceReadings 前端 API 层
- App.tsx 路由注册 + MainLayout 标题 fallback
- wiki/frontend.md 更新页面清单
修复:
- ArticleEditor: 修复 unused variable 构建错误
- FollowUpTaskList: 修复 filter(Boolean) 类型窄化问题
2026-04-27 07:38:47 +08:00
iven
ac919731a9
fix: QA 全量测试发现 5 个 bug 修复
...
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] 登录失败无反馈: client.ts 响应拦截器跳过 /auth/login 的 401 处理,让错误传播到 Login 组件
- [P0] 统计仪表盘 400: 前端用独立 try/catch 替代 Promise.all 提高容错性;后端 stats_service 白名单补充 ultrafiltration_volume/dialysis_duration
- [P1] 随访负责人显示 UUID: 批量解析 assigned_to 用户名
- [P2] 消息中心时间未格式化: 添加 formatDateTime 函数
- [P2] 首页显示 login_failed: 过滤审计日志中的 login_failed 动作
2026-04-26 23:48:22 +08:00
iven
787e64d9a9
fix: 前端深度审计全量修复 — 安全/功能/代码质量
...
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
严重 BUG 修复:
- 修复 Token 过期后 hash 重定向导致无法跳转登录页
- 修复文章编辑器新建后提交审核使用错误 ID
安全加固:
- HTML 清理函数替换为 ammonia 专业库(替代自定义解析器)
- 文件上传添加 magic bytes 校验(防 Content-Type 伪造)
- 登录添加账户级失败锁定(5次失败→15分钟锁定)
- 审计日志 9 个关键更新操作补充变更前后值(with_changes)
功能缺陷修复:
- 登录/登出时清理 API 缓存(防多账户数据污染)
- 文章编辑器上传改用统一 HTTP 客户端(自动 token 刷新)
- 添加全局 HTTP 错误处理和后端错误消息展示
- PrivateRoute 增加路由级权限检查(系统管理页面)
- 健康数据三个 Tab 添加编辑/删除功能
- 预约创建增加排班可用性校验提示
- 医生详情 API 返回解密后的原始执照号
代码清理:
- 删除未使用的 auth.ts refresh() 函数
- 删除重复的 AuthGuard.tsx 组件
- 删除未使用的 getHealthSummary API
2026-04-26 21:47:26 +08:00
iven
8a253a4910
fix: 低优先级收尾 — 图片上传/语言编辑/插件恢复/URL 编码
...
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
- P3-2: ArticleEditor 图片上传接入 /upload 端点 + 封面图上传按钮
- P4-3: recover_plugins 添加 tenant 日志 + 同 ID 去重保护
- P4-4: LanguageManager 编辑弹窗改为真实表单 (name 字段) + 后端 name 持久化
- P4-6: Settings API getSetting/updateSetting 添加 encodeURIComponent
2026-04-26 19:52:42 +08:00
iven
83fe89cbcd
fix: 全系统审计问题修复 — 安全/数据完整性/功能缺陷/UX (Phase 1-5)
...
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
Phase 1 安全热修复:
- P0-1: /uploads 文件服务添加 JWT 认证中间件(支持 header + query param)
- P0-2: analytics/batch 路由从 public 移到 protected_routes
- P0-3: plugin engine SQL 注入修复(format! → 参数化查询)
- P0-new: stats_service compute_avg_field 字段白名单 + FLOAT8 类型转换
Phase 2 数据完整性:
- P0-4: 组织删除级联检查(添加部门存在性校验)
- P0-5: 部门删除级联检查(添加岗位 + 用户存在性校验)
- P0-8: workflow on_tenant_deleted 实现 5 实体批量删除
- P0-7: 并行网关 race condition 修复(consumed → completed 原子转换)
Phase 3 P1 后端 Bug:
- P1-12: plugin host 表名消毒(使用 sanitize_identifier)
- P1-10: workflow deprecated 状态转换(published → deprecated)
- P1-11: workflow 更新验证条件(nodes/edges 任一变化即验证)
- P0-9: 小程序 .gitignore 添加 .env/.env.*/日志
- P1-19: 小程序加密密钥替换为 64 字符强密钥
Phase 4 消息模块:
- P1-5: 通知偏好 GET 路由 + handler
- P1-4: 消息模板 update/delete CRUD + version
- P2-8: mark_all_read SQL 添加 version + 1
- P2-7: markAsRead 改为乐观更新 + 失败回滚
Phase 5 前端修复:
- P2-9: 通知面板点击导航到 /messages
- P2-1: 随访任务患者名批量 ID 解析(替代 UUID 显示)
- P2-5: AppointmentList 分离 patient_id/doctor_id 分别调用 API
- P2-17: PluginMarket installed 字段修正(name → id)
- P3-3: 路由标题 fallback 改为模式匹配(支持 :id 动态路径)
- P2-15: workflow updateDefinition 添加 version 字段
- P3-9: Kanban 版本使用记录实际 version
- P2-21: secure-storage 生产环境无密钥时阻止存储
- P3-11: destroyOnHidden → destroyOnClose
- P3-13: PendingTasks 深色模式 Tag 颜色适配
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-04-26 19:16:23 +08:00
iven
5bb6105127
feat: 咨询消息轮询优化 — Web 自动刷新 + 患者端聊天详情页
...
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
Web 端:
- ConsultationDetail 添加 10s 自动轮询新消息(after_id 增量拉取)
- consultations API 补充 after_id 参数
小程序患者端:
- 新增 consultation service 消息 API(listMessages/sendMessage/markSessionRead)
- 新增聊天详情页(8s 轮询 + 发送消息 + 自动标记已读)
- 咨询列表页点击跳转详情页(替换"即将上线"占位)
2026-04-26 14:40:46 +08:00
iven
c9bf5f6139
feat(health): 健康数据统计 — 透析/化验/预约/体征上报率
...
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
- 新增 6 个统计端点: dialysis, lab-reports, appointments,
vital-signs-report-rate, health-data(综合)
- 透析统计: 类型分布/并发症率/平均超滤/平均时长
- 化验统计: 类型分布/异常项计数/审核状态
- 预约统计: 状态/类型分布/取消率
- 体征上报率: 月度上报率 + 近 7 天趋势
- Web 统计面板增加健康数据中心区块
2026-04-26 14:19:38 +08:00
iven
55ec57b2c0
feat(health): 积分规则/商品 update/delete + 标签更新端点
...
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
- 积分规则: 添加 update/delete service + handler + 路由
- 兑换商品: 添加 update/delete service + handler + 路由
- 文章标签: 添加 update service + handler + 路由
- Web 管理端: 规则/商品列表页支持编辑/删除/启用切换
- Web 管理端: 标签管理页支持编辑、删除传 version
2026-04-26 14:07:21 +08:00
iven
17b423b9b8
feat(health): 内容管理模块 — 审核/分类/标签/富文本编辑器
...
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
后端:
- 文章审核状态机:draft → pending_review → published(含 reject/unpublish)
- 文章分类 CRUD(article_category entity + service + handler)
- 文章标签 CRUD(article_tag + article_article_tag 关联)
- 文章修订版快照(article_revision)
- 阅读计数、排序、slug、审核备注
- 新增 health.articles.review 权限
前端:
- ArticleManageList:状态标签页 + 分类筛选 + 关键字搜索 + 审核操作
- ArticleEditor:Wangeditor 富文本编辑器 + 元数据侧栏
- ArticleCategoryManage:分类 CRUD + 父子层级
- ArticleTagManage:标签 CRUD
修复:
- diagnosis_service/health_data_service/dialysis_service: 补充 key_version 字段
- ArticleCategoryManage: 补充 Select 组件导入
2026-04-26 12:51:30 +08:00
iven
e3177f262c
feat(config): 菜单动态化改造 — 侧边栏从后端 API 加载
...
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
- 新增 seed 迁移插入完整菜单树(4 directory + 23 menu = 27 条)
- 新增 GET /api/v1/menus/user 端点(仅需登录,无需 menu.list 权限)
- MainLayout 从 API 动态获取菜单树替换硬编码数组
- 扩展图标映射表覆盖 22 个 Ant Design 图标
- Header 标题从动态菜单数据查找,保留 fallback
2026-04-26 01:55:01 +08:00
iven
2539e5fc44
fix(web): 系统设置 CRUD 修复 — version 乐观锁 + 语言字段映射 + JSON 显示
...
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
- API 层所有 Info/Request 接口添加 version 字段,update 函数传递 version
- delete 函数改为 client.delete(url, { data: { version } }) 发送 JSON body
- LanguageInfo.enabled → is_active,匹配后端 LanguageResp 字段名
- LanguageManager 编辑弹窗简化为只读详情(后端仅支持 is_active 切换)
- SystemSettings 设置值显示改用 JSON.stringify 而非 String()
- SystemSettings updateSetting 发送解析后的 JSON 对象而非字符串
2026-04-26 01:28:13 +08:00
iven
b4735213c5
feat(health): Phase 1 业务改进 — 诊断编码/统计API/体征表合并/积分修复
...
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
1.1 Dashboard 统计: 新增 3 个统计端点 (patient/consultation/follow-up)
1.2 事件发布: follow_up.overdue + health_data.critical_alert 事件
1.3 体征表合并: vital_signs 添加 source 列, daily_monitoring 委托写入
1.4 实时预警: 创建体征时检测血压/心率/血糖异常并发布事件
1.5 诊断编码: 新建 diagnosis entity/service/handler + ICD-10 支持
1.6 积分过期: expire_points 定时任务 + 修复 r#type 列名问题
修复: points_transaction.r#type → transaction_type 列重命名
修复: consultation_message.sender_type → sender_role SQL 列名
前端: 3 个统计 API 从伪实现改为真实调用
2026-04-26 00:54:56 +08:00
iven
5621dbe273
feat(web): AI 管理端 3 页面 — Prompt/分析历史/用量统计
...
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
- API 封装: prompts.ts / analysis.ts / usage.ts
- AiPromptList: CRUD + 激活/回滚 + AuthButton 权限
- AiAnalysisList: 历史列表 + 行展开查看结果
- AiUsageDashboard: 总次数/类型分布统计卡片
- 菜单注册 + 路由配置 (MainLayout + App.tsx)
2026-04-25 23:44:15 +08:00
iven
d2baacae7e
feat(health): Phase 4 跨模块集成与架构优化 — 通知/标签/待办/数据录入
...
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-message: 添加 appointment.created/confirmed/cancelled 事件监听,自动发送站内通知
- erp-health: 新增 GET /health/patient-tags 标签列表端点 + list_tags service
- wechat-templates: 添加 isTemplateConfigured 运行时校验
前端:
- 新增 Zustand useHealthStore 共享患者/医生名称缓存
- PatientTagManage: UUID 输入替换为 Checkbox 标签选择器
- VitalSignsTab: 添加体征数据录入 Modal (血压/心率/体重/血糖)
- LabReportsTab: 添加化验报告创建 Modal
- HealthRecordsTab: 添加健康记录创建 Modal
- patients API: 添加 TagItem 类型 + listTags 方法
小程序:
- 首页待办事项接入预约和随访 API,替换硬编码 EmptyState
2026-04-25 20:10:50 +08:00
iven
5b520a168c
fix(web): Phase 3 前端 UX/i18n 修复 — 名称解析/确认对话框/日历切换/删除替换
...
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
- ConsultationList: 批量解析患者/医生名称替代截断 UUID
- PointsOrderList: 使用 product_name + 批量解析患者/核销人名称
- AppointmentList: 破坏性状态变更添加 Modal.confirm + 取消原因收集
- CalendarView: 添加 onPanelChange 回调支持月份切换
- DoctorSchedule: 日历视图切换月份自动刷新数据
- PointsRuleList: 移除无效删除按钮,Switch 添加启用/停用文字
- PointsProductList: 删除按钮替换为上架/下架 Switch
- PatientSelect: 性别显示中文化 (male→男, female→女)
- VitalSignsChart: API 失败时显示 Alert 错误提示
- PointsOrder 类型: 添加 product_name 字段
2026-04-25 19:49:25 +08:00
iven
280f65658a
feat: 积分商城子页面 + 日常监测 + 统计报表 (Chunk 6)
...
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
小程序 — 积分商城 (3 新页面):
- mall/exchange: 兑换确认 (余额校验/QR码生成)
- mall/orders: 我的订单 (状态筛选/分页/QR展示)
- mall/detail: 积分明细 (余额卡片/收入支出筛选/流水列表)
小程序 — 上报 Tab 改造:
- health/daily-monitoring: 日常监测表单 (血压/体重/血糖/出入量)
- health/index: 增加快捷操作/打卡状态/近期监测卡片
- consultation: 替换占位为咨询列表 (会话/状态/未读)
- profile: 新增积分余额/打卡天数/我的订单/积分明细入口
小程序 — 新增服务:
- services/consultation.ts: 咨询会话 API
- services/points.ts: 扩展兑换/订单/流水 API
- services/health.ts: 扩展日常监测 API
PC 管理端:
- StatisticsDashboard: 统计报表仪表盘 (患者/咨询/随访/积分卡片 + Top10排行 + 快速链接)
- 侧边栏新增统计报表入口 (健康模块首页)
2026-04-25 19:17:11 +08:00
iven
7b18a7398d
feat(health): 线下活动管理端 CRUD + 积分统计 API + 前端页面 (Chunk 4)
...
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
后端:
- 线下活动管理: create/update/delete/list/checkin 5 个管理端接口
- 活动签到自动发放积分 (事务内原子操作)
- 积分统计 API: 总发放/总消耗/总过期/活跃账户/Top10排行
前端:
- OfflineEventList: 活动管理页面 (创建/编辑/删除/状态筛选)
- points.ts 扩展: 线下活动 + 统计 API 方法
- 侧边栏新增线下活动入口
2026-04-25 17:34:54 +08:00
iven
eb937d3d02
feat(health): 日常监测后端 + 积分商城 PC 管理页面 (Chunk 3 V2 迭代)
...
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
后端 - 日常监测:
- 新增 daily_monitoring 表 (血压/体重/血糖/出入量/备注)
- Entity/DTO/Service/Handler 完整 CRUD
- 唯一约束 (patient_id, record_date) 防重复上报
前端 - 积分商城管理 (3 页面):
- PointsRuleList: 积分规则增删改 + 启用禁用
- PointsProductList: 商品管理 + 库存 + 类型筛选
- PointsOrderList: 订单列表 + 扫码核销
- API 模块 points.ts 对接 6 个管理端接口
- 侧边栏新增积分规则/商品管理/订单管理入口
2026-04-25 17:24:32 +08:00
iven
0bf1822fa9
fix: QA 第二轮修复 — PatientDetail 重构/测试覆盖/id_number 列宽/小程序 URL 规范化
...
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
- refactor(web): PatientDetail.tsx 拆分为 4 个子组件(737→334行)
- refactor(web): 提取 usePaginatedData hook 消除重复分页状态
- feat(db): patient.id_number varchar(20)→varchar(255) 容纳加密值
- test(health): 添加预约模块集成测试(创建/列表/租户隔离)
- test(plugin): 添加 6 个 SQL 注入 sanitize 测试
- fix(miniprogram): 7 个 service 文件 URL 构建规范化(params 对象)
- fix(miniprogram): 跨平台字段名对齐(birth_date/start_time/end_time)
2026-04-25 10:22:44 +08:00
iven
945ccd64ba
fix: 全面 QA 审计修复 — 安全加固/代码质量/跨平台一致性/测试覆盖
...
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
Phase 0 安全热修复 (CRITICAL):
- 外部化微信 appid/secret 到 ERP__WECHAT__APPID/SECRET 环境变量
- 正确连接 HealthCrypto 到 ERP__HEALTH__AES_KEY/HMAC_KEY 环境变量
- 外部化小程序加密密钥到 TARO_APP_ENCRYPTION_KEY 环境变量
- 移除小程序 auth store 中的敏感信息 console.log
Phase 1 安全加固:
- 微信自动注册 display_name 添加 sanitize 防止 XSS
- 测试数据库凭据改为从 TEST_DB_URL 环境变量读取
Phase 2 代码质量:
- 提取 useThemeMode hook 消除 22 处重复暗色模式检测
- 提取共享健康常量到 constants/health.ts
- 拆分 patient_service.rs 脱敏函数到 masking.rs
- 移除未使用的 i18next/react-i18next 依赖
- 移除未使用的 api/errors.ts 和 erp-auth/anyhow 依赖
Phase 3 测试覆盖:
- 新增 5 个患者模块集成测试 (CRUD/租户隔离/验证/软删除)
Phase 4 跨平台一致性:
- 统一小程序 Patient.birthday → birth_date 匹配后端
- 统一小程序 Appointment.time_slot → start_time/end_time 匹配后端
Phase 5 架构:
- 微信登录添加多租户 TODO 注释
- 更新 wiki/infrastructure.md 环境变量文档
2026-04-25 10:00:49 +08:00
iven
07f4ba41ba
fix(health): 穷尽审计修复 — 权限同步/编译错误/前端bug/审计日志
...
CI / frontend-build (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / security-audit (push) Has been cancelled
审计发现并修复的问题:
HIGH:
- H1: ConsultationDetail 使用 getSession(id) 替代错误的列表搜索
- H2: SessionResp 添加 version/updated_at 字段
- H3: 移除 FollowUpRecordList 调用不存在的导出端点
- H4: 新增 articles.ts 前端 API 模块
MEDIUM:
- M1: article delete 添加乐观锁 (expected_version)
- M2: 取消预约排班释放传播错误 (log::warn -> ?)
- M3: FollowUpTaskList 日期格式 Dayjs -> string
- M4: 补充 15 个缺失审计日志
LOW:
- L1: 替换 follow_up_service 中的 .unwrap()
- L2: PatientListItem 添加 version 字段
CRITICAL (新发现):
- 权限未同步: 健康模块 14 个权限从未写入数据库,添加启动时自动同步
- migration 表名错误: patients -> patient
- 编译错误: health_trend entity 未导入, ToPrimitive trait 未导入
- HealthError 缺少 From<AppError> 实现
2026-04-25 08:58:58 +08:00
iven
0c21f13e72
feat(web): 健康管理模块 10 页面完整实现
...
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
Task 12 - 患者管理:
- PatientList: 搜索+状态筛选+CRUD+行点击跳转详情
- PatientTagManage: 患者标签管理+批量打标
- PatientDetail: 3Tab详情页(基本信息/健康数据/随访记录)+编辑
Task 13 - 医护预约:
- DoctorList: 科室筛选+CRUD+在线状态Badge
- AppointmentList: 状态筛选+日期筛选+创建预约+状态流转
- DoctorSchedule: 医生选择+列表/日历视图+排班CRUD
Task 14 - 随访咨询:
- FollowUpTaskList: 任务CRUD+填写记录+分配医护
- FollowUpRecordList: 只读台账+日期范围筛选+导出
- ConsultationList: 会话列表+创建+关闭+行点击跳转
- ConsultationDetail: 聊天界面+消息分页+发送+图片预览
修正: consultations.ts Session类型补充 updated_at/version
2026-04-25 00:57:48 +08:00
iven
778ae79d84
feat(web): 健康模块 API 服务层 6 文件 47 端点
...
- patients.ts: 患者CRUD/标签/家庭/医护关联 14端点
- healthData.ts: 体征/化验/健康档案CRUD + 趋势 18端点
- appointments.ts: 预约CRUD + 排班管理 + 日历 8端点
- followUp.ts: 随访任务/记录CRUD 7端点
- consultations.ts: 咨询会话/消息CRUD + 导出 6端点
- doctors.ts: 医护CRUD 5端点
2026-04-25 00:37:59 +08:00
iven
40b37cc776
feat(plugin,freelance,itops,web): P5-P6 dashboard widgets 平台扩展 + 仪表盘声明
...
P5 平台扩展:
- manifest.rs: Dashboard 变体新增 widgets 字段
- manifest.rs: 定义 PluginWidget/StatCard/ActionQuery 类型
- 前端: 扩展 DashboardWidget 类型支持 stat_cards/action_list/funnel/card_list
- 前端: 新增 4 个 widget 渲染器 (StatCardsWidget/ActionListWidget/FunnelStageWidget/CardListWidget)
- 前端: PluginDashboardPage widget 数据加载支持新类型
P6 仪表盘 widgets:
- freelance: 工作台仪表盘 4 个 widgets (财务概览/紧急待办/商机漏斗/活跃项目)
- itops: 新增运维概览仪表盘 2 个 widgets (运维概览/紧急待办)
2026-04-20 09:35:27 +08:00
iven
4bcb4beaa5
feat(plugin): P1-P4 审计修复 — 第一批 (Excel/CSV导出 + 市场API + 对账扫描)
...
1.1 Excel/CSV 导出:
- 后端 export 支持 format 参数 (json/csv/xlsx)
- rust_xlsxwriter 生成带样式 Excel
- 前端导出按钮改为 Dropdown 格式选择 (JSON/CSV/Excel)
- blob 下载支持 CSV/XLSX 二进制格式
1.2 市场后端 API + 前端对接:
- SeaORM Entity: market_entry, market_review
- API: 浏览/详情/一键安装/评论列表/提交评分
- 一键安装: upload → install → enable 一条龙 + 依赖检查
- 前端 PluginMarket 对接真实 API (搜索/分类/安装/评分)
1.3 对账扫描:
- reconcile_references() 扫描跨插件引用悬空 UUID
- POST /plugins/{plugin_id}/reconcile 端点
2026-04-19 14:32:06 +08:00
iven
120f3fe867
feat(plugin): P2-4 数据导入导出 — 后端 export/import API + 前端 UI + TS 修复
...
- data_service: export 方法查询匹配行(上限10000),import 方法逐行校验+插入
- data_handler: export_plugin_data / import_plugin_data 处理函数
- module: 注册 GET /export + POST /import 路由
- pluginData.ts: exportPluginData / importPluginData API 函数
- PluginCRUDPage: 根据 entity importable/exportable 标志显示导出/导入按钮
- PluginMarket: 修复 TS 错误 (unused imports, type narrowing)
- PluginSettingsForm: 修复 TS 错误 (Rule type, Divider orientation)
2026-04-19 13:28:12 +08:00
iven
e429448c42
feat(plugin): P2-P4 插件平台演进 — 通用服务 + 质量保障 + 市场
...
P2 平台通用服务:
- manifest 扩展: settings/numbering/templates/trigger_events/importable/exportable 声明
- 插件配置 UI: PluginSettingsForm 自动表单 + 后端校验 + 详情抽屉 Settings 标签页
- 编号规则: Host API numbering-generate + PostgreSQL 序列 + manifest 绑定
- 触发事件: data_service create/update/delete 自动发布 DomainEvent
- WIT 接口: 新增 numbering-generate/setting-get Host API
P3 质量保障:
- plugin_validator.rs: 安全扫描(WASM大小/实体数量/字段校验) + 复杂度评分
- 运行时监控指标: RuntimeMetrics (错误率/响应时间/Fuel/内存)
- 性能基准: BenchmarkResult 阈值定义
- 上传时自动安全扫描 + /validate API 端点
P4 插件市场:
- 数据库迁移: plugin_market_entries + plugin_market_reviews 表
- 前端 PluginMarket 页面: 分类浏览/搜索/详情/评分
- 路由注册: /plugins/market
测试: 269 全通过 (71 erp-plugin + 41 auth + 57 config + 34 core + 50 message + 16 workflow)
2026-04-19 12:16:24 +08:00
iven
0ee9d22634
fix(plugin): P1 跨插件引用修复 — DateTime generated column + resolve-labels UUID 类型 + EntitySelect manifest→UUID 映射
...
- manifest.rs: DateTime 类型 generated column 改为 TEXT 存储(PostgreSQL TIMESTAMPTZ cast 非 immutable)
- data_handler.rs: resolve-labels 查询参数从 String 改为 UUID 类型避免类型不匹配
- data_dto.rs: PublicEntityResp 新增 plugin_id 字段
- EntitySelect.tsx: 跨插件查询先通过 registry 解析 manifest_id→plugin UUID
- pluginData.ts: PublicEntity 接口增加 plugin_id
- plugin_tests.rs: 适配 PluginField/PluginEntity 新增字段
2026-04-19 08:44:45 +08:00
iven
9e28d71295
feat(web,plugin): P1 跨插件引用 — 前端 Phase 4
...
- plugins.ts: PluginFieldSchema 新增 ref_plugin/ref_fallback_label, PluginEntitySchema 新增 is_public
- pluginData.ts: 新增 resolveRefLabels/getPluginEntityRegistry API
- EntitySelect: 支持 refPlugin 跨插件查询,目标不可用时降级为禁用 Input
- PluginCRUDPage: 表格列解析引用标签(蓝色 Tag),entity_select 表单传 refPlugin/fallbackLabel
2026-04-19 00:54:34 +08:00
iven
5ba11f985f
fix(web,plugin): 前端审计修复 — 401 消除 + 统计卡片 crash + 销售漏斗 500 + antd 6 废弃 API
...
- API client: proactive token refresh(请求前 30s 检查过期,提前刷新避免 401)
- Plugin store: fetchPlugins promise 去重,防止 StrictMode 并发重复请求
- Home stats: 简化 useEffect 加载逻辑,修复 tagColor undefined crash
- PluginGraphPage: valueStyle → styles.content, Spin tip → description(antd 6)
- DashboardWidgets: trailColor → railColor(antd 6)
- data_service: build_scope_sql 参数索引修复(硬编码 $100 → 动态 values.len()+1)
- erp-core error: Internal 错误添加 tracing::error 日志输出
2026-04-18 20:31:49 +08:00
iven
9d18b7e079
feat(web): Q3 前端体验优化 — ErrorBoundary + 5 hooks + 共享类型 + i18n 基础
...
- ErrorBoundary 组件:全局错误捕获与优雅降级
- 提取 5 个自定义 hooks:useCountUp, useDarkMode, useDebouncedValue, usePaginatedData, useApiRequest
- 从 11 个 API 文件提取 PaginatedResponse 共享类型到 api/types.ts
- 统一 API 错误处理(api/errors.ts)
- client.ts 迁移到 axios adapter 模式(替代废弃的 CancelToken)
- 添加 react-i18next 国际化基础设施 + zh-CN 语言包
2026-04-17 19:40:58 +08:00
iven
5b2ae16ffb
feat(web): API 层扩展 — batch/patch/timeseries/kanban 类型
...
- PluginFieldSchema 新增 ref_entity/ref_label_field/ref_search_fields/cascade_from/cascade_filter
- PluginPageSchema 新增 kanban 页面类型(lane_field/card_title_field 等)
- PluginPageSchema dashboard 类型扩展 widgets 字段
- 新增 DashboardWidget 接口(stat_card/bar/pie/funnel/line 图表)
- pluginData 新增 batchPluginData/patchPluginData/getPluginTimeseries 三个 API 函数
2026-04-17 10:55:24 +08:00
iven
ae62e2ecb2
feat(web): 完善插件前端页面 — 数据 API、筛选、视图切换和统计展示
...
- 新增 pluginData API 层:count/aggregate/stats 端点调用
- PluginCRUDPage 支持 visible_when 条件字段、筛选器下拉、视图切换
- PluginTabsPage 支持 tabs 布局和子实体 CRUD
- PluginTreePage 实现树形数据加载和节点展开/收起
- PluginGraphPage 实现关系图谱可视化展示
- PluginDashboardPage 实现统计卡片和聚合数据展示
- PluginAdmin 状态显示优化
- plugin store 增强 schema 加载逻辑和菜单生成
2026-04-16 23:42:57 +08:00
iven
e68fe8c1b1
feat(web): 插件前端全面增强 — 搜索/筛选/排序/详情页/条件表单/timeline 视图
...
- pluginData API: 支持 filter/search/sort_by/sort_order 参数
- plugins API: 新增 PluginFieldSchema/PluginEntitySchema/PluginPageSchema 类型
- PluginCRUDPage: 添加搜索框、筛选栏、视图切换(表格/时间线)
- PluginCRUDPage: 添加详情 Drawer(Descriptions + 嵌套 CRUD)
- PluginCRUDPage: 支持 visible_when 条件表单字段动态显示/隐藏
- PluginCRUDPage: 支持 compact 模式用于 detail 页面内嵌
2026-04-16 12:35:24 +08:00
iven
ff352a4c24
feat(plugin): 集成 WASM 插件系统到主服务并修复链路问题
...
- 新增 erp-plugin crate:插件管理、WASM 运行时、动态表、数据 CRUD
- 新增前端插件管理页面(PluginAdmin/PluginCRUDPage)和 API 层
- 新增插件数据迁移(plugins/plugin_entities/plugin_event_subscriptions)
- 新增权限补充迁移(为已有租户补充 plugin.admin/plugin.list 权限)
- 修复 PluginAdmin 页面 InstallOutlined 图标不存在的崩溃问题
- 修复 settings 唯一索引迁移顺序错误(先去重再建索引)
- 更新 wiki 和 CLAUDE.md 反映插件系统集成状态
- 新增 dev.ps1 一键启动脚本
2026-04-15 23:32:02 +08:00
iven
7e8fabb095
feat(auth): add change password API and frontend page
...
Backend:
- Add ChangePasswordReq DTO with validation (current + new password)
- Add AuthService::change_password() method with credential verification,
password rehash, and token revocation
- Add POST /api/v1/auth/change-password endpoint with utoipa annotation
Frontend:
- Add changePassword() API function in auth.ts
- Add ChangePassword.tsx page with form validation and confirmation
- Add "修改密码" tab in Settings page
After password change, all refresh tokens are revoked and the user
is redirected to the login page.
2026-04-15 01:32:18 +08:00
iven
9568dd7875
chore: apply cargo fmt across workspace and update docs
...
- Run cargo fmt on all Rust crates for consistent formatting
- Update CLAUDE.md with WASM plugin commands and dev.ps1 instructions
- Update wiki: add WASM plugin architecture, rewrite dev environment docs
- Minor frontend cleanup (unused imports)
2026-04-15 00:49:20 +08:00
iven
e16c1a85d7
feat(web): comprehensive frontend performance and UI/UX optimization
...
Performance improvements:
- Vite build: manual chunks, terser minification, optimizeDeps
- API response caching with 5s TTL via axios interceptors
- React.memo for SidebarMenuItem, useCallback for handlers
- CSS classes replacing inline styles to reduce reflows
UI/UX enhancements (inspired by SAP Fiori, Linear, Feishu):
- Dashboard: trend indicators, sparkline charts, CountUp animation on stat cards
- Dashboard: pending tasks section with priority labels
- Dashboard: recent activity timeline
- Design system tokens: trend colors, line-height, dark mode refinements
- Enhanced quick actions with hover animations
Accessibility (Lighthouse 100/100):
- Skip-to-content link, ARIA landmarks, heading hierarchy
- prefers-reduced-motion support, focus-visible states
- Color contrast fixes: all text meets 4.5:1 ratio
- Keyboard navigation for stat cards and task items
SEO: meta theme-color, format-detection, robots.txt
2026-04-13 01:37:55 +08:00
iven
3b41e73f82
fix: resolve E2E audit findings and add Phase C frontend pages
...
- Fix audit_log handler multi-tenant bug: use Extension<TenantContext>
instead of hardcoded default_tenant_id
- Fix sendMessage route mismatch: frontend /messages/send → /messages
- Add POST /users/{id}/roles backend route for role assignment
- Add task.completed event payload: started_by + instance_id for
notification delivery
- Add audit log viewer frontend page (AuditLogViewer.tsx)
- Add language management frontend page (LanguageManager.tsx)
- Add api/auditLogs.ts and api/languages.ts modules
2026-04-12 15:57:33 +08:00