feat(health): 工作台遗留项修复 — UNION ALL 聚合 + 团队概览 + 较昨日对比
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

1. 待办列表 UNION ALL 聚合:list_action_items 现从 ai_suggestion + alerts + follow_up_task 三表查询,
   ActionType 扩展为 AiSuggestion/Alert/Followup/DataAnomaly 四种类型,
   get_action_thread 按类型构建不同线程时间线(AI 建议/告警/随访)
2. 真实团队概览:get_team_overview 从 doctor_profile + follow_up_task + alerts 聚合成员统计和风险分布
3. 统计卡片较昨日描述:PersonalStatsResp 新增 6 个 yesterday_* 字段,
   Home.tsx 统计卡片底部渲染"较昨日+N"绿色/红色描述
4. 前端 ActionDetailDrawer 改用 item.id(action_type:uuid 格式)调用线程 API
This commit is contained in:
iven
2026-05-01 23:25:38 +08:00
parent 310a3cec90
commit 5e52b0a34c
6 changed files with 616 additions and 110 deletions

View File

@@ -155,6 +155,12 @@ export interface PersonalStats {
vital_signs_reported: number;
vital_signs_total: number;
pending_lab_reviews: number;
yesterday_my_patients?: number;
yesterday_today_appointments?: number;
yesterday_consultations_this_month?: number;
yesterday_follow_up_rate?: number;
yesterday_today_follow_ups?: number;
yesterday_overdue_follow_ups?: number;
}
export interface OverviewStatistics {
@@ -221,6 +227,51 @@ export interface HealthDataStats {
// --- API ---
export interface PointsAccountDetail {
id: string;
patient_id: string;
balance: number;
total_earned: number;
total_spent: number;
total_expired: number;
}
export interface PointsTransactionDetail {
id: string;
account_id: string;
transaction_type: string;
amount: number;
remaining_amount: number;
status: string;
expires_at: string | null;
balance_after: number;
description: string | null;
created_at: string;
}
export const pointsAdminApi = {
getPatientAccount: async (patientId: string) => {
const { data } = await client.get<{
success: boolean;
data: PointsAccountDetail;
}>(`/health/admin/points/patients/${patientId}/account`);
return data.data;
},
listPatientTransactions: async (
patientId: string,
params: { page?: number; page_size?: number },
) => {
const { data } = await client.get<{
success: boolean;
data: PaginatedResponse<PointsTransactionDetail>;
}>(`/health/admin/points/patients/${patientId}/transactions`, { params });
return data.data;
},
};
// --- API (original) ---
export const pointsApi = {
// Rules
listRules: async () => {