diff --git a/apps/web/src/api/ai/analysis.ts b/apps/web/src/api/ai/analysis.ts index 1c4822d..5c7e238 100644 --- a/apps/web/src/api/ai/analysis.ts +++ b/apps/web/src/api/ai/analysis.ts @@ -4,6 +4,7 @@ import type { PaginatedResponse } from '../types'; export interface AnalysisItem { id: string; patient_id: string; + patient_name?: string; analysis_type: string; source_ref: string; model_used: string; diff --git a/apps/web/src/api/health/alerts.ts b/apps/web/src/api/health/alerts.ts index bc8feb7..7c00b2d 100644 --- a/apps/web/src/api/health/alerts.ts +++ b/apps/web/src/api/health/alerts.ts @@ -5,6 +5,7 @@ import type { PaginatedResponse } from '../types'; export interface Alert { id: string; patient_id: string; + patient_name?: string; rule_id: string; severity: string; title: string; diff --git a/apps/web/src/constants/health.ts b/apps/web/src/constants/health.ts index 6b017d2..80543ea 100644 --- a/apps/web/src/constants/health.ts +++ b/apps/web/src/constants/health.ts @@ -40,6 +40,8 @@ export const SEVERITY_COLOR: Record = { warning: 'orange', critical: 'red', urgent: 'magenta', + high: 'red', + medium: 'orange', }; export const SEVERITY_LABEL: Record = { @@ -47,18 +49,23 @@ export const SEVERITY_LABEL: Record = { warning: '警告', critical: '严重', urgent: '紧急', + high: '严重', + medium: '中等', }; export const SEVERITY_OPTIONS = [ { value: 'info', label: '提示' }, { value: 'warning', label: '警告' }, + { value: 'medium', label: '中等' }, { value: 'critical', label: '严重' }, + { value: 'high', label: '严重' }, { value: 'urgent', label: '紧急' }, ]; // --- 告警状态(统一 3 处: AlertDashboard, AlertList) --- export const ALERT_STATUS_COLOR: Record = { pending: 'orange', + active: 'gold', acknowledged: 'blue', resolved: 'green', dismissed: 'default', @@ -66,6 +73,7 @@ export const ALERT_STATUS_COLOR: Record = { export const ALERT_STATUS_LABEL: Record = { pending: '待处理', + active: '活跃', acknowledged: '已确认', resolved: '已恢复', dismissed: '已忽略', @@ -73,6 +81,7 @@ export const ALERT_STATUS_LABEL: Record = { export const ALERT_STATUS_OPTIONS = [ { value: '', label: '全部状态' }, + { value: 'active', label: '活跃' }, { value: 'pending', label: '待处理' }, { value: 'acknowledged', label: '已确认' }, { value: 'resolved', label: '已恢复' }, diff --git a/apps/web/src/pages/health/AiAnalysisList.tsx b/apps/web/src/pages/health/AiAnalysisList.tsx index 12be95e..d93861c 100644 --- a/apps/web/src/pages/health/AiAnalysisList.tsx +++ b/apps/web/src/pages/health/AiAnalysisList.tsx @@ -11,6 +11,7 @@ import { import { useThemeMode } from '../../hooks/useThemeMode'; import { analysisApi, type AnalysisItem } from '../../api/ai/analysis'; import { suggestionApi, type SuggestionItem } from '../../api/ai/suggestions'; +import { EntityName } from '../../components/EntityName'; const { Text } = Typography; @@ -321,9 +322,9 @@ export default function AiAnalysisList() { dataIndex: 'patient_id', key: 'patient_id', width: 140, - render: (v: string) => ( - - {v.slice(0, 8)} + render: (_: unknown, record: AnalysisItem) => ( + + ), }, diff --git a/apps/web/src/pages/health/AlertDashboard.tsx b/apps/web/src/pages/health/AlertDashboard.tsx index 4e78338..330a8ac 100644 --- a/apps/web/src/pages/health/AlertDashboard.tsx +++ b/apps/web/src/pages/health/AlertDashboard.tsx @@ -245,7 +245,7 @@ export default function AlertDashboard() { } description={ - 患者: + 患者: {' · '} {new Date(alert.created_at).toLocaleString('zh-CN')} diff --git a/apps/web/src/pages/health/AlertList.tsx b/apps/web/src/pages/health/AlertList.tsx index af6c447..5882c1a 100644 --- a/apps/web/src/pages/health/AlertList.tsx +++ b/apps/web/src/pages/health/AlertList.tsx @@ -137,12 +137,11 @@ export default function AlertList() { dataIndex: 'patient_id', key: 'patient_id', width: 140, - render: (id: string) => ( - + render: (_: unknown, record: Alert) => ( + 8 ? id.slice(0, 8) + '...' : id} + name={record.patient_name} + id={record.patient_id} /> ), diff --git a/apps/web/src/pages/health/ConsultationDetail.tsx b/apps/web/src/pages/health/ConsultationDetail.tsx index 2bb73a4..059f71a 100644 --- a/apps/web/src/pages/health/ConsultationDetail.tsx +++ b/apps/web/src/pages/health/ConsultationDetail.tsx @@ -7,6 +7,7 @@ import { StatusTag } from './components/StatusTag'; import { ImagePreview } from './components/ImagePreview'; import { useThemeMode } from '../../hooks/useThemeMode'; import { AuthButton } from '../../components/AuthButton'; +import { EntityName } from '../../components/EntityName'; const PAGE_SIZE = 30; const POLL_INTERVAL = 10_000; @@ -297,10 +298,10 @@ export default function ConsultationDetail() { {session && ( <> - 患者: {session.patient_id.slice(0, 8)} + 患者: - 医护: {session.doctor_id ? session.doctor_id.slice(0, 8) : '-'} + 医护: diff --git a/apps/web/src/pages/health/DeviceManage.tsx b/apps/web/src/pages/health/DeviceManage.tsx index 7ba0fa8..041b59c 100644 --- a/apps/web/src/pages/health/DeviceManage.tsx +++ b/apps/web/src/pages/health/DeviceManage.tsx @@ -5,6 +5,7 @@ import dayjs from 'dayjs'; import { deviceApi, type DeviceItem } from '../../api/health/devices'; import { DEVICE_TYPE_OPTIONS, DEVICE_TYPE_COLOR } from '../../constants/health'; +import { PatientSelect } from './components/PatientSelect'; function formatTime(val?: string | null): string { if (!val) return '-'; @@ -109,13 +110,13 @@ export default function DeviceManage() {

设备管理

- setFilterPatientId(e.target.value)} - style={{ width: 200 }} - allowClear - /> +
+ setFilterPatientId(val || '')} + placeholder="搜索患者" + /> +