master
zhengpengju 3 years ago
parent a2742e4c22
commit 465b37d59f

@ -110,7 +110,7 @@ const ExaminationRules: React.FC = () => {
width: 48, width: 48,
}, },
{ {
title: '规则名称', title: '资质考试名称',
dataIndex: 'rules_name', dataIndex: 'rules_name',
valueType: 'text', valueType: 'text',
hideInTable: false, hideInTable: false,
@ -118,7 +118,7 @@ const ExaminationRules: React.FC = () => {
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '考试时', title: '考试时',
width: 80, width: 80,
dataIndex: 'examination_time', dataIndex: 'examination_time',
valueType: 'text', valueType: 'text',
@ -269,7 +269,7 @@ const ExaminationRules: React.FC = () => {
history.push('/examinationrules/attestation/step') history.push('/examinationrules/attestation/step')
}} }}
> >
<PlusOutlined /> <PlusOutlined />
</Button>, </Button>,
]} ]}
request={async (value) => { request={async (value) => {

@ -18,6 +18,7 @@ import ScoreSetter from '../../components/ScoreSetter';
import AutoSelector from '../components/AutoSelector'; import AutoSelector from '../components/AutoSelector';
import QuestionSelector from '../../components/QuestionSelector'; import QuestionSelector from '../../components/QuestionSelector';
import { getSubjectInfo } from '@/pages/course/subject/service'; import { getSubjectInfo } from '@/pages/course/subject/service';
import { max } from 'lodash';
/** 选项序号 */ /** 选项序号 */
const labels = ['A','B','C','D','E','F','G','H','I','J','K']; const labels = ['A','B','C','D','E','F','G','H','I','J','K'];
@ -80,7 +81,7 @@ export default () => {
dataIndex: 'examination_time', dataIndex: 'examination_time',
valueType: 'text', valueType: 'text',
sorter: false, sorter: false,
hideInTable: false, hideInTable: true,
hideInForm: true, hideInForm: true,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val}`,
@ -93,9 +94,9 @@ export default () => {
hideInTable: false, hideInTable: false,
hideInForm: true, hideInForm: true,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => { render: (dom, record,index) => {
return <> return <>
{record.question_type_count.map((item)=>{return <span style={{paddingRight:15}}>{`${item.type_name} ${item.count}`}</span>})}
</> </>
}, },
}, },
@ -282,6 +283,18 @@ export default () => {
name="rules_name" name="rules_name"
label="考试名称" label="考试名称"
width="md" 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} initialValue={ruleData.rules_name}
// tooltip="最长为 6 位汉字,需要与考生身份证一致" // tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称" placeholder="请输入名称"

@ -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: '题干', title: '题干',
dataIndex: 'question_stem', dataIndex: 'question_stem',
valueType: 'text', valueType: 'text',
hideInTable: false, hideInTable: false,
hideInForm: true, hideInForm: true,
hideInSearch: false, hideInSearch: true,
}, },
]; ];
const match = useRouteMatch(); const match = useRouteMatch();

@ -125,7 +125,7 @@ const ScoreSetter = (props: any, ref: any) => {
width: 80, width: 80,
render: (text, _, index) => { render: (text, _, index) => {
return <> return <>
{(typeScore && questionTypeValues) ? typeScore[index]?.score * questionTypeValues[index]?.count : '0'} {(typeScore && questionTypeValues) ? (typeScore[index]?.score * questionTypeValues[index]?.count).toFixed(2) : '0'}
</> </>
}, },

@ -87,6 +87,7 @@ const AutoSelector = (props: any, ref: any) => {
_data.push({...item, score_harf: ((index === key) ? value : item?.score_harf)}) _data.push({...item, score_harf: ((index === key) ? value : item?.score_harf)})
}) })
setTypeScore(_data) setTypeScore(_data)
console.log('setTypeScore',typeScore)
}} }}
/></Form.Item>; /></Form.Item>;
}, },

@ -128,8 +128,10 @@ const ExaminationRules: React.FC = () => {
sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id }) sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id })
} }
console.log(sinfo, 'sinfo'); console.log(sinfo, 'sinfo');
const info = sinfo?.filter((item, idx, self)=>{
return sinfo; return item?.b_use === 1
});
return info;
}, },
}, },
{ {

@ -262,6 +262,18 @@ export default () => {
initialValue={ruleData?.rules_name} initialValue={ruleData?.rules_name}
// tooltip="最长为 6 位汉字,需要与考生身份证一致" // tooltip="最长为 6 位汉字,需要与考生身份证一致"
placeholder="请输入名称" 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={[ rules={[
{ required: true, message: '请输入考试名称' }, { required: true, message: '请输入考试名称' },
{ {
@ -345,7 +357,15 @@ export default () => {
console.log(formRef.current?.getFieldsValue()); console.log(formRef.current?.getFieldsValue());
setCurrentStep(2) // 设置步骤号 setCurrentStep(2) // 设置步骤号
//alert(params?.id || rulesId) //alert(params?.id || rulesId)
let msg = '操作成功'
if(!questions){
msg = '请选择试题'
message.error(msg);
return false;
}
// question 请选择试题 请选择试题
runPaper({ rules_id: params?.id || rulesId }) runPaper({ rules_id: params?.id || rulesId })
return true; return true;
}} }}
@ -427,7 +447,7 @@ export default () => {
<div style={{ background: '#ffffff', padding: 24 }}> <div style={{ background: '#ffffff', padding: 24 }}>
<Space direction="vertical" style={{ width: '100%' }}> <Space direction="vertical" style={{ width: '100%' }}>
<strong></strong> <strong></strong>
<Typography> {'-'} {'-'} </Typography> <Typography> {'0'} {'-'} </Typography>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} /> <Divider style={{ margin: '6px 0', opacity: 0.5 }} />
<Space direction="vertical"> <Space direction="vertical">
{questionType.map((item) => { {questionType.map((item) => {

@ -484,7 +484,7 @@ const QuestionBank = () => {
title: '题干', title: '题干',
search: false, search: false,
dataIndex: 'question_stem', dataIndex: 'question_stem',
render: (text: React.ReactNode, record: T, index: number) => (<><Text code style={{width:80, fontSize:10, color:'bfbfbf'}}>{record?.id}</Text> {text}</>), render: (text: React.ReactNode, record: T, index: number) => (<><Text code style={{width:80, fontSize:10, color:'bfbfbf',display:'none'}}>{record?.id}</Text> {text}</>),
}, },
avatar: { avatar: {
title: '题型', title: '题型',

Loading…
Cancel
Save