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] 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 = () => { + }}>查看答案