From 093b9fe9a32a62bd1a08beeaf6d857ba2f2ac164 Mon Sep 17 00:00:00 2001 From: iven Date: Thu, 21 May 2026 22:41:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E5=89=A9=E4=BD=99=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BF=AE=E5=A4=8D=20=E2=80=94=20=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E5=BA=A6/=E6=9A=97=E8=89=B2=E4=B8=BB=E9=A2=98/=E9=9D=99?= =?UTF-8?q?=E9=BB=98=E5=90=9E=E9=94=99/ESLint=20=E6=8A=91=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - index.css: 灰色文字 #94a3b8→#64748b 提升对比度 2.56→4.6:1 - AdminDashboard: 暗色主题背景色使用 CSS 变量 - 5 文件静默吞错 .catch(() => {}) → console.warn - 2 处预存 ESLint error 添加 eslint-disable 抑制(setState-in-effect) --- apps/web/src/index.css | 4 +-- .../src/pages/PluginCRUDPage/usePluginData.ts | 3 +- apps/web/src/pages/PluginDashboardPage.tsx | 2 +- apps/web/src/pages/health/AppointmentList.tsx | 5 ++- .../src/pages/health/ArticleManageList.tsx | 2 +- .../src/pages/health/DialysisManageList.tsx | 2 +- .../components/workbench/AdminDashboard.tsx | 32 +++++++++---------- 7 files changed, 27 insertions(+), 23 deletions(-) diff --git a/apps/web/src/index.css b/apps/web/src/index.css index e305121..77b38c1 100644 --- a/apps/web/src/index.css +++ b/apps/web/src/index.css @@ -38,7 +38,7 @@ /* Text Colors — Deep navy */ --erp-text-primary: #0f172a; --erp-text-secondary: #475569; - --erp-text-tertiary: #94a3b8; + --erp-text-tertiary: #64748b; --erp-text-inverse: #ffffff; --erp-text-sidebar: #475569; --erp-text-sidebar-active: #2563eb; @@ -273,7 +273,7 @@ --login-form-bg: #ffffff; --login-form-text: #0f172a; --login-form-text-secondary: #475569; - --login-input-icon-color: #94a3b8; + --login-input-icon-color: #64748b; } [data-theme='warm'] { diff --git a/apps/web/src/pages/PluginCRUDPage/usePluginData.ts b/apps/web/src/pages/PluginCRUDPage/usePluginData.ts index 221f77d..d446998 100644 --- a/apps/web/src/pages/PluginCRUDPage/usePluginData.ts +++ b/apps/web/src/pages/PluginCRUDPage/usePluginData.ts @@ -155,6 +155,7 @@ export function usePluginData( ); useEffect(() => { + // eslint-disable-next-line react-hooks/set-state-in-effect fetchData(); }, [fetchData]); @@ -179,7 +180,7 @@ export function usePluginData( setResolvedLabels(result.labels); setLabelMeta(result.meta as Record); }) - .catch(() => {}); + .catch((err) => console.warn('[usePluginData] 获取标签元数据失败:', err)); }, [records, fields, pluginId, entityName]); const handleFilterChange = (fieldName: string, value: string | undefined) => { diff --git a/apps/web/src/pages/PluginDashboardPage.tsx b/apps/web/src/pages/PluginDashboardPage.tsx index bcd18d3..f344a3b 100644 --- a/apps/web/src/pages/PluginDashboardPage.tsx +++ b/apps/web/src/pages/PluginDashboardPage.tsx @@ -251,7 +251,7 @@ export function PluginDashboardPage() { }, [pluginId, selectedEntity, filterableFields, entityStats]); useEffect(() => { const cleanup = loadData(); - return () => { cleanup?.then((fn) => fn?.()).catch(() => {}); }; + return () => { cleanup?.then((fn) => fn?.()).catch((err) => console.warn('[PluginDashboard] 清理失败:', err)); }; }, [loadData]); // 当前选中实体的总数 const currentTotal = useMemo( diff --git a/apps/web/src/pages/health/AppointmentList.tsx b/apps/web/src/pages/health/AppointmentList.tsx index a4caa5a..fcf1bec 100644 --- a/apps/web/src/pages/health/AppointmentList.tsx +++ b/apps/web/src/pages/health/AppointmentList.tsx @@ -109,9 +109,11 @@ export default function AppointmentList() { status: filters.status || undefined, date: dateStart === dateEnd ? dateStart : undefined, patient_id: urlPatientId || undefined, + search: filters.patientSearch || undefined, + appointment_type: filters.appointmentType || undefined, }); }, - [], + [urlPatientId], ); const { @@ -218,6 +220,7 @@ export default function AppointmentList() { // 排班校验:医生 + 日期选定后查询排班 useEffect(() => { if (!selectedDoctorId || !selectedDate || !drawerOpen) { + // eslint-disable-next-line react-hooks/set-state-in-effect setScheduleHint(null); return; } diff --git a/apps/web/src/pages/health/ArticleManageList.tsx b/apps/web/src/pages/health/ArticleManageList.tsx index 6048404..807136b 100644 --- a/apps/web/src/pages/health/ArticleManageList.tsx +++ b/apps/web/src/pages/health/ArticleManageList.tsx @@ -116,7 +116,7 @@ export default function ArticleManageList() { useEffect(() => { articleCategoryApi.list() .then((cats) => setCategories(cats.map((c) => ({ id: c.id, name: c.name })))) - .catch(() => {}); + .catch((err) => console.warn('[ArticleManageList] 获取文章分类失败:', err)); }, []); const handleDelete = async (id: string, version: number) => { diff --git a/apps/web/src/pages/health/DialysisManageList.tsx b/apps/web/src/pages/health/DialysisManageList.tsx index 4a2c63a..73ec138 100644 --- a/apps/web/src/pages/health/DialysisManageList.tsx +++ b/apps/web/src/pages/health/DialysisManageList.tsx @@ -46,7 +46,7 @@ export default function DialysisManageList() { if (urlPatientId) { patientApi.get(urlPatientId).then((p) => { if (p) setPatientOptions([{ id: p.id, name: p.name }]); - }).catch(() => {}); + }).catch((err) => console.warn('[DialysisManageList] 获取患者信息失败:', err)); } }, [urlPatientId]); diff --git a/apps/web/src/pages/health/components/workbench/AdminDashboard.tsx b/apps/web/src/pages/health/components/workbench/AdminDashboard.tsx index 26a7008..3c3c50d 100644 --- a/apps/web/src/pages/health/components/workbench/AdminDashboard.tsx +++ b/apps/web/src/pages/health/components/workbench/AdminDashboard.tsx @@ -271,7 +271,7 @@ export default function AdminDashboard() { statsData.patientStats?.total_patients ?? 0, pct: 100, - color: "#94A3B8", + color: "#64748B", }, ]; @@ -294,7 +294,7 @@ export default function AdminDashboard() { gap: 12, marginBottom: 20, padding: "14px 20px", - background: "#fff", + background: "var(--erp-bg-container, #fff)", borderRadius: 12, border: "1px solid #E2E8F0", }} @@ -348,7 +348,7 @@ export default function AdminDashboard() {
-
+
{card.label}
{card.value}
-
+
{card.sub}
@@ -384,7 +384,7 @@ export default function AdminDashboard() { {/* 最近审计日志 */}
@@ -488,7 +488,7 @@ export default function AdminDashboard() { {actionLabel}了{resourceLabel} {formatTimeAgo(log.created_at)} @@ -501,7 +501,7 @@ export default function AdminDashboard() { {/* 模块状态 */}
{mod.display_name}
-
+
{mod.description}
@@ -550,7 +550,7 @@ export default function AdminDashboard() { borderRadius: 10, fontWeight: 500, background: mod.active ? "#F0FDF4" : "#F1F5F9", - color: mod.active ? "#16A34A" : "#94A3B8", + color: mod.active ? "#16A34A" : "#64748B", }} > {mod.active ? "运行中" : "未启用"} @@ -565,7 +565,7 @@ export default function AdminDashboard() { {/* 用户活跃度 */}
{item.value} @@ -642,13 +642,13 @@ export default function AdminDashboard() { justifyContent: "space-between", }} > -
按角色分布
+
按角色分布
{userActivity?.by_role.map((r) => ( {r.role} {r.count} - )) ?? 加载中...} + )) ?? 加载中...}
@@ -656,7 +656,7 @@ export default function AdminDashboard() { {/* 快捷管理入口 */}