From fbe16b6f24434f763ce3837a44ad5cf973b74392 Mon Sep 17 00:00:00 2001 From: wangxi <123456> Date: Thu, 10 Mar 2022 13:46:34 +0800 Subject: [PATCH 1/7] =?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/index.tsx | 2 +- web/src/pages/dashboard/workplace/index.tsx | 5 +++-- web/src/pages/mockExamination/chapterList.tsx | 2 +- web/src/pages/personalCenter/index.tsx | 5 ++++- web/src/pages/registration/index.tsx | 13 +++++++------ 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/web/src/pages/dashboard/qualification/index.tsx b/web/src/pages/dashboard/qualification/index.tsx index 0ed96e5..874f613 100644 --- a/web/src/pages/dashboard/qualification/index.tsx +++ b/web/src/pages/dashboard/qualification/index.tsx @@ -63,7 +63,7 @@ const Qualification = () => { return (
-
{history.push('/dashboard/workplace')}} style={{color:'#8C8C8C',cursor:'pointer',}}>首页 / 资质考试
+
{history.push('/dashboard/workplace')}} style={{color:'#8C8C8C',cursor:'pointer',}}>首页 / 资质考试 / {examinationInfo?.examination_name}
考试项目:
diff --git a/web/src/pages/dashboard/workplace/index.tsx b/web/src/pages/dashboard/workplace/index.tsx index 05358e8..ddac6bf 100644 --- a/web/src/pages/dashboard/workplace/index.tsx +++ b/web/src/pages/dashboard/workplace/index.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import { useEffect } from 'react'; -import { Avatar, Card, Col, List, Skeleton, Row, Statistic, Descriptions, Progress, Table, Button } from 'antd'; +import { Avatar, Card, Col, List, Skeleton, Row, Statistic, Descriptions, Progress, Table, Button ,Image} from 'antd'; import { Line, Radar } from '@ant-design/charts'; import { Link, history, useRequest } from 'umi'; import { PageContainer } from '@ant-design/pro-layout'; @@ -268,7 +268,8 @@ const Workplace: FC = () => { className={styles.studyCard} title="当前学习" loading={activitiesLoading} - cover={example} + // cover={example} + cover={} > {lastLearningList?.lecture_teacher} diff --git a/web/src/pages/mockExamination/chapterList.tsx b/web/src/pages/mockExamination/chapterList.tsx index fbd0df4..44e559d 100644 --- a/web/src/pages/mockExamination/chapterList.tsx +++ b/web/src/pages/mockExamination/chapterList.tsx @@ -127,7 +127,7 @@ const CardList = () => { + }}>确定修改
diff --git a/web/src/pages/registration/index.tsx b/web/src/pages/registration/index.tsx index f758655..9f36fe7 100644 --- a/web/src/pages/registration/index.tsx +++ b/web/src/pages/registration/index.tsx @@ -123,6 +123,7 @@ export default () => { /> { rules={[{ required: true, message: '请选择出生年月' }]} /> - - + + @@ -150,14 +151,14 @@ export default () => { value: '全日制本科', }, { - label: '硕士研究生及以上...', - value: '硕士研究生及以上...', + label: '硕士研究生及以上学历', + value: '硕士研究生及以上学历', }, ]} placeholder="请选择" /> - - + + Date: Thu, 10 Mar 2022 15:22:45 +0800 Subject: [PATCH 2/7] fix --- .../examinationrules/normal/step/index.tsx | 31 +++++----------- admin/src/pages/examinationrules/service.ts | 37 +++++++++++++------ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/admin/src/pages/examinationrules/normal/step/index.tsx b/admin/src/pages/examinationrules/normal/step/index.tsx index 60b2460..16f1487 100644 --- a/admin/src/pages/examinationrules/normal/step/index.tsx +++ b/admin/src/pages/examinationrules/normal/step/index.tsx @@ -354,19 +354,15 @@ export default () => { {rulesName} {/** 一旦录入另一项将禁用,清空组卷后可选另一项 */} - { - setCreateType(Number(e?.target?.value)) - console.log('value', e?.target?.value) - //handleAutoModalVisible(true); // 显示系统组卷窗口 - }} style={{ marginBottom: 16, }}> - 手动组卷 - 系统组卷 - + + + + - + {questions && { + } + {!questions && + + }
@@ -436,19 +436,6 @@ export default () => { )} - - - , ]} request={async (value) => { diff --git a/admin/src/pages/examinationrules/attestation/step/index.tsx b/admin/src/pages/examinationrules/attestation/step/index.tsx index 4d4cfaf..b13cdd3 100644 --- a/admin/src/pages/examinationrules/attestation/step/index.tsx +++ b/admin/src/pages/examinationrules/attestation/step/index.tsx @@ -18,6 +18,7 @@ import ScoreSetter from '../../components/ScoreSetter'; import AutoSelector from '../components/AutoSelector'; import QuestionSelector from '../../components/QuestionSelector'; import { getSubjectInfo } from '@/pages/course/subject/service'; +import { max } from 'lodash'; /** 选项序号 */ const labels = ['A','B','C','D','E','F','G','H','I','J','K']; @@ -80,7 +81,7 @@ export default () => { dataIndex: 'examination_time', valueType: 'text', sorter: false, - hideInTable: false, + hideInTable: true, hideInForm: true, hideInSearch: true, renderText: (val: string) => `${val}`, @@ -93,9 +94,9 @@ export default () => { hideInTable: false, hideInForm: true, hideInSearch: true, - renderText: (val: string) => { + render: (dom, record,index) => { return <> - + {record.question_type_count.map((item)=>{return {`${item.type_name} ${item.count} 题`}})} }, }, @@ -282,6 +283,18 @@ export default () => { name="rules_name" label="考试名称" width="md" + fieldProps={{ + type: 'text', + allowClear: false, + width: 'large', + onInput:(e)=>{ + const val = `${e.currentTarget?.value}`; + if(val.length > 50) { + e.currentTarget.value = val.slice(0,50) + } + } + //style:{width: '100%'} + }} initialValue={ruleData.rules_name} // tooltip="最长为 6 位汉字,需要与考生身份证一致" placeholder="请输入名称" diff --git a/admin/src/pages/examinationrules/components/QuestionSelector.tsx b/admin/src/pages/examinationrules/components/QuestionSelector.tsx index b2c5bc1..4fd58be 100644 --- a/admin/src/pages/examinationrules/components/QuestionSelector.tsx +++ b/admin/src/pages/examinationrules/components/QuestionSelector.tsx @@ -71,13 +71,29 @@ const QuestionSelector = (props: any, ref: any) => { }, }, + { + title: '标签', + dataIndex: 'tag', + valueType: 'text', + hideInTable: true, + hideInForm: true, + hideInSearch: false, + }, + { + title: '课程', + dataIndex: 'course', + valueType: 'text', + hideInTable: true, + hideInForm: true, + hideInSearch: false, + }, { title: '题干', dataIndex: 'question_stem', valueType: 'text', hideInTable: false, hideInForm: true, - hideInSearch: false, + hideInSearch: true, }, ]; const match = useRouteMatch(); diff --git a/admin/src/pages/examinationrules/components/ScoreSetter.tsx b/admin/src/pages/examinationrules/components/ScoreSetter.tsx index 560710a..9253fb2 100644 --- a/admin/src/pages/examinationrules/components/ScoreSetter.tsx +++ b/admin/src/pages/examinationrules/components/ScoreSetter.tsx @@ -125,7 +125,7 @@ const ScoreSetter = (props: any, ref: any) => { width: 80, render: (text, _, index) => { return <> - {(typeScore && questionTypeValues) ? typeScore[index]?.score * questionTypeValues[index]?.count : '0'} + {(typeScore && questionTypeValues) ? (typeScore[index]?.score * questionTypeValues[index]?.count).toFixed(2) : '0'} }, diff --git a/admin/src/pages/examinationrules/normal/components/AutoSelector.tsx b/admin/src/pages/examinationrules/normal/components/AutoSelector.tsx index 7ca58ad..da15405 100644 --- a/admin/src/pages/examinationrules/normal/components/AutoSelector.tsx +++ b/admin/src/pages/examinationrules/normal/components/AutoSelector.tsx @@ -87,6 +87,7 @@ const AutoSelector = (props: any, ref: any) => { _data.push({...item, score_harf: ((index === key) ? value : item?.score_harf)}) }) setTypeScore(_data) + console.log('setTypeScore',typeScore) }} />; }, diff --git a/admin/src/pages/examinationrules/normal/index.tsx b/admin/src/pages/examinationrules/normal/index.tsx index 867a9ef..2307648 100644 --- a/admin/src/pages/examinationrules/normal/index.tsx +++ b/admin/src/pages/examinationrules/normal/index.tsx @@ -128,8 +128,10 @@ const ExaminationRules: React.FC = () => { sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id }) } console.log(sinfo, 'sinfo'); - - return sinfo; + const info = sinfo?.filter((item, idx, self)=>{ + return item?.b_use === 1 + }); + return info; }, }, { diff --git a/admin/src/pages/examinationrules/normal/step/index.tsx b/admin/src/pages/examinationrules/normal/step/index.tsx index 16f1487..9f13809 100644 --- a/admin/src/pages/examinationrules/normal/step/index.tsx +++ b/admin/src/pages/examinationrules/normal/step/index.tsx @@ -262,6 +262,18 @@ export default () => { initialValue={ruleData?.rules_name} // tooltip="最长为 6 位汉字,需要与考生身份证一致" placeholder="请输入名称" + fieldProps={{ + type: 'text', + allowClear: false, + width: 'large', + onInput:(e)=>{ + const val = `${e.currentTarget?.value}`; + if(val.length > 50) { + e.currentTarget.value = val.slice(0,50) + } + } + //style:{width: '100%'} + }} rules={[ { required: true, message: '请输入考试名称' }, { @@ -345,7 +357,15 @@ export default () => { console.log(formRef.current?.getFieldsValue()); setCurrentStep(2) // 设置步骤号 //alert(params?.id || rulesId) - + let msg = '操作成功' + if(!questions){ + msg = '请选择试题' + message.error(msg); + return false; + } + // question 请选择试题 请选择试题 + + runPaper({ rules_id: params?.id || rulesId }) return true; }} @@ -427,7 +447,7 @@ export default () => {
试卷信息与设置 - 共 {'-'} 题 {'-'} 分 + 共 {'0'} 题 {'-'} 分 {questionType.map((item) => { diff --git a/admin/src/pages/questionbank/index.tsx b/admin/src/pages/questionbank/index.tsx index 99206b8..99bee07 100644 --- a/admin/src/pages/questionbank/index.tsx +++ b/admin/src/pages/questionbank/index.tsx @@ -484,7 +484,7 @@ const QuestionBank = () => { title: '题干', search: false, dataIndex: 'question_stem', - render: (text: React.ReactNode, record: T, index: number) => (<>{record?.id} {text}), + render: (text: React.ReactNode, record: T, index: number) => (<>{record?.id} {text}), }, avatar: { title: '题型',