feat(mp): 患者端健康告警页面 + 首页入口
P1-8: 小程序患者告警推送 - 新增 alert service:listPatientAlerts 按患者 ID 查询告警 - 新增 pkg-health/alerts 告警列表页:严重程度标签 + 状态过滤 + 分页 - 首页快捷服务新增"健康告警"入口 - app.config.ts 注册 alerts/index 页面路由
This commit is contained in:
21
apps/miniprogram/src/services/alert.ts
Normal file
21
apps/miniprogram/src/services/alert.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface Alert {
|
||||
id: string;
|
||||
severity: string;
|
||||
title: string;
|
||||
status: string;
|
||||
detail?: Record<string, unknown>;
|
||||
created_at: string;
|
||||
acknowledged_at?: string;
|
||||
resolved_at?: string;
|
||||
}
|
||||
|
||||
export async function listPatientAlerts(patientId: string, params?: { status?: string; page?: number; page_size?: number }) {
|
||||
return api.get<{ data: Alert[]; total: number }>('/health/alerts', {
|
||||
patient_id: patientId,
|
||||
page: params?.page ?? 1,
|
||||
page_size: params?.page_size ?? 20,
|
||||
status: params?.status,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user