chore: record session journal - 握力环训练趣味化
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"file":".trellis/tasks/05-07-diagnosis-daily-matrix-tab/research/implementation-plan.md","reason":"Use the repo-local plan summary to review whether the new DailyMatrix tab fully replaces the four old tabs and preserves the agreed interaction behavior."}
|
||||
@@ -0,0 +1 @@
|
||||
{"file":".trellis/tasks/05-07-diagnosis-daily-matrix-tab/research/implementation-plan.md","reason":"Summarizes the external implementation plan into repo-local task context for the implement agent, including component boundaries, interaction rules, and file targets."}
|
||||
@@ -0,0 +1,73 @@
|
||||
# 诊单编辑:日历矩阵汇总 Tab
|
||||
|
||||
## Goal
|
||||
|
||||
在 `admin/src/views/tcm/diagnosis/edit.vue` 中,把现有“血糖血压记录 / 饮食记录 / 运动打卡记录 / 待办事项”4 个独立 tab,替换为 1 个“日常记录”汇总 tab,使用日期矩阵视图统一展示并支持点击新增/编辑。
|
||||
|
||||
## What I already know
|
||||
|
||||
* 当前相关组件位于:
|
||||
* `admin/src/views/tcm/diagnosis/components/BloodRecordList.vue`
|
||||
* `admin/src/views/tcm/diagnosis/components/DietRecordList.vue`
|
||||
* `admin/src/views/tcm/diagnosis/components/ExerciseRecordList.vue`
|
||||
* `admin/src/views/tcm/diagnosis/components/DiagnosisTodoList.vue`
|
||||
* 现有只读矩阵参考实现位于:
|
||||
* `admin/src/views/tcm/diagnosis/components/TrackingMatrix.vue`
|
||||
* `admin/src/views/tcm/diagnosis/readonly.vue`
|
||||
* 现有接口已具备:
|
||||
* `diagnosisTrackingWindow`
|
||||
* `bloodRecordAdd / bloodRecordEdit / bloodRecordDetail`
|
||||
* `dietRecordAdd / dietRecordEdit`
|
||||
* `exerciseRecordAdd / exerciseRecordEdit`
|
||||
* 现有阈值工具可复用:`admin/src/utils/blood-thresholds.ts`
|
||||
|
||||
## User Decisions
|
||||
|
||||
* 完全替换原 4 个 tab,不并存
|
||||
* 默认最近 7 天
|
||||
* 待办事项不进矩阵,作为独立列表放矩阵下方
|
||||
* 点击单元格后用对话框编辑/新增,不做内联编辑
|
||||
|
||||
## Requirements
|
||||
|
||||
* 新建 `admin/src/views/tcm/diagnosis/components/DailyMatrix.vue`
|
||||
* `edit.vue` 中删除原 4 个 tab,引入 1 个“日常记录”tab
|
||||
* 矩阵横向按天,纵向按指标,空单元格也可点击新增
|
||||
* 最近 7 天场景下,表格应尽量填满可用宽度,避免右侧大块空白
|
||||
* 默认选择最近 7 天
|
||||
* 在待办事项上方新增折线图区域,时间范围与上方矩阵联动
|
||||
* 折线图先展示两条曲线:空腹血糖、餐后血糖
|
||||
* 权限统一收口:删除原血糖/饮食/运动相关按钮权限,新增 1 个“日常记录”权限,待办查看/操作权限也归入该权限域
|
||||
* 待办事项沿用 `DiagnosisTodoList`,放在矩阵下方
|
||||
* 支持 7 天 / 30 天 / 自定义日期范围
|
||||
* 支持 `viewOnly` 模式下禁用点击和新增
|
||||
* 不删除旧组件文件,仅停止在 `edit.vue` 中使用
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
* [ ] `edit.vue` 中原 4 个 tab 不再显示
|
||||
* [ ] 新 tab “日常记录”可在诊单保存后显示矩阵
|
||||
* [ ] 默认最近 7 天,可切换 30 天和自定义范围
|
||||
* [ ] 最近 7 天时矩阵不会在右侧留下明显大块空白
|
||||
* [ ] 待办事项上方折线图可随时间范围联动刷新
|
||||
* [ ] 日常记录相关前端权限判断与菜单权限已统一,不再散落在旧血糖/饮食/运动/待办权限上
|
||||
* [ ] 点击空单元格可新增,点击已有单元格可编辑
|
||||
* [ ] 待办事项在矩阵下方正常显示
|
||||
* [ ] `viewOnly` 模式下矩阵不可编辑
|
||||
|
||||
## Out of Scope
|
||||
|
||||
* 不修改后端 trackingWindow 接口
|
||||
* 不删除旧组件文件
|
||||
* 不重做只读页 `readonly.vue` 的整体结构
|
||||
|
||||
## Technical Notes
|
||||
|
||||
* 新建主组件:`admin/src/views/tcm/diagnosis/components/DailyMatrix.vue`
|
||||
* 修改入口页:`admin/src/views/tcm/diagnosis/edit.vue`
|
||||
* 参考实现:`admin/src/views/tcm/diagnosis/components/TrackingMatrix.vue`
|
||||
* 复用阈值工具:`admin/src/utils/blood-thresholds.ts`
|
||||
|
||||
## Research References
|
||||
|
||||
* [`research/implementation-plan.md`](research/implementation-plan.md) — 从外部计划整理出的实施要点
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
# 实施要点
|
||||
|
||||
## 新组件
|
||||
|
||||
新建 `admin/src/views/tcm/diagnosis/components/DailyMatrix.vue`,负责:
|
||||
|
||||
* 顶部工具栏:7 天 / 30 天 / 自定义 / 新增按钮 / 刷新
|
||||
* 矩阵表格:左侧指标固定列,右侧日期列动态生成
|
||||
* 3 个 dialog:血糖、饮食、运动
|
||||
* 底部待办:复用 `DiagnosisTodoList`
|
||||
|
||||
## edit.vue 改动
|
||||
|
||||
* 删除 4 个旧 tab 的挂载
|
||||
* 删除对应 import
|
||||
* 插入 1 个“日常记录”tab,空诊单时显示 `el-empty`
|
||||
* 新增 `DailyMatrix` import
|
||||
|
||||
## 数据来源
|
||||
|
||||
* `diagnosisTrackingWindow` 一次拉取血糖/饮食/运动数据
|
||||
* 前端按日期归并成 `bloodByDate / dietByDate / exerciseByDate`
|
||||
* 空日期也要生成列
|
||||
* 折线图可直接复用同一批 `blood_records` 数据,无需新增接口
|
||||
|
||||
## 交互规则
|
||||
|
||||
* 单元格点击:打开对应 dialog
|
||||
* 血糖/血压/西药/胰岛素共用 blood dialog
|
||||
* 早餐/午餐/晚餐共用 diet dialog
|
||||
* 运动单独 exercise dialog
|
||||
* 提交成功后刷新矩阵
|
||||
|
||||
## 只读约束
|
||||
|
||||
* `readOnly=true` 时:
|
||||
* 单元格不可点击
|
||||
* 工具栏新增按钮置灰
|
||||
* 待办列表走其自身只读模式
|
||||
|
||||
## 新增优化要求
|
||||
|
||||
* 最近 7 天视图下,日期列宽不应固定得过窄导致右侧留白,应根据列数动态铺满
|
||||
* 待办事项上方增加血糖折线图区域
|
||||
* 折线图展示:
|
||||
* 空腹血糖
|
||||
* 餐后血糖
|
||||
* 折线图时间范围与矩阵当前选择保持一致
|
||||
|
||||
## 权限收口要求
|
||||
|
||||
* 原“血糖 / 饮食 / 运动”按钮权限不再单独作为入口能力暴露
|
||||
* 新增统一“日常记录”权限
|
||||
* 待办列表与其新增/取消能力一并纳入“日常记录”权限域
|
||||
* 前端 `hasPermission` / `v-perms` 与菜单 SQL 要保持一致
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "diagnosis-daily-matrix-tab",
|
||||
"name": "diagnosis-daily-matrix-tab",
|
||||
"title": "诊单编辑日历矩阵汇总 tab",
|
||||
"description": "",
|
||||
"status": "completed",
|
||||
"dev_type": null,
|
||||
"scope": null,
|
||||
"package": null,
|
||||
"priority": "P2",
|
||||
"creator": "codex-agent",
|
||||
"assignee": "codex-agent",
|
||||
"createdAt": "2026-05-07",
|
||||
"completedAt": "2026-05-11",
|
||||
"branch": null,
|
||||
"base_branch": "master",
|
||||
"worktree_path": null,
|
||||
"commit": null,
|
||||
"pr_url": null,
|
||||
"subtasks": [],
|
||||
"children": [],
|
||||
"parent": null,
|
||||
"relatedFiles": [],
|
||||
"notes": "",
|
||||
"meta": {}
|
||||
}
|
||||
Reference in New Issue
Block a user