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 工具函数
This commit is contained in:
iven
2026-04-27 22:09:21 +08:00
parent e1d9f97d79
commit c53f5625bc
21 changed files with 323 additions and 214 deletions

View File

@@ -118,24 +118,21 @@ export default function PatientDetail() {
)}
{/* 近期化验 */}
{summary?.recent_lab_reports && summary.recent_lab_reports.length > 0 && (
{summary?.latest_lab_report && (
<View className='section'>
<Text className='section-title'></Text>
{summary.recent_lab_reports.map((r) => (
<View
key={r.id}
className='lab-item'
onClick={() => Taro.navigateTo({ url: `/pages/doctor/report/detail/index?patientId=${patientId}&id=${r.id}` })}
>
<View className='lab-item__header'>
<Text className='lab-item__type'>{r.report_type}</Text>
<Text className='lab-item__date'>{r.report_date}</Text>
</View>
{r.abnormal_count > 0 && (
<Text className='lab-item__abnormal'>{r.abnormal_count} </Text>
)}
<View
className='lab-item'
onClick={() => Taro.navigateTo({ url: `/pages/doctor/report/detail/index?patientId=${patientId}&id=${summary.latest_lab_report!.id}` })}
>
<View className='lab-item__header'>
<Text className='lab-item__type'>{summary.latest_lab_report.report_type}</Text>
<Text className='lab-item__date'>{summary.latest_lab_report.report_date}</Text>
</View>
))}
{(summary.latest_lab_report.abnormal_count ?? 0) > 0 && (
<Text className='lab-item__abnormal'>{summary.latest_lab_report.abnormal_count} </Text>
)}
</View>
</View>
)}