fix(web,miniprogram): 端到端测试修复 + 小程序接口字段对齐
## 前端修复 - 修复 9 个 TypeScript 编译错误(未使用变量/undefined 守卫/vitest 类型) - 重写 E2E auth fixture 使用真实 API 登录替代 mock token - 更新 E2E 测试选择器适配当前 UI 布局 - Playwright 改为串行执行避免 token 唯一约束冲突 - E2E 测试从 0/10 通过提升到 10/10 通过 ## 小程序接口一致性修复(P0-P3) - P0: consultation.ts type→consultation_type, unread_count→unread_count_patient - P0: followup.ts task_type→follow_up_type, due_date→planned_date, description→content_template - P1: appointment.ts calendarView 展平嵌套结构, available_count 计算 max-current - P1: doctor.ts HealthSummary 适配后台实际返回结构 - P2: doctor.ts PatientStats/ConsultationStats/FollowUpStats 字段名对齐 - P3: article.ts 新增 buildCategoryTree 工具函数
This commit is contained in:
@@ -493,7 +493,7 @@ export default function MainLayout({ children }: { children: React.ReactNode })
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip title={isDark ? '切换亮色模式' : '切换暗色模式'}>
|
||||
<div className="erp-header-btn" onClick={() => setTheme(isDark ? 'light' : 'dark')}>
|
||||
<div className="erp-header-btn" onClick={() => setTheme(isDark ? 'blue' : 'dark')}>
|
||||
{isDark ? <BulbFilled style={{ fontSize: 16 }} /> : <BulbOutlined style={{ fontSize: 16 }} />}
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function DetailDrawer({
|
||||
sections,
|
||||
allEntities,
|
||||
pluginId,
|
||||
entityName,
|
||||
entityName: _entityName,
|
||||
onClose,
|
||||
}: DetailDrawerProps) {
|
||||
if (!record) return null;
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
InfoCircleOutlined,
|
||||
ReloadOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import type { GraphNode } from './graph/graphTypes';
|
||||
import { getNodeDegree } from './graph/graphRenderer';
|
||||
import { getRelColor, getEdgeTypeLabel } from './graph/graphRenderer';
|
||||
import { useGraphData } from './PluginGraphPage/useGraphData';
|
||||
@@ -90,7 +89,7 @@ export function PluginGraphPage() {
|
||||
const onCanvasClick = useCallback(
|
||||
(e: React.MouseEvent<HTMLCanvasElement>) => {
|
||||
const result = handleCanvasClick(e);
|
||||
if (result.clicked) {
|
||||
if (result?.clicked) {
|
||||
setSelectedCenter((prev) => (prev === result.clicked ? null : result.clicked));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
getEdgeColor,
|
||||
NODE_HOVER_SCALE,
|
||||
getRelColor,
|
||||
getEdgeTypeLabel,
|
||||
getNodeDegree,
|
||||
degreeToRadius,
|
||||
drawCurvedEdge,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import { beforeAll, afterEach, afterAll } from 'vitest';
|
||||
import { server } from './mocks/server';
|
||||
|
||||
beforeAll(() => server.listen({ onUnhandledRequest: 'warn' }));
|
||||
|
||||
Reference in New Issue
Block a user