样式调整

main
liuyiliang 3 months ago
parent 90bad9816a
commit 7f30b57151
  1. 1
      packages/examination/package.json
  2. 21
      packages/examination/src/style/common.css
  3. 4
      packages/examination/src/utils/exportPdf.js
  4. 111
      packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx
  5. 253
      packages/examination/src/views/exam-online/compoents/ExamEditPage.tsx
  6. 87
      packages/examination/src/views/exam-online/compoents/ExamListPage.tsx
  7. 80
      packages/examination/src/views/exam-online/compoents/ExamPaperAnalysisPage.tsx
  8. 20
      packages/examination/src/views/exam-online/compoents/ExamStatisticsPage.tsx
  9. 305
      packages/examination/src/views/statistical/enterpriseFile.tsx

@ -22,6 +22,7 @@
"process": "^0.11.10", "process": "^0.11.10",
"quill-emoji": "^0.2.0", "quill-emoji": "^0.2.0",
"react": "^17.0.0", "react": "^17.0.0",
"react-countup": "^6.5.3",
"react-dom": "^17.0.0", "react-dom": "^17.0.0",
"react-qrcode-logo": "^3.0.0", "react-qrcode-logo": "^3.0.0",
"react-quill": "^1.3.5", "react-quill": "^1.3.5",

@ -93,7 +93,7 @@ body {
.special-class .ant-table-body{ .special-class .ant-table-body{
max-height: max-content !important; max-height: max-content !important;
overflow-y: hidden !important; /*overflow-y: hidden !important;*/
} }
.left{ .left{
@ -133,6 +133,18 @@ body {
font-weight: 600; 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 { .list-filter {
position: relative; position: relative;
margin: 0; margin: 0;
@ -386,3 +398,10 @@ table.ikd-input-table {
color: #ff4d4f !important; color: #ff4d4f !important;
border-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;
}

@ -10,7 +10,7 @@ export const downPdf = (title,className) => {
var mapIndex = index; var mapIndex = index;
html2canvas(elements[index], { html2canvas(elements[index], {
useCORS: true, // 是否允许网页中img元素跨域,这个设置需要img元素支持及服务器支持 useCORS: true, // 是否允许网页中img元素跨域,这个设置需要img元素支持及服务器支持
scale: 1, // 这个影响生成图片的清晰度 // scale: 1, // 这个影响生成图片的清晰度
// background: "#F5F5F5" //背景 // background: "#F5F5F5" //背景
}).then((canvas) => { }).then((canvas) => {
var img = new Image(); var img = new Image();
@ -34,9 +34,9 @@ export const downPdf = (title,className) => {
// 所有图片添加完毕,保存 // 所有图片添加完毕,保存
pdf.save(title+".pdf"); pdf.save(title+".pdf");
} }
return true;
}); });
}; };
return true;
}); });
} }

