diff --git a/admin/src/pages/course/option/index.tsx b/admin/src/pages/course/option/index.tsx index bb7de51..22f48a4 100644 --- a/admin/src/pages/course/option/index.tsx +++ b/admin/src/pages/course/option/index.tsx @@ -480,7 +480,7 @@ const CourseList: React.FC = () => { fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。 sources: [ { - src: (currentRow?.attachment_json?.url) || '/dsideal_yy/html/down/M3u8/2D/2D99BF1D-2F37-47FB-8A24-45112A236B8F.mp4', // 测试地址后续请删除 + src: (currentRow?.attachment_json?.url) || '/dsideal_yy/html/down/Syzx/3b/3b225da8-87a5-4619-82a4-664ae2b37e23.mp4', // 测试地址后续请删除 type: 'application/x-mpegURL' } ], @@ -573,7 +573,7 @@ const CourseList: React.FC = () => { await handleAdd({ ...values, //course_id: currentRow?.course_id, - attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/M3u8/${uuid?.substr(0, 2)}/${uuid}.m3u8"}` + attachment_json: `{"img":"", "name": "${values.attachment_json.file.name}", "url": "down/Syzx/${uuid?.substr(0, 2)}/${uuid}.mp4"}` }); handleCreateModalVisible(false); // 隐藏创建窗口 actionRef.current?.reloadAndRest?.(); diff --git a/admin/src/pages/examinationrules/attestation/index.tsx b/admin/src/pages/examinationrules/attestation/index.tsx index c90d54e..860a232 100644 --- a/admin/src/pages/examinationrules/attestation/index.tsx +++ b/admin/src/pages/examinationrules/attestation/index.tsx @@ -110,7 +110,7 @@ const ExaminationRules: React.FC = () => { width: 48, }, { - title: '规则名称', + title: '资质考试名称', dataIndex: 'rules_name', valueType: 'text', hideInTable: false, @@ -118,7 +118,7 @@ const ExaminationRules: React.FC = () => { hideInSearch: true, }, { - title: '考试时长', + title: '考试时间', width: 80, dataIndex: 'examination_time', valueType: 'text', @@ -269,7 +269,7 @@ const ExaminationRules: React.FC = () => { history.push('/examinationrules/attestation/step') }} > - 新建考试规则 + 新建资质考试规则 , ]} 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 d7d7a46..da15405 100644 --- a/admin/src/pages/examinationrules/normal/components/AutoSelector.tsx +++ b/admin/src/pages/examinationrules/normal/components/AutoSelector.tsx @@ -78,7 +78,7 @@ const AutoSelector = (props: any, ref: any) => { //key: 'code', dataIndex: `type${item?.code}`, render: ( item, { defaultRender, ...rest }, form) => { - return { // const _data = []; @@ -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) }} />; }, @@ -140,20 +141,6 @@ const AutoSelector = (props: any, ref: any) => { // setDataSource }} toolBarRender={false} -/* - editable={{ - type: 'multiple', - //editableKeys, - actionRender: (row, config, defaultDoms) => { - return [defaultDoms.delete]; - }, - onValuesChange: (record, recordList) => { - console.log('rrrr',record, recordList) - // setDataSource(recordList); - }, - //onChange: setEditableRowKeys, - }} -*/ /> ); diff --git a/admin/src/pages/examinationrules/normal/index.tsx b/admin/src/pages/examinationrules/normal/index.tsx index 2ba0cc0..8ebf588 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 60b2460..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; }} @@ -354,19 +374,15 @@ export default () => { {rulesName} {/** 一旦录入另一项将禁用,清空组卷后可选另一项 */} - { - setCreateType(Number(e?.target?.value)) - console.log('value', e?.target?.value) - //handleAutoModalVisible(true); // 显示系统组卷窗口 - }} style={{ marginBottom: 16, }}> - 手动组卷 - 系统组卷 - + + + + - + {questions && { + } + {!questions && + + }
试卷信息与设置 - 共 {'-'} 题 {'-'} 分 + 共 {'0'} 题 {'-'} 分 {questionType.map((item) => { @@ -436,19 +456,6 @@ export default () => { )} - - - + }}>确定修改
diff --git a/web/src/pages/registration/index.tsx b/web/src/pages/registration/index.tsx index f758655..0ab99cf 100644 --- a/web/src/pages/registration/index.tsx +++ b/web/src/pages/registration/index.tsx @@ -16,7 +16,7 @@ import ProCard from '@ant-design/pro-card'; import { Button, Col, message, Row } from 'antd'; import { PageContainer } from '@ant-design/pro-layout'; import ProDescriptions from '@ant-design/pro-descriptions'; -import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo } from './service'; +import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo,checkExaminationPersonID } from './service'; import cookie from 'react-cookies'; import styles from './index.less' @@ -85,12 +85,23 @@ export default () => { description: false, }} onFinish={async (values) => { - // console.log('values',values); - // console.log(formRef.current?.getFieldsValue()); - // await waitTime(2000); - setBaseInfo(values); - return true; - }} + try { + const info = await checkExaminationPersonID({ + examination_id:params.examination_id, + id_code:values.idCard + }); + setBaseInfo(values); + return true; + }catch (error) { + if(error.response){ + message.error(error.response.info); + }else { + message.error('填写失败,请重新填写!'); + } + return false; + } + + }} > @@ -123,16 +134,16 @@ export default () => { /> - - - + + + @@ -150,14 +161,14 @@ export default () => { value: '全日制本科', }, { - label: '硕士研究生及以上...', - value: '硕士研究生及以上...', + label: '硕士研究生及以上学历', + value: '硕士研究生及以上学历', }, ]} placeholder="请选择" /> - - + + { // console.log(formRef.current?.getFieldsValue()); // 跳转到指定路由 try { - const success = await savePersonSignUpInfo({ - address:baseInfo?.address, - birthday:baseInfo?.birthday, - bureau_id:backInfo?.bureau_id, - bureau_name:backInfo?.bureau_name, - city_id:backInfo?.city_id, - city_name:backInfo?.city_name, - district_id:backInfo?.district_id, - district_name:backInfo?.district_name, - education:baseInfo?.qualifications, - examination_id:params.examination_id, - gender:baseInfo?.sex, - id_code:baseInfo?.idCard, - identity_id:backInfo?.identity_id, - major:baseInfo?.major, - person_id:backInfo?.person_id, - person_name:backInfo?.person_name, - province_id:backInfo?.province_id, - province_name:backInfo?.province_name, - subject:baseInfo?.subject, - tel:baseInfo?.contact, - university:baseInfo?.graduation, + const success = await savePersonSignUpInfo({ + address:baseInfo?.address, + birthday:baseInfo?.birthday, + bureau_id:backInfo?.bureau_id, + bureau_name:backInfo?.bureau_name, + city_id:backInfo?.city_id, + city_name:backInfo?.city_name, + district_id:backInfo?.district_id, + district_name:backInfo?.district_name, + education:baseInfo?.qualifications, + examination_id:params.examination_id, + gender:baseInfo?.sex, + id_code:baseInfo?.idCard, + identity_id:backInfo?.identity_id, + major:baseInfo?.major, + person_id:backInfo?.person_id, + person_name:backInfo?.person_name, + province_id:backInfo?.province_id, + province_name:backInfo?.province_name, + subject:baseInfo?.subject, + tel:baseInfo?.contact, + university:baseInfo?.graduation, }); - const msg=testInfo.examination_start_time+','+testInfo.examination_end_time+','+testInfo.examination_name+','+success.admission_number; - history.push( '/registration/success/'+msg); - }catch (error) { - if(error.response){ - message.error(error.response.info); - }else { - message.error('报名失败'); - } + const msg=testInfo.examination_start_time+','+testInfo.examination_end_time+','+testInfo.examination_name+','+success.admission_number; + history.push( '/registration/success/'+msg); + }catch (error) { + if(error.response){ + message.error(error.response.info); + }else { + message.error('报名失败'); + } } diff --git a/web/src/pages/registration/service.ts b/web/src/pages/registration/service.ts index 6fe6a79..18e13aa 100644 --- a/web/src/pages/registration/service.ts +++ b/web/src/pages/registration/service.ts @@ -50,3 +50,11 @@ export async function savePersonSignUpInfo(data: { [key: string]: any }, options ...(options || {}), }); } + +//身份证重复校验/dsideal_yy/zygh/training/person/checkExaminationPersonID +export async function checkExaminationPersonID(params: { +}) { + return request('/dsideal_yy/zygh/training/person/checkExaminationPersonID', { + params, + }); +}