Files
Mdeical_Sur_Report/工程分析/需求分析-2026-04-17-23-12-52.md

34 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 需求分析 — 2026-04-17-23-12-52
## 原始需求摘要
1. `template-manage` 字段管理 → 时间字段 → 格式第三栏中,当前只显示 `YYYY-MM-DD``24h`,缺少 `YYYY年MM月DD日``HH:mm` / `hh:mm A` 等选项;希望将 `24h` 改为 `HH:mm24H` 的友好显示。
2. `report-editor` 中手术终止时间 smart field 显示为 "24h" 字样,而不是正常的时间值。
3. `template-manage` 字段管理中,点击字段进入编辑模式后,部分输入框/下拉框在特定位置(如滚动容器底部边缘)点击无响应,需要滚动屏幕后才能正常获取焦点。
## 需求拆解
### 功能点
- **F1**:修正 `types.ts``DEFAULT_FORM_FIELDS``startTime`/`endTime``timeFormat` 默认值,从 `'24h'` 改为 `'HH:mm'`
- **F2**:在 `ReportEditor.tsx``formatTimeDisplay` 函数中增加对旧脏数据 `'24h'` 的兼容兜底,自动映射为 `'HH:mm'`
- **F3**:在 `TemplateManage.tsx` 中按字段类型date/time过滤 `customTimeFormats` 的 datalist 显示,避免 date 字段看到 time 格式、time 字段看到 date 格式。
- **F4**:在 `TemplateManage.tsx` 的字段编辑卡片 `onClick` 中增加 `scrollIntoView`,解决编辑面板撑开后底部输入框被滚动容器裁切导致的点击失效问题。
### 非功能点
- 向后兼容:已有用户的 `formFieldsConfig` 中可能仍存在 `'24h'`,通过 F2 的兼容处理确保不影响现有报告。
- 不引入新的 localStorage key复用现有的 `customTimeFormats` 缓存。
## 影响范围预估
| 模块 | 影响程度 | 说明 |
|------|---------|------|
| `src/types.ts` | 中 | `DEFAULT_FORM_FIELDS``startTime`/`endTime``timeFormat` 默认值修改 |
| `src/pages/ReportEditor.tsx` | 低 | `formatTimeDisplay` 增加一行兼容兜底 |
| `src/pages/TemplateManage.tsx` | 中 | datalist 过滤逻辑 + 编辑卡片滚动对齐 |
## 待确认问题
无(用户已明确需求,且本次无需人工确认)。