feat(mp): 医护端告警列表/详情页 + DoctorHome 告警 banner 增强
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

- 新增告警列表页:按状态筛选、分页、严重程度/状态标签
- 新增告警详情页:完整信息展示 + 确认/忽略/恢复操作
- doctor.ts 新增 listAlerts/acknowledgeAlert/dismissAlert/resolveAlert API
- DoctorHome 告警 banner 跳转目标改为告警列表页
- 注册 alerts/index + alerts/detail/index 到 doctor subPackage
This commit is contained in:
iven
2026-04-28 20:05:55 +08:00
parent 1cf5f59d8c
commit 10c79c5e39
7 changed files with 767 additions and 11 deletions

View File

@@ -304,3 +304,41 @@ export async function getConsultationStats() {
export async function getFollowUpStats() {
return api.get<FollowUpStats>('/health/admin/statistics/follow-ups');
}
// ── Alerts (doctor view) ────────────────────────────
export interface Alert {
id: string;
patient_id: string;
rule_id: string;
severity: string;
title: string;
detail?: Record<string, unknown>;
status: string;
acknowledged_by?: string;
acknowledged_at?: string;
resolved_at?: string;
created_at: string;
version: number;
}
export async function listAlerts(params?: {
patient_id?: string;
status?: string;
page?: number;
page_size?: number;
}) {
return api.get<{ data: Alert[]; total: number }>('/health/alerts', params);
}
export async function acknowledgeAlert(id: string, version: number) {
return api.put<Alert>(`/health/alerts/${id}/acknowledge`, { version });
}
export async function dismissAlert(id: string, version: number) {
return api.put<Alert>(`/health/alerts/${id}/dismiss`, { version });
}
export async function resolveAlert(id: string, version: number) {
return api.put<Alert>(`/health/alerts/${id}/resolve`, { version });
}