feat: 仪表盘角色自适应重构 — 4角色视图 + 后端个人工作量API
Some checks failed
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled

后端:
- 新增 GET /health/admin/statistics/personal-stats 接口
- PersonalStatsResp: 13个个人维度统计字段
- 按医生/护士/管理员/运营角色聚合工作量数据

前端:
- useDashboardRole hook: 按优先级 doctor>nurse>admin>operator 匹配角色
- DoctorDashboard: 今日工作台(日程/审核/消息/统计卡)
- NurseDashboard: 随访监控台(异常提醒/队列/上报率)
- AdminDashboard: 管理中心(5KPI + 健康数据Tab)
- OperatorDashboard: 运营中心(积分/文章/活动)
- StatisticsDashboard.tsx 重写为角色路由组件
- 删除旧区块:快捷入口/积分排行Top10/最近活动
This commit is contained in:
iven
2026-04-28 07:54:08 +08:00
parent 35d4f6c843
commit 2f42ebff1d
11 changed files with 788 additions and 254 deletions

View File

@@ -141,6 +141,22 @@ export interface FollowUpStatistics {
completion_rate: number;
}
export interface PersonalStats {
my_patients: number;
new_patients_this_month: number;
follow_up_rate: number;
consultations_this_month: number;
pending_consultations: number;
vital_signs_report_rate: number;
today_appointments: number;
overdue_follow_ups: number;
today_follow_ups: number;
abnormal_vital_signs: number;
vital_signs_reported: number;
vital_signs_total: number;
pending_lab_reviews: number;
}
export interface OverviewStatistics {
patients: PatientStatistics;
consultations: ConsultationStatistics;
@@ -359,4 +375,12 @@ export const pointsApi = {
}>('/health/admin/statistics/health-data');
return data.data;
},
getPersonalStats: async (): Promise<PersonalStats> => {
const { data } = await client.get<{
success: boolean;
data: PersonalStats;
}>('/health/admin/statistics/personal-stats');
return data.data;
},
};