From a808f0a2d3e3bca41dc962b3873379970ca3f777 Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Tue, 8 Mar 2022 17:16:42 +0800 Subject: [PATCH 1/6] bug --- .../analysis/components/CourseRow.tsx | 71 ++++---- .../analysis/components/IntroduceRow.tsx | 21 +-- .../pages/examination/certificate/index.tsx | 3 +- .../examinationrules/normal/step/index.tsx | 6 +- .../history/analysis/components/TrainCard.tsx | 12 +- .../mockExamination/chapterErrorListPaper.tsx | 164 ++++++++---------- .../mockExamination/chapterListPaper.tsx | 22 ++- web/src/pages/mockExamination/paper/index.tsx | 4 +- 8 files changed, 150 insertions(+), 153 deletions(-) diff --git a/admin/src/pages/dashboard/analysis/components/CourseRow.tsx b/admin/src/pages/dashboard/analysis/components/CourseRow.tsx index 4d0175c..5283f11 100644 --- a/admin/src/pages/dashboard/analysis/components/CourseRow.tsx +++ b/admin/src/pages/dashboard/analysis/components/CourseRow.tsx @@ -26,34 +26,35 @@ const TrainingRow = () => {
- -
- { - // const {name, value} = args; - console.log('args', name) - return { name: '浏览量', value: value }; - } - }} - xAxis={{ - visible: true, - title: { - visible: false, - }, - }} - yAxis={{ - visible: true, - title: { - text: '课程浏览量', - visible: false, - }, - }} + +
+ { + // const {name, value} = args; + console.log('args', name) + return { name: '浏览量', value: value }; + } + }} + xAxis={{ + visible: true, + title: { + text: '课程名称', + visible: false, + }, + }} + yAxis={{ + visible: true, + title: { + text: '课程浏览量', + visible: false, + }, + }} /* title={{ visible: true, @@ -62,16 +63,12 @@ const TrainingRow = () => { fontSize: 14, }, }}*/ - meta={{ - y: { - alias: '次', - }, - }} - /> -
-
+ + /> +
+
- +
); } diff --git a/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx b/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx index c5f5124..6e06218 100644 --- a/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx +++ b/admin/src/pages/dashboard/analysis/components/IntroduceRow.tsx @@ -1,9 +1,9 @@ //import { InfoCircleOutlined } from '@ant-design/icons'; -import { Column } from '@ant-design/charts'; -import { Col, Row,} from 'antd'; +import { Column } from '@ant-design/charts'; +import { Col, Row, } from 'antd'; import numeral from 'numeral'; -import { ChartCard, } from './Charts'; +import { ChartCard, } from './Charts'; // import type { SubjectAndCourseNumberStatistics } from '../data.d'; //import styles from '../style.less'; import { useRequest } from 'umi'; @@ -25,7 +25,7 @@ const IntroduceRow = () => { total={numeral(subjectAndCourseData?.subject_numbers || 0).format('0,0')} footer={false} //contentHeight={150} - style={{flex:1, marginBottom: 24, height:120}} + style={{ flex: 1, marginBottom: 24, height: 120 }} /> { total={numeral(subjectAndCourseData?.course_numbers || 0).format('0,0')} footer={false} //contentHeight={150} - style={{flex:1, marginBottom: 24, height:120}} + style={{ flex: 1, marginBottom: 24, height: 120 }} /> @@ -47,7 +47,7 @@ const IntroduceRow = () => { total={false} footer={false} // contentHeight={300} - style={{marginBottom: 24}} + style={{ marginBottom: 24 }} > { xAxis={{ visible: true, title: { + text: '主题名称', visible: false, }, }} yAxis={{ visible: true, title: { + text: '数量', visible: false, }, }} title={{ visible: false, - text: '课程浏览量', style: { fontSize: 14, }, }} - meta={{ - y: { - alias: '培训数', - }, - }} + /> diff --git a/admin/src/pages/examination/certificate/index.tsx b/admin/src/pages/examination/certificate/index.tsx index 7972932..ccbe003 100644 --- a/admin/src/pages/examination/certificate/index.tsx +++ b/admin/src/pages/examination/certificate/index.tsx @@ -101,7 +101,7 @@ const CourseList: React.FC = () => { width: 48, }, { - title: '证件名称', + title: '考试名称', dataIndex: 'examination_name', valueType: 'text', hideInTable: false, @@ -221,6 +221,7 @@ const CourseList: React.FC = () => { }, ]; + return ( diff --git a/admin/src/pages/examinationrules/normal/step/index.tsx b/admin/src/pages/examinationrules/normal/step/index.tsx index 51bdf9f..72c6200 100644 --- a/admin/src/pages/examinationrules/normal/step/index.tsx +++ b/admin/src/pages/examinationrules/normal/step/index.tsx @@ -525,11 +525,7 @@ export default () => { console.log('v::::', values.name); const rows = selectorRef?.current?.getSelectedRows() console.log('rows::::', rows); -<<<<<<< HEAD - const { code, data: paper, msg } = await handleAppend(Number(params?.id), rows) -======= - const {code, data: paper, msg} = await handleAppend(Number(params?.id || rulesId), rows) ->>>>>>> 49ed2a82efcf921baec6deb67be90df4ffd3b34a + const { code, data: paper, msg } = await handleAppend(Number(params?.id || rulesId), rows) console.log('paper', paper) setUuidPaper(paper?.paper_uuid) console.log('paper_uuid', paper?.paper_uuid) diff --git a/admin/src/pages/history/analysis/components/TrainCard.tsx b/admin/src/pages/history/analysis/components/TrainCard.tsx index e07d584..3a848bc 100644 --- a/admin/src/pages/history/analysis/components/TrainCard.tsx +++ b/admin/src/pages/history/analysis/components/TrainCard.tsx @@ -54,13 +54,23 @@ const SalesCard = () => { geometry: 'column', }, { - geometry: 'line', lineStyle: { lineWidth: 2, }, }, ], + meta: { + city: { + alias: '类别', + }, + count: { + alias: '资质证书人数', + }, + credential_rate: { + alias: '证书比例', + }, + } }; return (
diff --git a/web/src/pages/mockExamination/chapterErrorListPaper.tsx b/web/src/pages/mockExamination/chapterErrorListPaper.tsx index 9dc1729..43a2f7f 100644 --- a/web/src/pages/mockExamination/chapterErrorListPaper.tsx +++ b/web/src/pages/mockExamination/chapterErrorListPaper.tsx @@ -158,10 +158,21 @@ const CardList = () => { } } + + // 根据题型返回题数、分数、总分 + const showQuestionTypeSocore = (questionType) => { + let num = 0 + let name = 0 + questionTypeList.map((e) => { + e.question_type === questionType ? name = e.question_type_name : ""; + e.question_type === questionType ? num = e.question_list.length : "" + }) + return `${name} (共${num}题)` + } return ( - {/* {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} */} + {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} {/* {console.log(questionTypeList, 'uestionTypeList')} */} @@ -220,11 +231,11 @@ const CardList = () => {
+ {console.log(questionNow, 'questionNow.index[1]')} + { > - {questionNow.id ? questionNow.index[0] + 1 : ""} 、{questionNow?.question_stem} + {JSON.stringify(questionNow) !== {} ? questionNow.index[1] + 1 : ""} 、{questionNow?.question_stem} @@ -357,12 +368,6 @@ const CardList = () => { // runSavePersonAnswer({ // answer_ids: e.target.value, // question_id: questionNow.question_id, - // record_id: rulesPaperInfo.record_id - // }) - // console.log("答题:", questionAnswer, qArr, questionNow) - // 修改答题卡状态 写入答案以及修改答题状态 - const qX = questionNow?.question_type; - const qI = questionNow?.index; questionList[questionNow.index[0]].question_list[questionNow.index[1]].answerSelect = questionAnswer; if (questionAnswer === questionNow.answertrue) { questionList[questionNow.index[0]].question_list[questionNow.index[1]].state = 0 @@ -380,88 +385,71 @@ const CardList = () => { })} ) : "" - } - - - - - { return true }} value={0} size="large"> - - -
- - - - - - -
- - - 答题序号 - {questionNowNum}/{questionNum} - - + }
+ + + 答题序号 + {questionNowNum}/{questionNum} + + - }) + - - -
- - - - ); + if (e.question_id === questionNow.question_id) { + const nextTemp = paperInfo[i + 1] + const questionList = questionTypeList + let nextData = {} + questionList[nextTemp.index[0]].question_list.map((item, index) => { + if (item.question_id === nextTemp.question_id) { + nextData = item + } + }) + setQuestionNow(nextData) + } + + }) + + }}>下一题 + +
+
+ + + + ); }; -export default CardList; + export default CardList; diff --git a/web/src/pages/mockExamination/chapterListPaper.tsx b/web/src/pages/mockExamination/chapterListPaper.tsx index cf1e0e5..ce2fbb3 100644 --- a/web/src/pages/mockExamination/chapterListPaper.tsx +++ b/web/src/pages/mockExamination/chapterListPaper.tsx @@ -189,13 +189,23 @@ const CardList = () => { } - // 计算试题总数以及已答题数 + // 根据题型返回题数、分数、总分 + const showQuestionTypeSocore = (questionType) => { + let num = 0 + let name = 0 + questionTypeList.map((e) => { + console.log(e, 'eee') + e.question_type === questionType ? name = e.question_type_name : ""; + e.question_type === questionType ? num = e.question_list.length : "" + }) + return `${name} (共${num}题)` + } + return ( {console.log("试题列表:", paperInfo, "答题卡:", questionTypeList, "当前试题", questionNow)} - {/* {console.log(questionTypeList, 'uestionTypeList')} */} { { > - {questionNow.id ? questionNow.index[0] + 1 : ""} 、{questionNow?.question_stem} + {questionNow.id ? questionNow.index[1] + 1 : ""} 、{questionNow?.question_stem} {console.log("question", questionNow)} @@ -424,7 +432,7 @@ const CardList = () => { + }}>查看答案
diff --git a/web/src/pages/mockExamination/paper/index.tsx b/web/src/pages/mockExamination/paper/index.tsx index 69e28c2..9417d67 100644 --- a/web/src/pages/mockExamination/paper/index.tsx +++ b/web/src/pages/mockExamination/paper/index.tsx @@ -402,7 +402,7 @@ const CardList = () => { } onClick={() => { - // 查看解析关闭 + // 查看答案关闭 setParsingShow(false) paperInfo.map((e) => { @@ -556,7 +556,7 @@ const CardList = () => { + }}>查看答案
From a4555070a2f33ac853baa783d9668e0d5efa713a Mon Sep 17 00:00:00 2001 From: wangxi <123456> Date: Wed, 9 Mar 2022 08:47:26 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B5=8B=E8=AF=95bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/course/list/index.tsx | 19 ++++++++++++++----- web/src/pages/course/subject/index.tsx | 9 +++++++-- .../mockExamination/chapterExamination.tsx | 2 +- web/src/pages/mockExamination/chapterList.tsx | 12 +++++++++--- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/web/src/pages/course/list/index.tsx b/web/src/pages/course/list/index.tsx index e6cf72c..341190d 100644 --- a/web/src/pages/course/list/index.tsx +++ b/web/src/pages/course/list/index.tsx @@ -17,6 +17,7 @@ const CardList = () => { const ids = params.msg.split(','); const [currentCourse, SetCurrentCourse] = useState() + const [selectedMenu, setSelectedMenu] = useState('') /** 获取主题下课程 */ const { data } = useRequest(() => { @@ -33,6 +34,7 @@ const CardList = () => { result.subject.startTime= result.subject.learning_start_time.split(' ')[0]; result.subject.endTime= result.subject.learning_end_time.split(' ')[0]; console.log('result9999',result); + setSelectedMenu(result.chapter_list[0].chapter_id.toString()) } }); @@ -81,7 +83,12 @@ const CardList = () => { hoverable={false} className={styles.card} actions={[]} - extra={<>开始学习时间: {subject_data ? subject_data.startTime : '--'}距离结束时间:{subject_data ? subject_data.distance_end_time : '--'}学习结束时间:{subject_data?subject_data.endTime:'--'}考核学时:{subject_data ? subject_data.total_course_hours : '--'}小时} + extra={<> + 学习开始时间: {subject_data ? subject_data.startTime : '--'} + 距离结束时间:{subject_data ? subject_data.distance_end_time : '--'} + 学习结束时间:{subject_data?subject_data.endTime:'--'} + 考核学时:{subject_data ? subject_data.total_course_hours : '--'}学时 + } > } @@ -100,7 +107,7 @@ const CardList = () => { <> 学习进度: - percent === 100 ? '100%' : `${percent}%`} /> @@ -139,7 +146,7 @@ const CardList = () => { @@ -151,6 +158,7 @@ const CardList = () => { { + setSelectedMenu(item.chapter_id.toString()) run({ subject_id: item.subject_id, chapter_id: item.chapter_id }) }} >{item.chapter_name} @@ -161,6 +169,7 @@ const CardList = () => { + { @@ -171,9 +180,9 @@ const CardList = () => {
第{item?.sort_no}讲
{item?.course_name}
-
{item?.course_hours}小时
+
{item?.course_hours*60}分钟
- percent === 100 ? '100%' : `${percent}%`} />
diff --git a/web/src/pages/course/subject/index.tsx b/web/src/pages/course/subject/index.tsx index 51f3ed7..83dfab6 100644 --- a/web/src/pages/course/subject/index.tsx +++ b/web/src/pages/course/subject/index.tsx @@ -57,7 +57,12 @@ const SubjectList = () => { hoverable className={styles.card} actions={[]} - extra={<>学开始习时间:{item?.startTime}距离结束时间:{item?.distance_end_time}学习结束时间:{item?.endTime}考核学时:{item?.total_course_hours}小时} + extra={<> + 学习开始时间:{item?.startTime} + 距离结束时间:{item?.distance_end_time} + 学习结束时间:{item?.endTime} + 考核学时:{item?.total_course_hours}学时 + } > } @@ -72,7 +77,7 @@ const SubjectList = () => { percent === 100 ? '100%' : `${percent}%`} /> diff --git a/web/src/pages/mockExamination/chapterExamination.tsx b/web/src/pages/mockExamination/chapterExamination.tsx index 78d78fd..d7754a0 100644 --- a/web/src/pages/mockExamination/chapterExamination.tsx +++ b/web/src/pages/mockExamination/chapterExamination.tsx @@ -47,7 +47,7 @@ const SubjectList = () => { // extra={<>开始学习时间:{item?.learning_start_time}距离结束时间:{item?.distance_end_time}考核学时:{item?.total_course_hours}小时} > }sss + avatar={} title={false} description={ <> diff --git a/web/src/pages/mockExamination/chapterList.tsx b/web/src/pages/mockExamination/chapterList.tsx index 157bda9..fbd0df4 100644 --- a/web/src/pages/mockExamination/chapterList.tsx +++ b/web/src/pages/mockExamination/chapterList.tsx @@ -15,9 +15,10 @@ let chapterCourse = []; let total_process = 0; const CardList = () => { const params = useParams(); - + const [selectedMenu, setSelectedMenu] = useState('') const [currentCourse, SetCurrentCourse] = useState() + /** 获取主题下课程 */ const { data } = useRequest(() => { return viewMyLearningSubject({ @@ -28,6 +29,10 @@ const CardList = () => { subject_id: params?.subject_id }); + },{ + onSuccess:(result)=>{ + setSelectedMenu(result.chapter_list[0].chapter_id.toString()) + } }); // const list = data?.list||[]; @@ -122,7 +127,7 @@ const CardList = () => { +
+ + + + + + +
+ + + 答题序号 + {questionNowNum}/{questionNum} + + + block>上一题 - - - -
- - - - ); + if (e.question_id === questionNow.question_id) { + const nextTemp = paperInfo[i + 1] + const questionList = questionTypeList + let nextData = {} + questionList[nextTemp.index[0]].question_list.map((item, index) => { + if (item.question_id === nextTemp.question_id) { + nextData = item + } + }) + setQuestionNow(nextData) + } + + }) + + }}>下一题 + + +
+ + + + ); }; - export default CardList; +export default CardList; From fdeaf49b838ececcceeeb025cecc0d2d954bebbb Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Wed, 9 Mar 2022 08:59:24 +0800 Subject: [PATCH 4/6] bug --- web/src/pages/mockExamination/chapterErrorListPaper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/mockExamination/chapterErrorListPaper.tsx b/web/src/pages/mockExamination/chapterErrorListPaper.tsx index 6ea7b80..b8843c5 100644 --- a/web/src/pages/mockExamination/chapterErrorListPaper.tsx +++ b/web/src/pages/mockExamination/chapterErrorListPaper.tsx @@ -243,7 +243,7 @@ const CardList = () => { > - 、{questionNow?.question_stem} + {JSON.stringify(questionNow) !== "{}" ? questionNow.index[1] + 1 : ""} 、{questionNow?.question_stem} From c823042a809fce5d5e2efb56d90c6aa71ab4b9fb Mon Sep 17 00:00:00 2001 From: wangxi <123456> Date: Wed, 9 Mar 2022 14:06:53 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B5=8B=E8=AF=95bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/dashboard/qualification/examAnswer.tsx | 6 +++--- web/src/pages/dashboard/qualification/result.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/pages/dashboard/qualification/examAnswer.tsx b/web/src/pages/dashboard/qualification/examAnswer.tsx index 27324dd..1a06037 100644 --- a/web/src/pages/dashboard/qualification/examAnswer.tsx +++ b/web/src/pages/dashboard/qualification/examAnswer.tsx @@ -332,7 +332,7 @@ const CardList = () => { bordered dataSource={e.children} renderItem={(item, index) => { - setNum(index+1); + // console.log(item, 'list') return { onClick={() => { // 查看解析关闭 setParsingShow(false) - + setNum(index+1); paperInfo.map((e) => { if (e.id === item.id) { // 重写单选的label、value,index:保存当前试题的index。 @@ -376,7 +376,7 @@ const CardList = () => { > - {num}. {questionNow?.question_stem} + {questionNow?.question_stem} {/* {console.log(questionNow.answerId, 'answerId', questionNow.answerId)} */} diff --git a/web/src/pages/dashboard/qualification/result.tsx b/web/src/pages/dashboard/qualification/result.tsx index c909913..583e81f 100644 --- a/web/src/pages/dashboard/qualification/result.tsx +++ b/web/src/pages/dashboard/qualification/result.tsx @@ -106,7 +106,7 @@ const Result = () => { person_id:cookie.load('person_id') }); },{ - manual:true, + // manual:true, formatResult:(result)=>{ const paper_id='1'; if(result.paper_id===''){ From 5886ebbef99411f6b652db3f285241d9a6c203c8 Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Wed, 9 Mar 2022 14:54:43 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=80=83=E8=AF=95=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E3=80=81=E6=8A=A5=E5=90=8D=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/examination/registration/index.tsx | 150 ++++++++++++------ admin/src/pages/examination/service.ts | 37 ++--- web/src/components/Footer/index.tsx | 2 +- 3 files changed, 110 insertions(+), 79 deletions(-) diff --git a/admin/src/pages/examination/registration/index.tsx b/admin/src/pages/examination/registration/index.tsx index eb5a3e8..86b1fef 100644 --- a/admin/src/pages/examination/registration/index.tsx +++ b/admin/src/pages/examination/registration/index.tsx @@ -1,6 +1,6 @@ /** 认证考试规则 */ import React, { useState, useRef } from 'react'; -import { useRequest } from 'umi'; +import { useParams, useRequest } from 'umi'; import { ExportOutlined, PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'; import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload } from 'antd'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; @@ -11,7 +11,7 @@ import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import ProDescriptions from '@ant-design/pro-descriptions'; import type { FormValueType } from './components/UpdateForm'; import UpdateForm from './components/UpdateForm'; -import { saveRegistration, removeRegistration, queryRegistrationList } from '../service'; +import { saveRegistration, removeRegistration, getExaminationPersonApplyList, getAsyncOrgTree } from '../service'; import type { TableListItem, TableListPagination } from './data'; import type { DataItem } from '@antv/data-set/lib/transform/tag-cloud'; @@ -84,10 +84,19 @@ const handleRemove = async (selectedRows: TableListItem[]) => { }; const RegistrationList: React.FC = () => { + const params = useParams(); /** 更新窗口的弹窗 */ const [createModalVisible, handleCreateModalVisible] = useState(false); const [detailModalVisible, handleDetailModalVisible] = useState(false); const [updateModalVisible, handleUpdateModalVisible] = useState(false); + const [provinceId, setProvinceId] = useState("100007") + const [cityId, setCityId] = useState("0") + const [areaId, setAreaId] = useState("0") + const [exportData, setExportData] = useState({ + examination_id: Number(params.id), + + }) + const actionRef = useRef(); @@ -95,6 +104,16 @@ const RegistrationList: React.FC = () => { const [selectedRowsState, setSelectedRows] = useState([]); + /** 获取列数据初始值 */ + const getInitialValues = (cols: any[], vals: any) => { + const initialValues: any[] = []; + cols.forEach((column: { dataIndex: string }) => { + const key: any = column?.dataIndex || ''; + initialValues.push({ ...column, initialValue: key ? vals[key] : '' }); + }); + return initialValues || []; + }; + /** 列表项定义 */ const columns: ProColumns[] = [ { @@ -105,13 +124,14 @@ const RegistrationList: React.FC = () => { }, { title: '姓名', - dataIndex: 'username', + dataIndex: 'person_name', valueType: 'text', hideInTable: false, hideInForm: false, hideInSearch: true, }, { + title: '市', dataIndex: 'city_name', valueType: 'text', @@ -119,22 +139,56 @@ const RegistrationList: React.FC = () => { hideInTable: false, hideInForm: false, hideInSearch: false, - renderText: (val: string) => `${val}`, + colSize: 1, + request: async (params) => { + + const Items = await getAsyncOrgTree({ + org_id: provinceId, + org_type: 1, + get_next: 1 + }); + console.log('queryCourseListByTag...', Items) + const courses = [{ label: "全部", value: "0" }] + for (let i = 0; i < Items?.length; i++) { + courses.push({ label: Items[i]?.name, value: Items[i]?.id }) + } + console.log(courses, 'courses:::'); + return courses; + }, }, { title: '区县', - dataIndex: 'area_name', + dataIndex: 'district_name', valueType: 'text', sorter: false, hideInTable: false, hideInForm: false, hideInSearch: false, - renderText: (val: string) => `${val}`, + dependencies: ['city_name'], + request: async (params) => { + const courses = [{ label: "全部", value: "0" }] + + if (params.city_name) { + console.log(params, 'params') + const Items = await getAsyncOrgTree({ + org_id: params.city_name, + org_type: 2, + get_next: 1 + }); + console.log('queryCourseListByTag...', Items) + for (let i = 0; i < Items?.length; i++) { + courses.push({ label: Items[i]?.name, value: Items[i]?.id }) + } + console.log(courses, 'courses:::'); + } + return courses; + + }, }, { title: '学校', valueType: 'text', - dataIndex: 'org_name', + dataIndex: 'bureau_name', sorter: false, hideInTable: false, hideInForm: false, @@ -152,44 +206,17 @@ const RegistrationList: React.FC = () => { }, { title: '考试时间', - dataIndex: 'create_time', + dataIndex: 'examination_time', valueType: 'dateRange', sorter: true, - hideInTable: true, + hideInTable: false, hideInForm: true, hideInSearch: false, - - //renderText: (val: string) => `${val}`, - }, - { - title: '操作', - dataIndex: 'option', - valueType: 'option', - render: (_dom: any, record: React.SetStateAction) => [ - { - //console.log('entity', entity); - setCurrentRow(record); - handleDetailModalVisible(true); - }} - > - 查看 - , - { - handleUpdateModalVisible(true); - setCurrentRow(record); - }} - > - 编辑 - , - - 删除 - , - ], + render: (dom, entity) => { + return entity.examination_start_time + "-" + entity.examination_end_time; + }, }, + ]; return ( @@ -202,33 +229,54 @@ const RegistrationList: React.FC = () => { search={{ labelWidth: 120, }} + toolBarRender={() => [ , ]} request={async (value) => { - const _data = await queryRegistrationList(value); + + console.log('value', value); + let examination_time = {} + if (value.examination_time) { + examination_time = { + examination_start_time: value.examination_time[0], + examination_end_time: value.examination_time[1] + } + } + value = { + ...value, + page_number: value.current, + page_size: value.pageSize, + city_id: cityId, + district_id: areaId, + examination_id: params.id, + ...examination_time + } + + // setExportData(value) + const _data = await getExaminationPersonApplyList(value); + return { current: _data?.page_number, - data: _data?.data?.list, + data: _data?.table_List, pageSize: _data?.page_size, total: _data?.total_row || 0, }; }} // dataSource={list} - columns={columns} - rowSelection={{ - onChange: (_, selectedRows) => { - setSelectedRows(selectedRows); - }, - }} + columns={getInitialValues(columns, { city_name: cityId, area_name: areaId })} + // rowSelection={{ + // onChange: (_, selectedRows) => { + // setSelectedRows(selectedRows); + // }, + // }} /* pagination={{ showTotal: (total) => { diff --git a/admin/src/pages/examination/service.ts b/admin/src/pages/examination/service.ts index a93e010..1bdbe8d 100644 --- a/admin/src/pages/examination/service.ts +++ b/admin/src/pages/examination/service.ts @@ -82,10 +82,10 @@ export async function updateExamination(data: Record, options?: Rec } /** 删除考试 */ -export async function removeExamination(data: { key: number[]}, options?: Record) { +export async function removeExamination(data: { key: number[] }, options?: Record) { console.log('data:::', data); return request>('/dsideal_yy/zygh/training/examination/delExamination', { - data: { examination_id: data?.key[0], rules_id: options?.rules_id}, // 当前接口不支持批量操作 + data: { examination_id: data?.key[0], rules_id: options?.rules_id }, // 当前接口不支持批量操作 method: 'POST', requestType: 'form', }); @@ -118,30 +118,11 @@ export async function queryExaminationView(data: Record, options?: }); } -/** 获取报名列表 GET Mock /api/queryRegistrationList */ -export async function queryRegistrationList( - params: { - // query - /** 当前的页码 */ - current?: number; - /** 页面的容量 */ - pageSize?: number; - }, - options?: Record, -) { - return request<{ - data: TableListItem[]; - /** 列表的内容总数 */ - total?: number; - success?: boolean; - }>('/api/getRegistrationList', { - method: 'GET', - params: { - ...params, - }, - ...(options || {}), - }); -} + + + + + /** 获取考试规则列表 GET /dsideal_yy/zygh/training/examination/getExaminationList */ @@ -218,4 +199,6 @@ export async function getAsyncOrgTree(params: { return request('dsideal_yy/org/getAsyncOrgTree', { params, }); -} \ No newline at end of file +} + + diff --git a/web/src/components/Footer/index.tsx b/web/src/components/Footer/index.tsx index ad1be5a..7106b64 100644 --- a/web/src/components/Footer/index.tsx +++ b/web/src/components/Footer/index.tsx @@ -1,7 +1,7 @@ import { DefaultFooter } from '@ant-design/pro-layout'; export default () => { - const defaultMessage = '东北师大理想软件股份有限公司'; + const defaultMessage = '东北师大理想软件股份有限公司
123'; const currentYear = new Date().getFullYear(); return (