diff --git a/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx b/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx index c3d41cb..f288c27 100644 --- a/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx +++ b/packages/examination/src/views/exam-online/compoents/ExamDetailAnalysisPage.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Row, Col, Input, Select, Button, Table, Space, Cascader, Modal } from 'antd'; +import {Row, Col, Input, Select, Button, Table, Space, Cascader, Modal, Form, TreeSelect} from 'antd'; import ReactECharts from 'echarts-for-react'; import {getExamDetailAnalysisPageList, getIndustryList, getScoreDistribution} from 'api/exam-online/index'; import { convertToCascaderData } from "./ExamEditPage"; @@ -21,6 +21,7 @@ type ExamDataItem = { }; const ExamDetailAnalysisPage: React.FC = () => { + let formRef = React.createRef(); const [examName, setExamName] = useState(''); const [paperName, setPaperName] = useState(''); const [examArea, setExamArea] = useState(''); @@ -63,7 +64,8 @@ const ExamDetailAnalysisPage: React.FC = () => { setPaperName(''); setExamArea(''); setIndustry(null); - handleSearch(); + const form = formRef.current; + form.resetFields(); }; const handleSearch = () => { @@ -170,41 +172,40 @@ const ExamDetailAnalysisPage: React.FC = () => {
- - - 考试名称: - setExamName(e.target.value)} - style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 - /> - - - 试卷名称: - setPaperName(e.target.value)} - style={{ width: 'calc(100% - 100px)' }} // 调整输入框宽度 - /> - - - 考试区域: +
+ + setExamName(e.target.value)}/> + + + setPaperName(e.target.value)}/> + + setExamArea(convertArrToRegion(values))} - style={{ width: 'calc(100% - 100px)' }} // 调整级联选择器宽度 + style={{width: 195}} /> - - - 监管行业: + + - - - - - - - - + + + + + + + +
{ if (!res) { return; } + message.open({ + type: 'success', + content: '操作成功', + }); research(); }).catch(() => { }) }, @@ -132,9 +136,28 @@ const ExamListPage = ({ history }: { history: any }) => { onOk: () => { const hasWithdrawn = selectedExams.some(exam => exam.publishStatus === 0 || exam.publishStatus === 2); if (hasWithdrawn) { - const confirm = window.confirm('选中数据当中有无法撤回的数据,是否继续'); - if (!confirm) { - return; + let warn1Arr = selectedExams.filter(exam => exam.publishStatus === 0); + if (warn1Arr && warn1Arr.length) { + let warnMessage = []; + for (let index = 0; index < warn1Arr.length; index ++) { + warnMessage.push(warn1Arr[index].examName); + } + message.open({ + type: 'warning', + content: '操作失败:' + warnMessage.join('、') + '禁止撤回', + }); + } + + let warn2Arr = selectedExams.filter(exam => exam.publishStatus === 2); + if (warn2Arr && warn2Arr.length) { + let warnMessage = []; + for (let index = 0; index < warn2Arr.length; index ++) { + warnMessage.push(warn2Arr[index].examName); + } + message.open({ + type: 'warning', + content: '操作失败:' + warnMessage.join('、') + '数据已撤回', + }); } } @@ -147,6 +170,10 @@ const ExamListPage = ({ history }: { history: any }) => { if (!res) { return; } + message.open({ + type: 'success', + content: '操作成功', + }); research(); }).catch(() => { }) } @@ -167,16 +194,24 @@ const ExamListPage = ({ history }: { history: any }) => { title: '确认发布', content: '你确定要发布这些选中的考试吗?', onOk: () => { - const hasPublishedOrWithdrawn = selectedExams.some(exam => exam.publishStatus === 1 || exam.publishStatus === 2); + const hasPublishedOrWithdrawn = selectedExams.some(exam => exam.publishStatus === 1); if (hasPublishedOrWithdrawn) { - const confirm = window.confirm('选中数据当中有无法发布的数据,是否继续'); - if (!confirm) { - return; + let warn1Arr = selectedExams.filter(exam => exam.publishStatus === 1); + if (warn1Arr && warn1Arr.length) { + let warnMessage = []; + for (let index = 0; index < warn1Arr.length; index ++) { + warnMessage.push(warn1Arr[index].examName); + } + message.open({ + type: 'warning', + content: '操作失败:' + warnMessage.join('、') + '数据已发布', + }); } + } // 筛选出可以发布的数据 - const validExams = selectedExams.filter(exam => exam.publishStatus === 0); + const validExams = selectedExams.filter(exam => exam.publishStatus === 0 || exam.publishStatus === 2); const validIds = validExams.map(exam => String(exam.examId)); if (validIds.length > 0) { @@ -184,6 +219,10 @@ const ExamListPage = ({ history }: { history: any }) => { if (!res) { return; } + message.open({ + type: 'success', + content: '操作成功', + }); research(); }).catch(() => { }) } @@ -231,8 +270,9 @@ const ExamListPage = ({ history }: { history: any }) => { const handleGenerateQrCode = (exam: any) => { // 实现生成考试码逻辑 setExamId(exam.examId); - setQrCodeData(exam.examId); + setQrCodeData(exam.path ? exam.path : exam.examId); setExamName(exam.examName); + debugger if (exam.captcha) { setCaptcha(exam.captcha); } else { @@ -319,7 +359,7 @@ const ExamListPage = ({ history }: { history: any }) => { // 判断是否全选 const isAllSelected = currentPageExamList.length > 0 && selectedRows.length === currentPageExamList.length; - const columns = [ + const columns: any = [ { title: ( { ), dataIndex: 'examId', key: 'examId', + align: 'center', render: (cellValue: number, record: Exam) => ( { > 生成考试码 )} - {record.publishStatus === 0 || record.publishStatus === 2 && ( + {(record.publishStatus === 0 || record.publishStatus === 2) && ( handlePublishSingle(record.examId)}>发布 )} {record.publishStatus === 1 && ( diff --git a/packages/examination/src/views/exam-online/exam-schedule.tsx b/packages/examination/src/views/exam-online/exam-schedule.tsx index dc531da..a241d64 100644 --- a/packages/examination/src/views/exam-online/exam-schedule.tsx +++ b/packages/examination/src/views/exam-online/exam-schedule.tsx @@ -14,13 +14,12 @@ class ExamSchedule extends Component { this.state = { resData: undefined, visible: false, - title: '新增公告', + title: '', current: {} } } componentDidMount() { - // this.getList() } render() { diff --git a/packages/examination/src/views/statistical/serviceStatistics.tsx b/packages/examination/src/views/statistical/serviceStatistics.tsx index ec3c908..e07d2fa 100644 --- a/packages/examination/src/views/statistical/serviceStatistics.tsx +++ b/packages/examination/src/views/statistical/serviceStatistics.tsx @@ -108,7 +108,12 @@ const App: React.FC = () => { const query = { page: current, num: pageSize || 20 } setTimeout(() => { setQuery(query); - getListApi({}, query.page, query.num) + getListApi({ + dateFilter: form.getFieldValue('dateFilter'), + startDate: form.getFieldValue('selectDateTime') ? formatDate(form.getFieldValue('selectDateTime')[0]) : null, + doneDate: form.getFieldValue('selectDateTime') ? formatDate(form.getFieldValue('selectDateTime')[1]) : null, + serviceStatus: form.getFieldValue('serviceStatus') + }, query.page, query.num) }, 0) }