feat(web): 患者快捷导航 + 列表页 URL patient_id 筛选 + AI 列表患者 Link
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

- 患者详情页增加快捷导航卡片(预约/咨询/透析/随访/AI)
- 5 个列表页支持 URL ?patient_id=xxx 自动筛选
- AI 分析列表患者 ID 改为可点击 Link 跳转详情
This commit is contained in:
iven
2026-05-01 18:17:07 +08:00
parent 0f32d28ddb
commit 8dd269d150
5 changed files with 39 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import { useEffect, useState, useCallback, useMemo } from 'react';
import { useSearchParams, Link } from 'react-router-dom';
import { Table, Select, Tag, Space, Button, message, Typography } from 'antd';
import {
RobotOutlined,
@@ -247,12 +248,15 @@ function SuggestionPanel({ analysisId, isDark }: { analysisId: string; isDark: b
// ---------------------------------------------------------------------------
export default function AiAnalysisList() {
const [searchParams] = useSearchParams();
const urlPatientId = searchParams.get('patient_id');
const [data, setData] = useState<AnalysisItem[]>([]);
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(false);
const [query, setQuery] = useState<{ page: number; page_size: number; analysis_type?: string }>({
const [query, setQuery] = useState<{ page: number; page_size: number; analysis_type?: string; patient_id?: string }>({
page: 1,
page_size: 20,
patient_id: urlPatientId || undefined,
});
const [expandedId, setExpandedId] = useState<string | null>(null);
const [detail, setDetail] = useState<AnalysisItem | null>(null);
@@ -313,12 +317,14 @@ export default function AiAnalysisList() {
),
},
{
title: '患者 ID',
title: '患者',
dataIndex: 'patient_id',
key: 'patient_id',
width: 120,
width: 140,
render: (v: string) => (
<span style={{ fontFamily: 'monospace', fontSize: 12 }}>{v.slice(0, 8)}</span>
<Link to={`/health/patients/${v}`} style={{ fontFamily: 'monospace', fontSize: 12 }}>
{v.slice(0, 8)}
</Link>
),
},
{