From 7f30b571515e86b5e17fc3b2afe0efafaeb2cd99 Mon Sep 17 00:00:00 2001 From: liuyiliang Date: Thu, 27 Mar 2025 17:18:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/examination/package.json | 1 + packages/examination/src/style/common.css | 21 +- packages/examination/src/utils/exportPdf.js | 4 +- .../compoents/ExamDetailAnalysisPage.tsx | 111 +++---- .../exam-online/compoents/ExamEditPage.tsx | 253 +++++++-------- .../exam-online/compoents/ExamListPage.tsx | 87 +++-- .../compoents/ExamPaperAnalysisPage.tsx | 80 ++--- .../compoents/ExamStatisticsPage.tsx | 20 +- .../src/views/statistical/enterpriseFile.tsx | 305 ++++++++++-------- 9 files changed, 467 insertions(+), 415 deletions(-) diff --git a/packages/examination/package.json b/packages/examination/package.json index 74698e2..a0578df 100644 --- a/packages/examination/package.json +++ b/packages/examination/package.json @@ -22,6 +22,7 @@ "process": "^0.11.10", "quill-emoji": "^0.2.0", "react": "^17.0.0", + "react-countup": "^6.5.3", "react-dom": "^17.0.0", "react-qrcode-logo": "^3.0.0", "react-quill": "^1.3.5", diff --git a/packages/examination/src/style/common.css b/packages/examination/src/style/common.css index 2f7a5a2..33d3788 100644 --- a/packages/examination/src/style/common.css +++ b/packages/examination/src/style/common.css @@ -93,7 +93,7 @@ body { .special-class .ant-table-body{ max-height: max-content !important; - overflow-y: hidden !important; + /*overflow-y: hidden !important;*/ } .left{ @@ -133,6 +133,18 @@ body { font-weight: 600; } +.ant-descriptions-header { + color: #323232; + margin-bottom: 15px; + border-left: 4px solid #7ea0f9; + padding-left: 10px; +} + +.ant-descriptions-header .ant-descriptions-title { + font-size: medium; + font-weight: 600; +} + .list-filter { position: relative; margin: 0; @@ -385,4 +397,11 @@ table.ikd-input-table { .ant-btn-dangerous { color: #ff4d4f !important; border-color: #ff4d4f !important; +} +.form_item_no_check label { + margin-left: 10px; +} +.main-customer-htm { + border: 1px solid #f1f3ff; + border-radius: 5px; } \ No newline at end of file diff --git a/packages/examination/src/utils/exportPdf.js b/packages/examination/src/utils/exportPdf.js index 11ef571..ee70b42 100644 --- a/packages/examination/src/utils/exportPdf.js +++ b/packages/examination/src/utils/exportPdf.js @@ -10,7 +10,7 @@ export const downPdf = (title,className) => { var mapIndex = index; html2canvas(elements[index], { useCORS: true, // 是否允许网页中img元素跨域,这个设置需要img元素支持及服务器支持 - scale: 1, // 这个影响生成图片的清晰度 + // scale: 1, // 这个影响生成图片的清晰度 // background: "#F5F5F5" //背景 }).then((canvas) => { var img = new Image(); @@ -34,9 +34,9 @@ export const downPdf = (title,className) => { // 所有图片添加完毕,保存 pdf.save(title+".pdf"); } + return true; }); }; - return true; }); } diff --git a/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx index b291093..54e6bae 100644 --- a/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx +++ b/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx @@ -167,60 +167,62 @@ const ExamDetailAnalysisPage: React.FC = () => { }); return ( -
- {/* 检索条件行 */} - - - 考试名称: - setExamName(e.target.value)} - style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 - /> - - - 试卷名称: - setPaperName(e.target.value)} - style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 - /> - - - 考试区域: - setExamArea(convertArrToRegion(values))} - style={{ width: 'calc(100% - 100px)' }} // 调整级联选择器宽度 - /> - - - 监管行业: - - - - - - - - - - {/* 表格 */} +
+
+
+ + + 考试名称: + setExamName(e.target.value)} + style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 + /> + + + 试卷名称: + setPaperName(e.target.value)} + style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 + /> + + + 考试区域: + setExamArea(convertArrToRegion(values))} + style={{ width: 'calc(100% - 100px)' }} // 调整级联选择器宽度 + /> + + + 监管行业: + + + + + + + + + +
+
{ onChange={handleTableChange} style={{ marginTop: 20 }} /> - = (props) => { const formattedValues = { ...otherValues, id:values.examId, + industryId: values.regulatedIndustry, examRegion: formattedRegion, validFrom: formattedValidFrom, validTo: formattedValidTo @@ -215,9 +216,7 @@ const ExamBasicInfoForm: React.FC = (props) => { setPaperOptions(allPaperOptions); } else { const filteredPapers = allPaperOptions.filter(paper => String(paper.regulatedIndustry) === String(value)); - if (filteredPapers.length > 0) { - setPaperOptions(filteredPapers); - } + setPaperOptions(filteredPapers); } // @ts-ignore @@ -239,135 +238,137 @@ const ExamBasicInfoForm: React.FC = (props) => { const validateValidTo = (rule: Rule, value: Moment | null) => { const validFrom = formRef.current?.getFieldValue('validFrom'); if (validFrom && value && value.isBefore(validFrom)) { - return Promise.reject(new Error('考试失效时间不得小于考试有效时间')); + return Promise.reject(new Error('考试失效日期不得小于考试有效日期')); } return Promise.resolve(); }; return ( -
-

考试基本信息

-
- {/* 隐藏的 examId 输入框 */} - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
考试基本信息
+ - - - -
- - - -
-
- + {/* 隐藏的 examId 输入框 */} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ +
); }; diff --git a/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx index 0617c46..786b8ed 100644 --- a/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx +++ b/packages/examination/src/views/exam-online/compoents/ExamListPage.tsx @@ -107,11 +107,12 @@ const ExamListPage = ({ history }: { history: any }) => { title: '确认删除', content: '你确定要删除这些选中的考试吗?', onOk: () => { - const res = doDelete(ids); - if (!res) { - return; - } - research(); + doDelete(ids).then(res => { + if (!res) { + return; + } + research(); + }).catch(() => { }) }, onCancel: () => { }, @@ -142,11 +143,12 @@ const ExamListPage = ({ history }: { history: any }) => { const validIds = validExams.map(exam => String(exam.examId)); if (validIds.length > 0) { - const res = doCancel(validIds); - if (!res) { - return; - } - research(); + doCancel(validIds).then(res => { + if (!res) { + return; + } + research(); + }).catch(() => { }) } }, onCancel: () => { @@ -178,11 +180,12 @@ const ExamListPage = ({ history }: { history: any }) => { const validIds = validExams.map(exam => String(exam.examId)); if (validIds.length > 0) { - const res = doPublish(validIds); - if (!res) { - return; - } - research(); + doPublish(validIds).then(res => { + if (!res) { + return; + } + research(); + }).catch(() => { }) } }, onCancel: () => { @@ -238,11 +241,12 @@ const ExamListPage = ({ history }: { history: any }) => { content: '你确定要发布这个考试吗?', onOk: () => { const ids = [String(examId)]; - const res = doPublish(ids); - if (!res) { - return; - } - research(); + doPublish(ids).then(res => { + if (!res) { + return; + } + research(); + }).catch(() => { }) }, onCancel: () => { }, @@ -256,11 +260,12 @@ const ExamListPage = ({ history }: { history: any }) => { content: '你确定要撤回这个考试吗?', onOk: () => { const ids = [String(examId)]; - const res = doCancel(ids); - if (!res) { - return; - } - research(); + doCancel(ids).then(res => { + if (!res) { + return; + } + research(); + }).catch(() => { }) }, onCancel: () => { }, @@ -274,11 +279,12 @@ const ExamListPage = ({ history }: { history: any }) => { content: '你确定要删除这个考试吗?', onOk: () => { const ids = [String(examId)]; - const res = doDelete(ids); - if (!res) { - return; - } - research(); + doDelete(ids).then(res => { + if (!res) { + return; + } + research(); + }).catch(() => { }) }, onCancel: () => { }, @@ -363,7 +369,7 @@ const ExamListPage = ({ history }: { history: any }) => { key: 'validFrom', }, { - title: '考试无效日期', + title: '考试失效日期', dataIndex: 'validTo', key: 'validTo', }, @@ -395,7 +401,7 @@ const ExamListPage = ({ history }: { history: any }) => { render: (cellValue: number, record: Exam) => ( handleEdit(record.examId)}>编辑 - {record.publishStatus === 1 ? ( + {record.publishStatus === 1 && ( { if (record.publishStatus !== 1) { e.preventDefault(); @@ -405,21 +411,12 @@ const ExamListPage = ({ history }: { history: any }) => { }} > 生成考试码 - ) : ( - 生成考试码 - )} - {/* {*/} - {/* handleGenerateQrCode(record);*/} - {/*}}*/} - {/*>*/} - {/* 生成考试码*/} - {/**/} - {record.publishStatus === 0 ? ( + )} + {record.publishStatus === 0 || record.publishStatus === 2 && ( handlePublishSingle(record.examId)}>发布 - ) : record.publishStatus === 1 ? ( + )} + {record.publishStatus === 1 && ( handleWithdrawSingle(record.examId)}>撤回 - ) : ( - 撤回 )} handleDeleteSingle(record.examId)}>删除 diff --git a/packages/examination/src/views/exam-online/compoents/ExamPaperAnalysisPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamPaperAnalysisPage.tsx index 77f38e4..214eb73 100644 --- a/packages/examination/src/views/exam-online/compoents/ExamPaperAnalysisPage.tsx +++ b/packages/examination/src/views/exam-online/compoents/ExamPaperAnalysisPage.tsx @@ -141,48 +141,50 @@ const ExamPaperAnalysisPage: React.FC = ({history}) => { ]; return ( -
- {/* 检索条件行 */} - -
- 试卷名称: - setPaperName(e.target.value)} - style={{ width: 'calc(100% - 100px)' }} - /> - - - 监管行业: - - - - - - - - - - {/* 试卷数量行 */} +
+
+
+ +
+ 试卷名称: + setPaperName(e.target.value)} + style={{ width: 300 }} + /> + + + 监管行业: + + + + + + + + + + +
总计 - {totalCount} + {totalCount}
@@ -191,7 +193,7 @@ const ExamPaperAnalysisPage: React.FC = ({history}) => {
已使用 - {usedCount} + {usedCount}
@@ -200,7 +202,7 @@ const ExamPaperAnalysisPage: React.FC = ({history}) => {
停用 - {disabledCount} + {disabledCount}
diff --git a/packages/examination/src/views/exam-online/compoents/ExamStatisticsPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamStatisticsPage.tsx index 7b30fcc..a4ff096 100644 --- a/packages/examination/src/views/exam-online/compoents/ExamStatisticsPage.tsx +++ b/packages/examination/src/views/exam-online/compoents/ExamStatisticsPage.tsx @@ -1,10 +1,10 @@ +import CountUp from 'react-countup'; import React, { useEffect, useState, useRef } from 'react'; import { Row, Col, Select, Table, Card } from 'antd'; import ReactECharts from 'echarts-for-react'; import {examStatisticsChange, examStatisticsInit, getIndustryList} from "api/exam-online/index"; // 修改接口为获取带详情的试卷列表 import { Link } from 'react-router-dom'; const { Option } = Select; - const examTableColumns = [ { title: '考试次数', @@ -214,17 +214,29 @@ const Dashboard: React.FC = () => {
-
试题{questionCount}
+
试题 + + + 条 +
-
试卷{paperCount}
+
试卷 + + + 套 +
-
考试{examCount}
+
考试 + + + 次 +
diff --git a/packages/examination/src/views/statistical/enterpriseFile.tsx b/packages/examination/src/views/statistical/enterpriseFile.tsx index deb1f3b..a89d033 100644 --- a/packages/examination/src/views/statistical/enterpriseFile.tsx +++ b/packages/examination/src/views/statistical/enterpriseFile.tsx @@ -356,8 +356,8 @@ const EnterpriseFile: React.FC = ({ customer }) => { const columnsHivePolicyInnerCoInsurer = [ { title: '联保机构', - dataIndex: 'innerCoOrgCode', - key: 'innerCoOrgCode', + dataIndex: 'orgName', + key: 'orgName', }, { title: '联保份额', @@ -475,18 +475,24 @@ const EnterpriseFile: React.FC = ({ customer }) => { }, ]; const handleCapture = () => { - setLoading(true); setDownloadStat(true); - setTimeout(function () { - downPdf("企业档案", "main-customer-htm").then(() => { - console.log("PDF已经生成并保存!"); - }).catch((error: any) => { - console.error("生成PDF时发生错误: ", error); - }); - setLoading(false); - setDownloadStat(false); + setLoading(true); + setTimeout(() => { + downPdf("企业档案", "main-customer-htm") + .then(() => { + console.log("PDF已经生成并保存!"); + setLoading(false); + setDownloadStat(false); + }) + .catch((error: any) => { + console.error("生成PDF时发生错误: ", error); + setLoading(false); + setDownloadStat(false); + }); }, 7000); - } + // }, 200); + }; + return (
@@ -506,145 +512,158 @@ const EnterpriseFile: React.FC = ({ customer }) => { textAlign: 'center', display: 'flex', alignItems: 'center' - }}>企业档案
+ }}>{customer.customerName}企业档案
- - {items.map(item => ( - - {item.children} - - ))} - -
-
-
保单信息
-
- {items2.map(pItem => ( -
-
基本信息
- - {pItem.baseData.map((item: { label: string, key: string, children: string }) => ( - - {item.children} - - ))} +
+
+ + {items.map(item => ( + + {item.children} + + ))} -
责任条款
-
-
-
联保信息
-
-
- ))} -
-
-
理赔记录
- {items3.map((item3, index) => ( -
- {(index === 0 || item3[0].children !== items3[index - 1][0].children) && ( -
- 保单号: {item3[0].children} +
+
+
+
保单信息
+
+ {items2.map(pItem => ( +
+
基本信息
+ + {pItem.baseData.map((item: { label: string, key: string, children: string }) => ( + + {item.children} + + ))} + +
责任条款
+
+
+
联保信息
+
+
- )} -
基本信息
- - {item3.slice(1, 4).map(tim => ( - - {tim.children} - - ))} - -
定损信息
- - {item3.slice(5, 13).map(tim => ( - - {tim.children} - - ))} - -
赔付信息
- - {item3.slice(14, 24).map(tim => ( - - {tim.children} - - ))} - + ))} - ))} -
-
-
服务记录
- {items4.map((item4, index) => ( -
-
保单号: {item4.policyNumber}
-
事故预防服务
-
-
-
风险辨识
-
-
-
隐患排查
-
+
+
+
+
理赔记录
+
+ {items3.map((item3, index) => ( +
+ {(index === 0 || item3[0].children !== items3[index - 1][0].children) && ( +
+ 保单号: {item3[0].children} +
+ )} +
基本信息
+ + {item3.slice(1, 4).map(tim => ( + + {tim.children} + + ))} + +
定损信息
+ + {item3.slice(5, 13).map(tim => ( + + {tim.children} + + ))} + +
赔付信息
+ + {item3.slice(14, 24).map(tim => ( + + {tim.children} + + ))} + +
+ ))}
- ))} +
+
+
+
+
服务记录
+
+ {items4.map((item4, index) => ( +
+
保单号: {item4.policyNumber}
+
事故预防服务
+
+
+
风险辨识
+
+
+
隐患排查
+
+ + ))} + +