fix(health+web): action-inbox 参数绑定修复 + antd 弃用警告清理

- action_inbox_service: count_sql 补齐 $4/$5 占位符,修复参数绑定数不匹配导致 500
- AiSidebar: Drawer width → size(antd v5 弃用替换)
- 6 个页面 Statistic: valueStyle → styles.content(antd v5 弃用替换)
- RealtimeMonitor: 移除未使用的 _alerts 变量
This commit is contained in:
iven
2026-05-21 08:08:47 +08:00
parent a3c84fc12a
commit 4d8658ae98
9 changed files with 40 additions and 36 deletions

View File

@@ -200,7 +200,7 @@ export default function AiSidebar({
</Space>
}
placement="right"
width={400}
size={400}
open={open}
onClose={onClose}
styles={{

View File

@@ -155,7 +155,7 @@ export default function AiUsageDashboard() {
title="总分析次数"
value={overview?.total_count ?? 0}
prefix={<ThunderboltOutlined style={{ color: '#1890ff' }} />}
valueStyle={{ fontWeight: 600 }}
styles={{ content: { fontWeight: 600 } }}
/>
</Card>
</Col>
@@ -165,7 +165,7 @@ export default function AiUsageDashboard() {
title="分析类型数"
value={types.length}
prefix={<ExperimentOutlined style={{ color: '#52c41a' }} />}
valueStyle={{ fontWeight: 600 }}
styles={{ content: { fontWeight: 600 } }}
/>
</Card>
</Col>
@@ -175,7 +175,7 @@ export default function AiUsageDashboard() {
title="本月分析"
value={totalCount}
prefix={<ThunderboltOutlined style={{ color: '#fa8c16' }} />}
valueStyle={{ fontWeight: 600 }}
styles={{ content: { fontWeight: 600 } }}
/>
</Card>
</Col>
@@ -229,7 +229,7 @@ export default function AiUsageDashboard() {
<Statistic
title="30 天总调用"
value={totalCalls}
valueStyle={{ fontWeight: 600 }}
styles={{ content: { fontWeight: 600 } }}
/>
</Card>
</Col>
@@ -238,7 +238,7 @@ export default function AiUsageDashboard() {
<Statistic
title="30 天总 Token"
value={totalTokens}
valueStyle={{ fontWeight: 600 }}
styles={{ content: { fontWeight: 600 } }}
/>
</Card>
</Col>
@@ -248,7 +248,7 @@ export default function AiUsageDashboard() {
title="30 天成本"
value={(totalCost / 100).toFixed(2)}
prefix="¥"
valueStyle={{ fontWeight: 600 }}
styles={{ content: { fontWeight: 600 } }}
/>
</Card>
</Col>

View File

@@ -196,7 +196,7 @@ export default function AlertDashboard() {
title="待处理"
value={pendingCount}
prefix={<ExclamationCircleOutlined />}
valueStyle={{ color: pendingCount > 0 ? "#fa8c16" : undefined }}
styles={{ content: { color: pendingCount > 0 ? "#fa8c16" : undefined } }}
/>
</Card>
</Col>
@@ -206,7 +206,7 @@ export default function AlertDashboard() {
title="已确认"
value={acknowledgedCount}
prefix={<CheckCircleOutlined />}
valueStyle={{ color: "#1890ff" }}
styles={{ content: { color: "#1890ff" } }}
/>
</Card>
</Col>
@@ -216,8 +216,8 @@ export default function AlertDashboard() {
title="危急值"
value={criticalCount}
prefix={<WarningOutlined />}
valueStyle={{
color: criticalCount > 0 ? "#ff4d4f" : undefined,
styles={{
content: { color: criticalCount > 0 ? "#ff4d4f" : undefined },
}}
/>
</Card>

View File

@@ -22,7 +22,7 @@ interface PatientAlertSummary {
*/
export default function RealtimeMonitor() {
const { hasPermission } = usePermission('health.alerts.list');
const [_alerts, setAlerts] = useState<Alert[]>([]);
const [, setAlerts] = useState<Alert[]>([]);
const [loading, setLoading] = useState(true);
const [selectedPatientId, setSelectedPatientId] = useState<string | null>(null);
const [alertSummary, setAlertSummary] = useState<PatientAlertSummary[]>([]);
@@ -94,10 +94,10 @@ export default function RealtimeMonitor() {
}
>
<Row gutter={16} style={{ marginBottom: 16 }}>
<Col span={6}><Card><Statistic title="危急" value={totalCritical} valueStyle={{ color: '#cf1322' }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="高危" value={totalHigh} valueStyle={{ color: '#ff4d4f' }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="中等" value={totalMedium} valueStyle={{ color: '#fa8c16' }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="低危" value={totalLow} valueStyle={{ color: '#8c8c8c' }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="危急" value={totalCritical} styles={{ content: { color: '#cf1322' } }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="高危" value={totalHigh} styles={{ content: { color: '#ff4d4f' } }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="中等" value={totalMedium} styles={{ content: { color: '#fa8c16' } }} prefix={<AlertOutlined />} /></Card></Col>
<Col span={6}><Card><Statistic title="低危" value={totalLow} styles={{ content: { color: '#8c8c8c' } }} prefix={<AlertOutlined />} /></Card></Col>
</Row>
<Card title={`患者列表(${sortedPatients.length} 人有活跃告警)`} loading={loading}>

View File

@@ -158,7 +158,7 @@ export function DoctorDashboard() {
precision={0}
suffix="%"
prefix={<SafetyCertificateOutlined />}
valueStyle={{ color: (p?.follow_up_rate ?? 0) >= 80 ? '#3f8600' : '#cf1322' }}
styles={{ content: { color: (p?.follow_up_rate ?? 0) >= 80 ? '#3f8600' : '#cf1322' } }}
/>
</Card>
</Col>
@@ -184,7 +184,7 @@ export function DoctorDashboard() {
precision={0}
suffix="%"
prefix={<MedicineBoxOutlined />}
valueStyle={{ color: (p?.vital_signs_report_rate ?? 0) >= 70 ? '#3f8600' : '#cf1322' }}
styles={{ content: { color: (p?.vital_signs_report_rate ?? 0) >= 70 ? '#3f8600' : '#cf1322' } }}
/>
</Card>
</Col>

View File

@@ -13,14 +13,14 @@ function DialysisPanel({ data }: { data: DialysisStatistics | null | undefined }
return (
<Card type="inner" title={<span style={{ fontSize: 14, fontWeight: 600 }}></span>} style={{ borderRadius: 8 }}>
<Row gutter={[12, 12]}>
<Col span={8}><Statistic title="总记录" value={data?.total_records ?? 0} valueStyle={{ fontSize: 20 }} /></Col>
<Col span={8}><Statistic title="本月新增" value={data?.this_month ?? 0} valueStyle={{ fontSize: 20, color: '#2563eb' }} /></Col>
<Col span={8}><Statistic title="待审核" value={data?.pending_review ?? 0} valueStyle={{ fontSize: 20, color: '#d97706' }} /></Col>
<Col span={8}><Statistic title="总记录" value={data?.total_records ?? 0} styles={{ content: { fontSize: 20 } }} /></Col>
<Col span={8}><Statistic title="本月新增" value={data?.this_month ?? 0} styles={{ content: { fontSize: 20, color: '#2563eb' } }} /></Col>
<Col span={8}><Statistic title="待审核" value={data?.pending_review ?? 0} styles={{ content: { fontSize: 20, color: '#d97706' } }} /></Col>
</Row>
<Row gutter={[12, 12]} style={{ marginTop: 12 }}>
<Col span={8}><Statistic title="并发症率" value={data?.complication_rate ?? 0} suffix="%" precision={1} valueStyle={{ fontSize: 18 }} /></Col>
<Col span={8}><Statistic title="平均超滤(ml)" value={data?.avg_ultrafiltration ?? 0} precision={0} valueStyle={{ fontSize: 18 }} /></Col>
<Col span={8}><Statistic title="平均时长(分)" value={data?.avg_duration ?? 0} precision={0} valueStyle={{ fontSize: 18 }} /></Col>
<Col span={8}><Statistic title="并发症率" value={data?.complication_rate ?? 0} suffix="%" precision={1} styles={{ content: { fontSize: 18 } }} /></Col>
<Col span={8}><Statistic title="平均超滤(ml)" value={data?.avg_ultrafiltration ?? 0} precision={0} styles={{ content: { fontSize: 18 } }} /></Col>
<Col span={8}><Statistic title="平均时长(分)" value={data?.avg_duration ?? 0} precision={0} styles={{ content: { fontSize: 18 } }} /></Col>
</Row>
{(data?.type_distribution ?? []).length > 0 && (
<div style={{ marginTop: 12 }}>
@@ -38,13 +38,13 @@ function LabPanel({ data }: { data: HealthDataStats | null }) {
return (
<Card type="inner" title={<span style={{ fontSize: 14, fontWeight: 600 }}></span>} style={{ borderRadius: 8 }}>
<Row gutter={[12, 12]}>
<Col span={8}><Statistic title="总报告" value={data?.lab_reports.total_reports ?? 0} valueStyle={{ fontSize: 20 }} /></Col>
<Col span={8}><Statistic title="本月新增" value={data?.lab_reports.this_month ?? 0} valueStyle={{ fontSize: 20, color: '#2563eb' }} /></Col>
<Col span={8}><Statistic title="异常项" value={data?.lab_reports.abnormal_items ?? 0} valueStyle={{ fontSize: 20, color: '#dc2626' }} /></Col>
<Col span={8}><Statistic title="总报告" value={data?.lab_reports.total_reports ?? 0} styles={{ content: { fontSize: 20 } }} /></Col>
<Col span={8}><Statistic title="本月新增" value={data?.lab_reports.this_month ?? 0} styles={{ content: { fontSize: 20, color: '#2563eb' } }} /></Col>
<Col span={8}><Statistic title="异常项" value={data?.lab_reports.abnormal_items ?? 0} styles={{ content: { fontSize: 20, color: '#dc2626' } }} /></Col>
</Row>
<Row gutter={[12, 12]} style={{ marginTop: 12 }}>
<Col span={8}><Statistic title="待审核" value={data?.lab_reports.pending_review ?? 0} valueStyle={{ fontSize: 18, color: '#d97706' }} /></Col>
<Col span={8}><Statistic title="已审核" value={data?.lab_reports.reviewed ?? 0} valueStyle={{ fontSize: 18, color: '#059669' }} /></Col>
<Col span={8}><Statistic title="待审核" value={data?.lab_reports.pending_review ?? 0} styles={{ content: { fontSize: 18, color: '#d97706' } }} /></Col>
<Col span={8}><Statistic title="已审核" value={data?.lab_reports.reviewed ?? 0} styles={{ content: { fontSize: 18, color: '#059669' } }} /></Col>
</Row>
{(data?.lab_reports.type_distribution ?? []).length > 0 && (
<div style={{ marginTop: 12 }}>
@@ -62,9 +62,9 @@ function AppointmentsPanel({ data }: { data: HealthDataStats | null }) {
return (
<Card type="inner" title={<span style={{ fontSize: 14, fontWeight: 600 }}></span>} style={{ borderRadius: 8 }}>
<Row gutter={[12, 12]}>
<Col span={8}><Statistic title="总预约" value={data?.appointments.total_appointments ?? 0} valueStyle={{ fontSize: 20 }} /></Col>
<Col span={8}><Statistic title="本月" value={data?.appointments.this_month ?? 0} valueStyle={{ fontSize: 20, color: '#2563eb' }} /></Col>
<Col span={8}><Statistic title="取消率" value={data?.appointments.cancel_rate ?? 0} suffix="%" precision={1} valueStyle={{ fontSize: 20, color: '#dc2626' }} /></Col>
<Col span={8}><Statistic title="总预约" value={data?.appointments.total_appointments ?? 0} styles={{ content: { fontSize: 20 } }} /></Col>
<Col span={8}><Statistic title="本月" value={data?.appointments.this_month ?? 0} styles={{ content: { fontSize: 20, color: '#2563eb' } }} /></Col>
<Col span={8}><Statistic title="取消率" value={data?.appointments.cancel_rate ?? 0} suffix="%" precision={1} styles={{ content: { fontSize: 20, color: '#dc2626' } }} /></Col>
</Row>
{(data?.appointments.status_distribution ?? []).length > 0 && (
<div style={{ marginTop: 12 }}>
@@ -82,9 +82,9 @@ function VitalSignsPanel({ data }: { data: HealthDataStats | null }) {
return (
<Card type="inner" title={<span style={{ fontSize: 14, fontWeight: 600 }}></span>} style={{ borderRadius: 8 }}>
<Row gutter={[12, 12]}>
<Col span={8}><Statistic title="总患者" value={data?.vital_signs_report_rate.total_patients ?? 0} valueStyle={{ fontSize: 20 }} /></Col>
<Col span={8}><Statistic title="本月上报" value={data?.vital_signs_report_rate.reported_patients ?? 0} valueStyle={{ fontSize: 20, color: '#059669' }} /></Col>
<Col span={8}><Statistic title="上报率" value={data?.vital_signs_report_rate.report_rate ?? 0} suffix="%" precision={1} valueStyle={{ fontSize: 20, color: '#7c3aed' }} /></Col>
<Col span={8}><Statistic title="总患者" value={data?.vital_signs_report_rate.total_patients ?? 0} styles={{ content: { fontSize: 20 } }} /></Col>
<Col span={8}><Statistic title="本月上报" value={data?.vital_signs_report_rate.reported_patients ?? 0} styles={{ content: { fontSize: 20, color: '#059669' } }} /></Col>
<Col span={8}><Statistic title="上报率" value={data?.vital_signs_report_rate.report_rate ?? 0} suffix="%" precision={1} styles={{ content: { fontSize: 20, color: '#7c3aed' } }} /></Col>
</Row>
{(data?.vital_signs_report_rate.daily_trend ?? []).length > 0 && (
<div style={{ marginTop: 12 }}>

View File

@@ -137,7 +137,7 @@ export function NurseDashboard() {
<Col xs={8}>
<Card size="small">
<Statistic title="逾期随访" value={overdueCount} prefix={<TeamOutlined />}
valueStyle={{ color: (p?.overdue_follow_ups ?? 0) > 0 ? '#cf1322' : undefined }}
styles={{ content: { color: (p?.overdue_follow_ups ?? 0) > 0 ? '#cf1322' : undefined } }}
/>
</Card>
</Col>

View File

@@ -423,6 +423,8 @@ pub async fn list_action_items(
tenant_id.into(),
patient_val,
assigned_val,
(page_size as i64).into(),
(offset as i64).into(),
sug_val,
alert_val,
fu_val,

View File

@@ -165,6 +165,7 @@ mod m20260521_000160_follow_up_task_template_id_and_record_form_data;
mod m20260521_000161_consultation_media_id_and_suggestion_references;
mod m20260521_000162_consultation_session_rating_feedback;
mod m20260521_000163_reorganize_menus_by_business_flow;
mod m20260521_000164_reorganize_menus_scheme_b;
pub struct Migrator;
@@ -337,6 +338,7 @@ impl MigratorTrait for Migrator {
Box::new(m20260521_000161_consultation_media_id_and_suggestion_references::Migration),
Box::new(m20260521_000162_consultation_session_rating_feedback::Migration),
Box::new(m20260521_000163_reorganize_menus_by_business_flow::Migration),
Box::new(m20260521_000164_reorganize_menus_scheme_b::Migration),
]
}
}