diff --git a/pcm-platform/admin-web/src/api/client.ts b/pcm-platform/admin-web/src/api/client.ts index 7759943..5662497 100644 --- a/pcm-platform/admin-web/src/api/client.ts +++ b/pcm-platform/admin-web/src/api/client.ts @@ -93,6 +93,10 @@ export const api = { listObservations: (patientId: string): Promise => request(`/patients/${patientId}/observations`), listAlerts: (patientId: string): Promise => request(`/patients/${patientId}/alerts`), + acknowledgeAlert: (patientId: string, alertId: string): Promise => + request(`/patients/${patientId}/alerts/${alertId}/acknowledge`, { method: 'POST' }), + resolveAlert: (patientId: string, alertId: string): Promise => + request(`/patients/${patientId}/alerts/${alertId}/resolve`, { method: 'POST' }), listReminders: (patientId: string): Promise => request(`/patients/${patientId}/reminders`), diff --git a/pcm-platform/admin-web/src/api/types.ts b/pcm-platform/admin-web/src/api/types.ts index 9dd4afc..edb06e4 100644 --- a/pcm-platform/admin-web/src/api/types.ts +++ b/pcm-platform/admin-web/src/api/types.ts @@ -64,10 +64,13 @@ export interface Alert { indicator: string; value: number; level: RiskLevel; + /** severity 为 level 的别名,后端字段对齐 */ + severity: RiskLevel; ruleIds: string[]; messages: string[]; status: AlertStatus; createdAt: string; + updatedAt: string; } // 个案 diff --git a/pcm-platform/admin-web/src/components/Skeleton.css b/pcm-platform/admin-web/src/components/Skeleton.css new file mode 100644 index 0000000..b83ce33 --- /dev/null +++ b/pcm-platform/admin-web/src/components/Skeleton.css @@ -0,0 +1,22 @@ +/* 骨架屏动画 */ +@keyframes shimmer { + 0% { background-position: -400px 0; } + 100% { background-position: 400px 0; } +} + +.skeleton-line { + display: inline-block; + background: linear-gradient( + 90deg, + var(--color-border) 25%, + var(--color-bg) 50%, + var(--color-border) 75% + ); + background-size: 800px 100%; + animation: shimmer 1.5s infinite linear; + vertical-align: middle; +} + +.skeleton-root { + pointer-events: none; +} diff --git a/pcm-platform/admin-web/src/components/Skeleton.tsx b/pcm-platform/admin-web/src/components/Skeleton.tsx new file mode 100644 index 0000000..3f870fe --- /dev/null +++ b/pcm-platform/admin-web/src/components/Skeleton.tsx @@ -0,0 +1,180 @@ +/** + * 骨架屏组件 — 真实布局骨架,提升感知加载速度 + * 替代整页 loading spinner,让用户"看到"即将呈现的内容结构 + */ + +import './Skeleton.css'; + +interface SkeletonLineProps { + width?: string; + height?: string; + radius?: string; +} + +function SkeletonLine({ width = '100%', height = '14px', radius = '4px' }: SkeletonLineProps): JSX.Element { + return ( +