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

@@ -44,7 +44,7 @@ describe('articleApi', () => {
it('create 应调用 POST /health/articles', async () => {
mockPost.mockResolvedValue(fakeRes)
const req = { title: '健康饮食指南', content: '正文内容', content_type: 'markdown' }
const req = { title: '健康饮食指南', content: '正文内容', content_type: 'markdown' as const }
await articleApi.create(req)
expect(mockPost).toHaveBeenCalledWith('/health/articles', req)
@@ -60,7 +60,7 @@ describe('articleApi', () => {
it('delete 应调用 DELETE /health/articles/:id', async () => {
mockDelete.mockResolvedValue({ data: { success: true, data: null } })
await articleApi.delete('art-001')
await articleApi.delete('art-001', 1)
expect(mockDelete).toHaveBeenCalledWith('/health/articles/art-001')
})

View File

@@ -60,7 +60,7 @@ describe('doctorApi', () => {
it('delete 应调用 DELETE /health/doctors/:id', async () => {
mockDelete.mockResolvedValue(undefined)
await doctorApi.delete('d-001')
await doctorApi.delete('d-001', 1)
expect(mockDelete).toHaveBeenCalledWith('/health/doctors/d-001')
})

View File

@@ -10,7 +10,7 @@ export interface MenuInfo {
visible: boolean;
menu_type: string;
permission?: string;
children: MenuInfo[];
children?: MenuInfo[];
version: number;
}