fix(web): 清零前端 TS 构建错误 — 31 文件类型修复 + 面包屑 + 超时配置

- 修复 verbatimModuleSyntax 要求的 import type 声明
- 修复未使用导入(Badge/EditOutlined/Space/Input/Switch 等)
- 修复 mock.calls 类型注解([string,unknown] → any[])
- 修复 vitest 全局超时和 poolTimeout 配置
- 修复 PageContainer 缺少 onBack prop、MenuInfo children 可选
- 修复 CopilotAlert Badge status info→processing、useCopilotRisk 二次解包
- 修复 articles/doctors 测试 delete 调用缺少 version 参数
- 添加排班管理/预约管理面包屑标题 fallback
This commit is contained in:
iven
2026-05-15 23:03:08 +08:00
parent bf8bcdbd5d
commit ced1c0ad0c
30 changed files with 55 additions and 44 deletions

View File

@@ -4,10 +4,10 @@ import { CheckOutlined } from '@ant-design/icons';
import { listAlerts, dismissInsight } from '../../api/copilot';
import type { CopilotInsight } from '../../api/copilot';
const severityConfig: Record<string, { type: 'success' | 'info' | 'warning' | 'error'; label: string }> = {
const severityConfig: Record<string, { type: 'success' | 'processing' | 'warning' | 'error'; label: string }> = {
critical: { type: 'error', label: '危急' },
warning: { type: 'warning', label: '警告' },
info: { type: 'info', label: '提示' },
info: { type: 'processing', label: '提示' },
};
export function CopilotAlert() {

View File

@@ -13,8 +13,7 @@ export function useCopilotRisk(patientId: string | undefined) {
setError(null);
try {
const res = await getPatientRisk(patientId);
const payload = (res.data as { data?: RiskScore }).data ?? null;
setData(payload);
setData(res ?? null);
} catch (err) {
setError(err instanceof Error ? err.message : '加载风险评分失败');
} finally {

View File

@@ -12,6 +12,7 @@ interface PageContainerProps {
batchActions?: React.ReactNode;
selectedCount?: number;
onClearSelection?: () => void;
onBack?: () => void;
children: React.ReactNode;
loading?: boolean;
}
@@ -26,6 +27,7 @@ export function PageContainer({
batchActions,
selectedCount,
onClearSelection,
onBack,
children,
loading,
}: PageContainerProps) {
@@ -36,6 +38,11 @@ export function PageContainer({
<Flex justify="space-between" align="center" style={{ marginBottom: 16 }}>
<div>
<Typography.Title level={4} style={{ margin: 0 }}>
{onBack && (
<Button type="text" size="small" onClick={onBack} style={{ marginRight: 8 }}>
</Button>
)}
{title}
</Typography.Title>
{subtitle && (