@ -167,60 +167,62 @@ const ExamDetailAnalysisPage: React.FC = () => {
}); });
return ( return (
<div style={{ padding: 20 }}> <div>
{/* 检索条件行 */} <div className="header-filter">
<Row gutter={16}> <div className="list-filter" style={{display: 'flex', padding: 15}}>
<Col span={5}> <Row gutter={16}>
<span style={{ marginRight: 8 }}>:</span> <Col span={5}>
<Input <span style={{ marginRight: 8 }}>:</span>
placeholder="考试名称" <Input
value={examName} placeholder="考试名称"
onChange={(e) => setExamName(e.target.value)} value={examName}
style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 onChange={(e) => setExamName(e.target.value)}
/> style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度
</Col> />
<Col span={5}> </Col>
<span style={{ marginRight: 8 }}>:</span> <Col span={5}>
<Input <span style={{ marginRight: 8 }}>:</span>
placeholder="试卷名称" <Input
value={paperName} placeholder="试卷名称"
onChange={(e) => setPaperName(e.target.value)} value={paperName}
style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 onChange={(e) => setPaperName(e.target.value)}
/> style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度
</Col> />
<Col span={5}> </Col>
<span style={{ marginRight: 8 }}>:</span> <Col span={5}>
<Cascader <span style={{ marginRight: 8 }}>:</span>
options={convertToCascaderData()} <Cascader
placeholder="请选择考试区域" options={convertToCascaderData()}
onChange={(values) => setExamArea(convertArrToRegion(values))} placeholder="请选择考试区域"
style={{ width: 'calc(100% - 100px)' }} // 调整级联选择器宽度 onChange={(values) => setExamArea(convertArrToRegion(values))}
/> style={{ width: 'calc(100% - 100px)' }} // 调整级联选择器宽度
</Col> />
<Col span={5}> </Col>
<span style={{ marginRight: 8 }}>:</span> <Col span={5}>
<Select <span style={{ marginRight: 8 }}>:</span>
placeholder="监管行业" <Select
value={industry} placeholder="监管行业"
onChange={(value) => setIndustry(value)} value={industry}
style={{ width: 150 }} // 调整下拉框宽度 onChange={(value) => setIndustry(value)}
> style={{ width: 150 }} // 调整下拉框宽度
<Option key="" value=""></Option> >
{industryOptions.map((option) => ( <Option key="" value=""></Option>
<Option key={option.value} value={option.value}> {industryOptions.map((option) => (
{option.label} <Option key={option.value} value={option.value}>
</Option> {option.label}
))} </Option>
</Select> ))}
</Col> </Select>
<Col span={4}> </Col>
<Space> <Col span={4}>
<Button onClick={handleReset}></Button> <Space>
<Button type="primary" onClick={handleSearch}></Button> <Button onClick={handleReset}></Button>
</Space> <Button type="primary" onClick={handleSearch}></Button>
</Col> </Space>
</Row> </Col>
{/* 表格 */} </Row>
</div>
</div>
<Table <Table
columns={columns} columns={columns}
dataSource={tableData} dataSource={tableData}
@ -230,7 +232,6 @@ const ExamDetailAnalysisPage: React.FC = () => {
onChange={handleTableChange} onChange={handleTableChange}
style={{ marginTop: 20 }} style={{ marginTop: 20 }}
/> />
<Modal <Modal
title="成绩分布" title="成绩分布"
visible={visible} visible={visible}

@ -102,6 +102,7 @@ const ExamBasicInfoForm: React.FC<PropsWithRouter> = (props) => {
const formattedValues = { const formattedValues = {
...otherValues, ...otherValues,
id:values.examId, id:values.examId,
industryId: values.regulatedIndustry,
examRegion: formattedRegion, examRegion: formattedRegion,
validFrom: formattedValidFrom, validFrom: formattedValidFrom,
validTo: formattedValidTo validTo: formattedValidTo
@ -215,9 +216,7 @@ const ExamBasicInfoForm: React.FC<PropsWithRouter> = (props) => {
setPaperOptions(allPaperOptions); setPaperOptions(allPaperOptions);
} else { } else {
const filteredPapers = allPaperOptions.filter(paper => String(paper.regulatedIndustry) === String(value)); const filteredPapers = allPaperOptions.filter(paper => String(paper.regulatedIndustry) === String(value));
if (filteredPapers.length > 0) { setPaperOptions(filteredPapers);
setPaperOptions(filteredPapers);
}
} }
// @ts-ignore // @ts-ignore
@ -239,135 +238,137 @@ const ExamBasicInfoForm: React.FC<PropsWithRouter> = (props) => {
const validateValidTo = (rule: Rule, value: Moment | null) => { const validateValidTo = (rule: Rule, value: Moment | null) => {
const validFrom = formRef.current?.getFieldValue('validFrom'); const validFrom = formRef.current?.getFieldValue('validFrom');
if (validFrom && value && value.isBefore(validFrom)) { if (validFrom && value && value.isBefore(validFrom)) {
return Promise.reject(new Error('考试失效时间不得小于考试有效时间')); return Promise.reject(new Error('考试失效日期不得小于考试有效日期'));
} }
return Promise.resolve(); return Promise.resolve();
}; };
return ( return (
<div> <div className="header-filter">
<h1></h1> <div className="list-filter" style={{padding: 15}}>
<Form <div className="ikd-page-header"><div className="title"></div></div>
ref={formRef} <Form
{...props} ref={formRef}
name="examBasicInfo" {...props}
onFinish={onFinish} name="examBasicInfo"
autoComplete="off" onFinish={onFinish}
labelCol={labelCol} autoComplete="off"
wrapperCol={wrapperCol} labelCol={labelCol}
> wrapperCol={wrapperCol}
{/* 隐藏的 examId 输入框 */}
<Form.Item name="examId" style={{ display: 'none' }}>
<Input />
</Form.Item>
<Form.Item
label="考试名称"
name="examName"
rules={[
{
required: true,
message: '请输入考试名称',
},
]}
>
<Input />
</Form.Item>
<Form.Item
label="监管行业"
name="regulatedIndustry"
rules={[
{
required: true,
message: '请选择监管行业',
},
]}
>
<Select placeholder="请选择监管行业" onChange={handleIndustryChange}>
{industryOptions.map(option => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item>
<Form.Item
label="试卷名称"
name="paperId"
rules={[
{
required: true,
message: '请选择试卷名称',
},
]}
>
<Select placeholder="请选择试卷名称" onChange={handlePaperChange}>
{paperOptions.map(option => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item>
<Form.Item label="考试分值" name="examScore">
<Input disabled />
</Form.Item>
<Form.Item label="考试时长" name="examDuration">
<Input disabled />
</Form.Item>
<Form.Item
label="考试区域"
name="examRegion"
rules={[
{
required: true,
message: '请选择考试区域',
},
]}
>
<Cascader
options={convertToCascaderData()}
placeholder="请选择考试区域"
/>
</Form.Item>
<Form.Item
label="考试有效时间"
name="validFrom"
rules={[
{
required: true,
message: '请选择考试有效时间',
},
]}
>
<DatePicker />
</Form.Item>
<Form.Item
label="考试失效时间"
name="validTo"
rules={[
{
required: true,
message: '请选择考试失效时间',
},
{ validator: validateValidTo }
]}
>
<DatePicker />
</Form.Item>
<Form.Item
label="内容描述"
name="remark"
> >
<Input.TextArea rows={4} maxLength={200} showCount/> {/* 隐藏的 examId 输入框 */}
</Form.Item> <Form.Item name="examId" style={{ display: 'none' }}>
<Form.Item wrapperCol={{ ...wrapperCol, offset: labelCol.span }}> <Input />
<div style={{ textAlign: "right" }}> </Form.Item>
<Button type="default" onClick={onCancel}></Button> <Form.Item
<span style={{ marginRight: 20 }} /> label="考试名称"
<Button type="primary" onClick={handleSubmit}></Button> name="examName"
</div> rules={[
</Form.Item> {
</Form> required: true,
message: '请输入考试名称',
},
]}
>
<Input />
</Form.Item>
<Form.Item
label="监管行业"
name="regulatedIndustry"
rules={[
{
required: true,
message: '请选择监管行业',
},
]}
>
<Select placeholder="请选择监管行业" onChange={handleIndustryChange}>
{industryOptions.map(option => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item>
<Form.Item
label="试卷名称"
name="paperId"
rules={[
{
required: true,
message: '请选择试卷名称',
},
]}
>
<Select placeholder="请选择试卷名称" onChange={handlePaperChange}>
{paperOptions.map(option => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item>
<Form.Item label="考试分值" name="examScore" className="form_item_no_check">
<Input disabled />
</Form.Item>
<Form.Item label="考试时长" name="examDuration" className="form_item_no_check">
<Input disabled />
</Form.Item>
<Form.Item
label="考试区域"
name="examRegion"
rules={[
{
required: true,
message: '请选择考试区域',
},
]}
>
<Cascader
options={convertToCascaderData()}
placeholder="请选择考试区域"
/>
</Form.Item>
<Form.Item
label="考试有效日期"
name="validFrom"
rules={[
{
required: true,
message: '请选择考试有效日期',
},
]}
>
<DatePicker />
</Form.Item>
<Form.Item
label="考试失效时间"
name="validTo"
rules={[
{
required: true,
message: '请选择考试失效时间',
},
{ validator: validateValidTo }
]}
>
<DatePicker />
</Form.Item>
<Form.Item
label="内容描述"
name="remark"
className="form_item_no_check">
<Input.TextArea rows={4} maxLength={200} showCount/>
</Form.Item>
<Form.Item wrapperCol={{ ...wrapperCol, offset: labelCol.span }}>
<div style={{ textAlign: "right" }}>
<Button type="default" onClick={onCancel}></Button>
<span style={{ marginRight: 20 }} />
<Button type="primary" onClick={handleSubmit}></Button>
</div>
</Form.Item>
</Form>
</div>
</div> </div>
); );
}; };

@ -107,11 +107,12 @@ const ExamListPage = ({ history }: { history: any }) => {
title: '确认删除', title: '确认删除',
content: '你确定要删除这些选中的考试吗?', content: '你确定要删除这些选中的考试吗?',
onOk: () => { onOk: () => {
const res = doDelete(ids); doDelete(ids).then(res => {
if (!res) { if (!res) {
return; return;
} }
research(); research();
}).catch(() => { })
}, },
onCancel: () => { onCancel: () => {
}, },
@ -142,11 +143,12 @@ const ExamListPage = ({ history }: { history: any }) => {
const validIds = validExams.map(exam => String(exam.examId)); const validIds = validExams.map(exam => String(exam.examId));
if (validIds.length > 0) { if (validIds.length > 0) {
const res = doCancel(validIds); doCancel(validIds).then(res => {
if (!res) { if (!res) {
return; return;
} }
research(); research();
}).catch(() => { })
} }
}, },
onCancel: () => { onCancel: () => {
@ -178,11 +180,12 @@ const ExamListPage = ({ history }: { history: any }) => {
const validIds = validExams.map(exam => String(exam.examId)); const validIds = validExams.map(exam => String(exam.examId));
if (validIds.length > 0) { if (validIds.length > 0) {
const res = doPublish(validIds); doPublish(validIds).then(res => {
if (!res) { if (!res) {
return; return;
} }
research(); research();
}).catch(() => { })
} }
}, },
onCancel: () => { onCancel: () => {
@ -238,11 +241,12 @@ const ExamListPage = ({ history }: { history: any }) => {
content: '你确定要发布这个考试吗?', content: '你确定要发布这个考试吗?',
onOk: () => { onOk: () => {
const ids = [String(examId)]; const ids = [String(examId)];
const res = doPublish(ids); doPublish(ids).then(res => {
if (!res) { if (!res) {
return; return;
} }
research(); research();
}).catch(() => { })
}, },
onCancel: () => { onCancel: () => {
}, },
@ -256,11 +260,12 @@ const ExamListPage = ({ history }: { history: any }) => {
content: '你确定要撤回这个考试吗?', content: '你确定要撤回这个考试吗?',
onOk: () => { onOk: () => {
const ids = [String(examId)]; const ids = [String(examId)];
const res = doCancel(ids); doCancel(ids).then(res => {
if (!res) { if (!res) {
return; return;
} }
research(); research();
}).catch(() => { })
}, },
onCancel: () => { onCancel: () => {
}, },
@ -274,11 +279,12 @@ const ExamListPage = ({ history }: { history: any }) => {
content: '你确定要删除这个考试吗?', content: '你确定要删除这个考试吗?',
onOk: () => { onOk: () => {
const ids = [String(examId)]; const ids = [String(examId)];
const res = doDelete(ids); doDelete(ids).then(res => {
if (!res) { if (!res) {
return; return;
} }
research(); research();
}).catch(() => { })
}, },
onCancel: () => { onCancel: () => {
}, },
@ -363,7 +369,7 @@ const ExamListPage = ({ history }: { history: any }) => {
key: 'validFrom', key: 'validFrom',
}, },
{ {
title: '考试效日期', title: '考试效日期',
dataIndex: 'validTo', dataIndex: 'validTo',
key: 'validTo', key: 'validTo',
}, },
@ -395,7 +401,7 @@ const ExamListPage = ({ history }: { history: any }) => {
render: (cellValue: number, record: Exam) => ( render: (cellValue: number, record: Exam) => (
<Space size="middle"> <Space size="middle">
<a onClick={() => handleEdit(record.examId)}></a> <a onClick={() => handleEdit(record.examId)}></a>
{record.publishStatus === 1 ? ( {record.publishStatus === 1 && (
<a onClick={(e) => { <a onClick={(e) => {
if (record.publishStatus !== 1) { if (record.publishStatus !== 1) {
e.preventDefault(); e.preventDefault();
@ -405,21 +411,12 @@ const ExamListPage = ({ history }: { history: any }) => {
}} }}
> >
</a>) : ( </a>)}
<span style={{ color: 'gray' }} ></span> {record.publishStatus === 0 || record.publishStatus === 2 && (
)}
{/*<a onClick={(e) => {*/}
{/* handleGenerateQrCode(record);*/}
{/*}}*/}
{/*>*/}
{/* 生成考试码*/}
{/*</a>*/}
{record.publishStatus === 0 ? (
<a onClick={() => handlePublishSingle(record.examId)}></a> <a onClick={() => handlePublishSingle(record.examId)}></a>
) : record.publishStatus === 1 ? ( )}
{record.publishStatus === 1 && (
<a onClick={() => handleWithdrawSingle(record.examId)}></a> <a onClick={() => handleWithdrawSingle(record.examId)}></a>
) : (
<span style={{ color: 'gray' }}></span>
)} )}
<a onClick={() => handleDeleteSingle(record.examId)}></a> <a onClick={() => handleDeleteSingle(record.examId)}></a>
</Space> </Space>

@ -141,48 +141,50 @@ const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
]; ];
return ( return (
<div style={{ padding: 20 }}> <div>
{/* 检索条件行 */} <div className="header-filter">
<Row gutter={16}> <div className="list-filter" style={{ padding: 15}}>
<Col span={6}> <Row gutter={24}>
<span style={{ marginRight: 8 }}>:</span> <Col span={8}>
<Input <span style={{ marginRight: 8 }}>:</span>
placeholder="试卷名称" <Input
value={paperName} placeholder="试卷名称"
onChange={(e) => setPaperName(e.target.value)} value={paperName}
style={{ width: 'calc(100% - 100px)' }} onChange={(e) => setPaperName(e.target.value)}
/> style={{ width: 300 }}
</Col> />
<Col span={6}> </Col>
<span style={{ marginRight: 8 }}>:</span> <Col span={8}>
<Select <span style={{ marginRight: 8 }}>:</span>
placeholder="监管行业" <Select
value={industry} placeholder="监管行业"
onChange={(value) => setIndustry(value)} value={industry}
style={{ width: 150 }} onChange={(value) => setIndustry(value)}
> style={{ width: 300 }}
<Option key="" value=""></Option> >
{industryOptions.map((option) => ( <Option key="" value=""></Option>
<Option key={option.value} value={option.value}> {industryOptions.map((option) => (
{option.label} <Option key={option.value} value={option.value}>
</Option> {option.label}
))} </Option>
</Select> ))}
</Col> </Select>
<Col span={4}> </Col>
<Space> <Col span={8}>
<Button onClick={handleReset}></Button> <Space>
<Button type="primary" onClick={handleSearch}></Button> <Button onClick={handleReset}></Button>
</Space> <Button type="primary" onClick={handleSearch}></Button>
</Col> </Space>
</Row> </Col>
{/* 试卷数量行 */} </Row>
</div>
</div>
<Row gutter={24} style={{ marginTop: 40 }}> <Row gutter={24} style={{ marginTop: 40 }}>
<Col span={8}> <Col span={8}>
<div className="exam-statistic-box"> <div className="exam-statistic-box">
<div className="exam-statistic"> <div className="exam-statistic">
<span style={{ color: 'black' }}></span> <span style={{ color: 'black' }}></span>
<span style={{ color: '#86A3E7' }}>{totalCount}</span> <span style={{ color: '#86A3E7', margin: 10 }}>{totalCount}</span>
<span style={{ color: 'black' }}></span> <span style={{ color: 'black' }}></span>
</div> </div>
</div> </div>
@ -191,7 +193,7 @@ const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
<div className="exam-statistic-box"> <div className="exam-statistic-box">
<div className="exam-statistic"> <div className="exam-statistic">
<span style={{ color: 'black' }}>使</span> <span style={{ color: 'black' }}>使</span>
<span style={{ color: '#86A3E7' }}>{usedCount}</span> <span style={{ color: '#86A3E7', margin: 10 }}>{usedCount}</span>
<span style={{ color: 'black' }}></span> <span style={{ color: 'black' }}></span>
</div> </div>
</div> </div>
@ -200,7 +202,7 @@ const ExamPaperAnalysisPage: React.FC<RouteComponentProps> = ({history}) => {
<div className="exam-statistic-box"> <div className="exam-statistic-box">
<div className="exam-statistic"> <div className="exam-statistic">
<span style={{ color: 'black' }}></span> <span style={{ color: 'black' }}></span>
<span style={{ color: '#86A3E7' }}>{disabledCount}</span> <span style={{ color: '#86A3E7', margin: 10 }}>{disabledCount}</span>
<span style={{ color: 'black' }}></span> <span style={{ color: 'black' }}></span>
</div> </div>
</div> </div>

@ -1,10 +1,10 @@
import CountUp from 'react-countup';
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import { Row, Col, Select, Table, Card } from 'antd'; import { Row, Col, Select, Table, Card } from 'antd';
import ReactECharts from 'echarts-for-react'; import ReactECharts from 'echarts-for-react';
import {examStatisticsChange, examStatisticsInit, getIndustryList} from "api/exam-online/index"; // 修改接口为获取带详情的试卷列表 import {examStatisticsChange, examStatisticsInit, getIndustryList} from "api/exam-online/index"; // 修改接口为获取带详情的试卷列表
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
const { Option } = Select; const { Option } = Select;
const examTableColumns = [ const examTableColumns = [
{ {
title: '考试次数', title: '考试次数',
@ -214,17 +214,29 @@ const Dashboard: React.FC = () => {
<Row gutter={16}> <Row gutter={16}>
<Col span={8}> <Col span={8}>
<div className="exam-statistic-box"> <div className="exam-statistic-box">
<div className="exam-statistic"><span style={{color:"#86A3E7"}}>{questionCount}</span></div> <div className="exam-statistic">
<span style={{color:"#86A3E7", margin: 10}}>
<CountUp end={questionCount as number} separator="," duration={2}/>
</span>
</div>
</div> </div>
</Col> </Col>
<Col span={8}> <Col span={8}>
<div className="exam-statistic-box"> <div className="exam-statistic-box">
<div className="exam-statistic"><span style={{color:"#86A3E7"}}>{paperCount}</span></div> <div className="exam-statistic">
<span style={{color: "#86A3E7", margin: 10}}>
<CountUp end={paperCount as number} separator="," duration={2}/>
</span>
</div>
</div> </div>
</Col> </Col>
<Col span={8}> <Col span={8}>
<div className="exam-statistic-box"> <div className="exam-statistic-box">
<div className="exam-statistic"><span style={{color:"#86A3E7"}}>{examCount}</span></div> <div className="exam-statistic">
<span style={{color:"#86A3E7", margin: 10}}>
<CountUp end={examCount as number} separator="," duration={2}/>
</span>
</div>
</div> </div>
</Col> </Col>
</Row> </Row>

@ -356,8 +356,8 @@ const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => {
const columnsHivePolicyInnerCoInsurer = [ const columnsHivePolicyInnerCoInsurer = [
{ {
title: '联保机构', title: '联保机构',
dataIndex: 'innerCoOrgCode', dataIndex: 'orgName',
key: 'innerCoOrgCode', key: 'orgName',
}, },
{ {
title: '联保份额', title: '联保份额',
@ -475,18 +475,24 @@ const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => {
}, },
]; ];
const handleCapture = () => { const handleCapture = () => {
setLoading(true);
setDownloadStat(true); setDownloadStat(true);
setTimeout(function () { setLoading(true);
downPdf("企业档案", "main-customer-htm").then(() => { setTimeout(() => {
console.log("PDF已经生成并保存!"); downPdf("企业档案", "main-customer-htm")
}).catch((error: any) => { .then(() => {
console.error("生成PDF时发生错误: ", error); console.log("PDF已经生成并保存!");
}); setLoading(false);
setLoading(false); setDownloadStat(false);
setDownloadStat(false); })
.catch((error: any) => {
console.error("生成PDF时发生错误: ", error);
setLoading(false);
setDownloadStat(false);
});
}, 7000); }, 7000);
} // }, 200);
};
return ( return (
<div> <div>
<div style={{ height: 40 }}> <div style={{ height: 40 }}>
@ -506,145 +512,158 @@ const EnterpriseFile: React.FC<CustomerRetentionProps> = ({ customer }) => {
textAlign: 'center', textAlign: 'center',
display: 'flex', display: 'flex',
alignItems: 'center' alignItems: 'center'
}}></div></div> }}>{customer.customerName}</div></div>
<div> <div>
<Descriptions title="企业基本信息"> <div className={downloadStat? 'asd': 'header-filter'} style={downloadStat?{}:{width: '99%', marginLeft: '0.5%'}}>
{items.map(item => ( <div className={downloadStat? 'asd': 'list-filter'} style={downloadStat?{}:{display: 'flex', padding: 7}}>
<Descriptions.Item label={item.label} key={item.key}> <Descriptions title="企业基本信息">
{item.children} {items.map(item => (
</Descriptions.Item> <Descriptions.Item label={item.label} key={item.key}>
))} {item.children}
</Descriptions> </Descriptions.Item>
<br /> ))}
<div className="ant-descriptions-header">
<div className="ant-descriptions-title"></div>
</div>
{items2.map(pItem => (
<div style={{border: '1px solid #dce4f84a',
borderRadius: 5,
padding: 10,
backgroundColor: '#dce4f84a',
marginTop: 10}}>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Descriptions>
{pItem.baseData.map((item: { label: string, key: string, children: string }) => (
<Descriptions.Item label={item.label} key={item.key}>
{item.children}
</Descriptions.Item>
))}
</Descriptions> </Descriptions>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={pItem.policyCoverageList}
columns={columnsPolicyCoverage}
bordered={true}
size={'small'}
rowKey="key"
scroll={{ y: 300 }}
pagination={false}
/>
<br/>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={pItem.hivePolicyInnerCoInsurerList}
columns={columnsHivePolicyInnerCoInsurer}
bordered={true}
size={'small'}
rowKey="key"
scroll={{ y: 300 }}
pagination={false}
/>
<br />
</div> </div>
))}
<br />
<div className="ant-descriptions-header">
<div className="ant-descriptions-title"></div>
</div> </div>
{items3.map((item3, index) => ( <div className={downloadStat? 'asd': 'header-filter'} style={downloadStat?{}:{width: '99%', marginLeft: '0.5%'}}>
<div style={{border: '1px solid #dce4f84a', <div className={downloadStat? 'asd': 'list-filter'} style={downloadStat?{}:{padding: 7}}>
borderRadius: 5, <div className="ant-descriptions-header">
padding: 10, <div className="ant-descriptions-title"></div>
backgroundColor: '#dce4f84a'}}> </div>
{(index === 0 || item3[0].children !== items3[index - 1][0].children) && ( {items2.map(pItem => (
<div style={{ marginBottom: 20, fontWeight: 600 }}> <div style={{border: '1px solid #dce4f84a',
{item3[0].children} borderRadius: 5,
padding: 10,
backgroundColor: '#dce4f84a',
marginTop: 10}}>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Descriptions>
{pItem.baseData.map((item: { label: string, key: string, children: string }) => (
<Descriptions.Item label={item.label} key={item.key}>
{item.children}
</Descriptions.Item>
))}
</Descriptions>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={pItem.policyCoverageList}
columns={columnsPolicyCoverage}
bordered={true}
size={'small'}
rowKey="key"
scroll={{ y: 300 }}
pagination={false}
/>
<br/>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={pItem.hivePolicyInnerCoInsurerList}
columns={columnsHivePolicyInnerCoInsurer}
bordered={true}
size={'small'}
rowKey="key"
scroll={{ y: 300 }}
pagination={false}
/>
<br />
</div> </div>
)} ))}
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Descriptions>
{item3.slice(1, 4).map(tim => (
<Descriptions.Item label={tim.title} key={tim.key}>
{tim.children}
</Descriptions.Item>
))}
</Descriptions>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Descriptions>
{item3.slice(5, 13).map(tim => (
<Descriptions.Item label={tim.title} key={tim.key}>
{tim.children}
</Descriptions.Item>
))}
</Descriptions>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Descriptions>
{item3.slice(14, 24).map(tim => (
<Descriptions.Item label={tim.title} key={tim.key}>
{tim.children}
</Descriptions.Item>
))}
</Descriptions>
</div> </div>
))}
<br />
<div className="ant-descriptions-header">
<div className="ant-descriptions-title"></div>
</div> </div>
{items4.map((item4, index) => ( <div className={downloadStat? 'asd': 'header-filter'} style={downloadStat?{}:{width: '99%', marginLeft: '0.5%'}}>
<div style={{border: '1px solid #dce4f84a', <div className={downloadStat? 'asd': 'list-filter'} style={downloadStat?{}:{padding: 7}}>
borderRadius: 5, <div className="ant-descriptions-header">
padding: 10, <div className="ant-descriptions-title"></div>
backgroundColor: '#dce4f84a'}}> </div>
<div style={{marginBottom: 20, fontWeight: 600}}> {item4.policyNumber}</div> {items3.map((item3, index) => (
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div> <div style={{border: '1px solid #dce4f84a',
<Table borderRadius: 5,
className={downloadStat ? 'special-class' : 'regular-class'} padding: 10,
dataSource={item4.accidentPreventionList} backgroundColor: '#dce4f84a'}}>
columns={columnsAccidentPrevention} {(index === 0 || item3[0].children !== items3[index - 1][0].children) && (
bordered={true} <div style={{ marginBottom: 20, fontWeight: 600 }}>
size={'small'} {item3[0].children}
scroll={{ y: 300 }} </div>
rowKey="key" )}
pagination={false} <div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
/> <Descriptions>
<br/> {item3.slice(1, 4).map(tim => (
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div> <Descriptions.Item label={tim.title} key={tim.key}>
<Table {tim.children}
className={downloadStat ? 'special-class' : 'regular-class'} </Descriptions.Item>
dataSource={item4.riskList} ))}
columns={columnsRisk} </Descriptions>
bordered={true} <div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
size={'small'} <Descriptions>
scroll={{ y: 300 }} {item3.slice(5, 13).map(tim => (
pagination={false} <Descriptions.Item label={tim.title} key={tim.key}>
/> {tim.children}
<br/> </Descriptions.Item>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div> ))}
<Table </Descriptions>
className={downloadStat ? 'special-class' : 'regular-class'} <div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
dataSource={item4.hazardInvestigationList} <Descriptions>
columns={columnsHazardInvestigation} {item3.slice(14, 24).map(tim => (
bordered={true} <Descriptions.Item label={tim.title} key={tim.key}>
size={'small'} {tim.children}
scroll={{ y: 300 }} </Descriptions.Item>
rowKey="key" ))}
pagination={false} </Descriptions>
/> </div>
))}
</div> </div>
))} </div>
<div className={downloadStat? 'asd': 'header-filter'} style={downloadStat?{}:{width: '99%', marginLeft: '0.5%'}}>
<div className={downloadStat? 'asd': 'list-filter'} style={downloadStat?{}:{padding: 7}}>
<div className="ant-descriptions-header">
<div className="ant-descriptions-title"></div>
</div>
{items4.map((item4, index) => (
<div style={{border: '1px solid #dce4f84a',
borderRadius: 5,
padding: 10,
backgroundColor: '#dce4f84a'}}>
<div style={{marginBottom: 20, fontWeight: 600}}> {item4.policyNumber}</div>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={item4.accidentPreventionList}
columns={columnsAccidentPrevention}
bordered={true}
size={'small'}
scroll={{ y: 300 }}
rowKey="key"
pagination={false}
/>
<br/>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={item4.riskList}
columns={columnsRisk}
bordered={true}
size={'small'}
scroll={{ y: 300 }}
pagination={false}
/>
<br/>
<div style={{marginBottom: 20, color: '#4F85EA', fontWeight: 600}}></div>
<Table
className={downloadStat ? 'special-class' : 'regular-class'}
dataSource={item4.hazardInvestigationList}
columns={columnsHazardInvestigation}
bordered={true}
size={'small'}
scroll={{ y: 300 }}
rowKey="key"
pagination={false}
/>
</div>
))}
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save