From b72765695d6aefbc4697db574aa5996cc2ec5da6 Mon Sep 17 00:00:00 2001 From: xianyi Date: Thu, 18 Dec 2025 11:41:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=93=E6=A3=80=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8=E7=A9=BA=E6=95=B0=E6=8D=AE=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/exam/ExamSection.tsx | 183 +++++++++++++++------------- src/pages/ExamPage.tsx | 18 ++- 2 files changed, 103 insertions(+), 98 deletions(-) diff --git a/src/components/exam/ExamSection.tsx b/src/components/exam/ExamSection.tsx index bb41285..aa5580a 100644 --- a/src/components/exam/ExamSection.tsx +++ b/src/components/exam/ExamSection.tsx @@ -8,7 +8,7 @@ import { cls } from '../../utils/cls'; interface ExamSectionProps { filteredClients: ExamClient[]; - selectedExamClient: ExamClient; + selectedExamClient: ExamClient | undefined; examFilterTag: (typeof EXAM_TAGS)[number]; onFilterChange: (tag: (typeof EXAM_TAGS)[number]) => void; onOpenModal: (id: string, tab: ExamModalTab) => void; @@ -76,97 +76,104 @@ export const ExamSection = ({ -
- {filteredClients.map((client) => { - // 检查操作记录:优先使用 localStorage 记录,如果没有则使用原有逻辑 - const idCardSignInDone = isExamActionDone(client.id, 'idCardSignIn'); - const printSignDone = isExamActionDone(client.id, 'printSign'); + {filteredClients.length === 0 ? ( +
+
暂无体检客户数据
+
请尝试调整筛选条件或搜索关键词
+
+ ) : ( +
+ {filteredClients.map((client) => { + // 检查操作记录:优先使用 localStorage 记录,如果没有则使用原有逻辑 + const idCardSignInDone = isExamActionDone(client.id, 'idCardSignIn'); + const printSignDone = isExamActionDone(client.id, 'printSign'); - const signDone = idCardSignInDone || client.signStatus === '已登记' || client.checkedItems.includes('签到'); - const addonCount = client.addonCount || 0; - const printDone = printSignDone || !!client.guidePrinted; - const openModal = (tab: ExamModalTab) => onOpenModal(client.id, tab); + const signDone = idCardSignInDone || client.signStatus === '已登记' || client.checkedItems.includes('签到'); + const addonCount = client.addonCount || 0; + const printDone = printSignDone || !!client.guidePrinted; + const openModal = (tab: ExamModalTab) => onOpenModal(client.id, tab); - return ( -
openModal('detail')} - className={cls( - 'text-left p-3 rounded-2xl border bg-white hover:bg-gray-50 flex flex-col gap-1 cursor-pointer', - selectedExamClient.id === client.id && 'border-gray-900 bg-gray-50', - )} - > -
- {client.name} - {client.level} -
-
套餐:{client.packageName}
-
- 状态:{client.status} - 已耗时:{client.elapsed} -
-
- - - - - + return ( +
openModal('detail')} + className={cls( + 'text-left p-3 rounded-2xl border bg-white hover:bg-gray-50 flex flex-col gap-1 cursor-pointer', + selectedExamClient?.id === client.id && 'border-gray-900 bg-gray-50', + )} + > +
+ {client.name} + {client.level} +
+
套餐:{client.packageName}
+
+ 状态:{client.status} + 已耗时:{client.elapsed} +
+
+ + + + + +
-
- ); - })} -
+ ); + })} +
+ )}
diff --git a/src/pages/ExamPage.tsx b/src/pages/ExamPage.tsx index 648c94a..7beb065 100644 --- a/src/pages/ExamPage.tsx +++ b/src/pages/ExamPage.tsx @@ -112,17 +112,15 @@ export const ExamPage = () => { return ( <> - {selectedExamClient && ( - - )} + - {examModalOpen && ( + {examModalOpen && selectedExamClient && (