fix(mp): 修复小程序角色路由 + 前后端字段对齐 + E2E 测试报告

- 修复 stores/auth.ts 三种登录方式从错误路径提取 roles(resp.roles → resp.user.roles)
- 首页添加医护人员自动跳转医生端(useDidShow + isMedicalStaff)
- services/auth.ts credentialLogin 返回类型补全 roles 字段
- Web 前端 healthData.ts 字段对齐后端 DTO(indicators→items, content→overall_assessment)
- Web 前端 medicationReminders.ts 字段对齐(time_slots→reminder_times)
- 小程序 report.ts / reports 页面字段对齐后端(indicators→items, doctor_interpretation→doctor_notes)
- 小程序 patient.ts / followup.ts / alert.ts 补全缺失字段
- 后端 stats_handler.rs 权限码修正(health.patient.list→health.dashboard.manage)
- 新增 V1 E2E 测试报告和五专家组评审报告
This commit is contained in:
iven
2026-05-17 01:51:02 +08:00
parent aa27c5174c
commit c38967a36e
17 changed files with 898 additions and 67 deletions

View File

@@ -2,13 +2,18 @@ import { api } from './request';
export interface Alert {
id: string;
patient_id?: string;
rule_id?: string;
severity: string;
title: string;
message?: string;
status: string;
detail?: Record<string, unknown>;
created_at: string;
updated_at?: string;
acknowledged_at?: string;
resolved_at?: string;
version?: number;
}
export async function listPatientAlerts(patientId: string, params?: { status?: string; page?: number; page_size?: number }) {

View File

@@ -28,7 +28,7 @@ export interface PatientInfo {
}
export async function credentialLogin(username: string, password: string, tenantId: string) {
return api.post<{ access_token: string; refresh_token: string; expires_in?: number; user: { id: string; username: string; display_name?: string; phone?: string; tenant_id?: string } }>('/auth/login', {
return api.post<{ access_token: string; refresh_token: string; expires_in?: number; user: { id: string; username: string; display_name?: string; phone?: string; tenant_id?: string; roles?: Array<{ code: string; name: string }> } }>('/auth/login', {
username,
password,
tenant_id: tenantId,

View File

@@ -6,8 +6,12 @@ export interface FollowUpTask {
patient_name?: string;
follow_up_type: string;
content_template?: string;
assigned_to?: string;
assigned_to_name?: string;
status: string;
planned_date: string;
completed_at?: string;
notes?: string;
version: number;
}

View File

@@ -5,9 +5,18 @@ export interface Patient {
name: string;
gender?: string;
birth_date?: string;
phone?: string;
blood_type?: string;
id_number?: string;
allergy_history?: string;
medical_history_summary?: string;
emergency_contact_name?: string;
emergency_contact_phone?: string;
phone?: string;
relation?: string;
status?: string;
verification_status?: string;
source?: string;
notes?: string;
version: number;
}

View File

@@ -12,8 +12,8 @@ export interface LabReport {
id: string;
report_date: string;
report_type: string;
indicators: Record<string, IndicatorDetail>;
doctor_interpretation?: string;
items?: unknown;
doctor_notes?: string;
image_urls?: string[];
version: number;
}