zhengpengju 3 years ago
parent e0a077a12b
commit ba49ecb98e

@ -182,7 +182,7 @@ export default defineConfig({
component: './examinationrules/attestation', component: './examinationrules/attestation',
}, },
{ {
name: '创建资质考试规则维护', name: '新建资质考试规则',
icon: 'smile', icon: 'smile',
path: '/examinationrules/attestation/step', path: '/examinationrules/attestation/step',
component: './examinationrules/attestation/step', component: './examinationrules/attestation/step',
@ -235,7 +235,7 @@ export default defineConfig({
}, },
{ {
icon: 'table', icon: 'table',
name: '生涯考试历史', name: '生涯考试历史统计',
path: '/history/analysis', path: '/history/analysis',
component: './history/analysis', component: './history/analysis',
}, },

@ -90,13 +90,13 @@ const AutoSelector = (props: any, ref: any) => {
<> <>
<Row><Col style={{padding:10}}></Col></Row> <Row><Col style={{padding:10}}></Col></Row>
<Row style={{padding:5}}> <Row style={{padding:5}}>
<Col offset={1} span={5}>{`常规题库 ( ${normalQuestionSum} 道题)`}</Col> <Col offset={1} span={5}><span style={{lineHeight:'32px'}}>{`常规题库 ( ${normalQuestionSum} 道题)`}</span></Col>
<Col offset={1} span={10}>: <InputNumber defaultValue={50} style={{textAlign:'center'}} value={questionCount[0]} onChange={(value)=>{ <Col offset={1} span={10}>: <InputNumber defaultValue={50} style={{textAlign:'center'}} value={questionCount[0]} onChange={(value)=>{
setQuestionCount([value, 100 - value]) setQuestionCount([value, 100 - value])
}} /> %</Col> }} /> %</Col>
</Row> </Row>
<Row style={{padding:5}}> <Row style={{padding:5}}>
<Col offset={1} span={5}>{`资质考试题库 ( ${attestationQuestionSum} 道题)`}</Col> <Col offset={1} span={5}><span style={{lineHeight:'32px'}}>{`资质考试题库:: ( ${attestationQuestionSum} 道题)`}</span></Col>
<Col offset={1} span={10}>: <InputNumber defaultValue={50} style={{textAlign:'center'}} value={questionCount[1]} onChange={(value)=>{ <Col offset={1} span={10}>: <InputNumber defaultValue={50} style={{textAlign:'center'}} value={questionCount[1]} onChange={(value)=>{
setQuestionCount([100 - value, value]) setQuestionCount([100 - value, value])
}} /> %</Col> }} /> %</Col>

@ -126,7 +126,7 @@ const ExaminationRules: React.FC = () => {
hideInTable: false, hideInTable: false,
hideInForm: false, hideInForm: false,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val} 分钟`,
}, },
{ {
title: '关联主题', title: '关联主题',
@ -189,7 +189,7 @@ const ExaminationRules: React.FC = () => {
valueType: 'text', valueType: 'text',
hideInSearch: true, hideInSearch: true,
hideInForm: false, hideInForm: false,
renderText: (val: string) => `${val || '-'}`, renderText: (val: string) => `${val || '-'}`,
}, },
{ {
title: '通过线', title: '通过线',
@ -199,7 +199,7 @@ const ExaminationRules: React.FC = () => {
valueType: 'text', valueType: 'text',
hideInSearch: true, hideInSearch: true,
hideInForm: false, hideInForm: false,
renderText: (val: string) => `${val || '-'}`, renderText: (val: string) => `${val || '-'}`,
}, },
{ {
title: '操作', title: '操作',

@ -189,7 +189,13 @@ export default () => {
question_count: '50,50', // 当前数据库没保存,只能采用默认 question_count: '50,50', // 当前数据库没保存,只能采用默认
question_type_count: _type_count?.toString() question_type_count: _type_count?.toString()
} }
) )
if(success){
message.success('试卷生成成功')
}else{
message.success('试卷生成失败')
}
}} }}
style={{fontSize:14, padding:'0 2px 0 0'}} style={{fontSize:14, padding:'0 2px 0 0'}}
> >
@ -282,7 +288,7 @@ export default () => {
<ProFormText <ProFormText
name="rules_name" name="rules_name"
label="考试名称" label="考试名称"
width="md" width="lg"
fieldProps={{ fieldProps={{
type: 'text', type: 'text',
allowClear: false, allowClear: false,
@ -304,7 +310,7 @@ export default () => {
/> />
<ProFormSelect <ProFormSelect
width="md" width="lg"
initialValue={ruleData.subject_id} initialValue={ruleData.subject_id}
request={async () => { request={async () => {
return querySubjectList().then(({ data }) => { return querySubjectList().then(({ data }) => {
@ -321,9 +327,28 @@ export default () => {
name="subject_id" name="subject_id"
label="关联主题" label="关联主题"
/> />
<ProFormText addonAfter={`分钟`} name="examination_time" label="考试时" <ProFormText addonAfter={`分钟`} name="examination_time" label="考试时"
initialValue={ruleData.examination_time} initialValue={ruleData.examination_time}
rules={[{ required: true, message: '请输入考试时长' }]} rules={[{ required: true, message: '请输入考试时间' }]}
fieldProps={{
type: 'number',
min:1,
allowClear: false,
width: 'large',
onInput:(e)=>{
const val = `${e.currentTarget?.value}`;
console.log('val', val)
console.log('val.charAt(0)', val.charAt(0))
if(val.charAt(0) === ''){
console.log('vvv', val)
e.currentTarget.value = ''
}
if(val.length > 3) {
e.currentTarget.value = val.slice(0,3)
}
},
//style: {marginRight:3}
}}
// tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。" // tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。"
/> />
<Row style={{marginBottom:24,marginTop:-7}}> <Row style={{marginBottom:24,marginTop:-7}}>
@ -331,14 +356,35 @@ export default () => {
</Row> </Row>
<ProFormText name="paper_count" label="试卷数量" <ProFormText name="paper_count" label="试卷数量"
width='lg'
initialValue={ruleData.paper_count} initialValue={ruleData.paper_count}
rules={[{ required: true, message: '请输入数量' }]} rules={[{ required: true, message: '请输入试卷数量' }]}
fieldProps={{
type: 'number',
min:1,
allowClear: false,
//width: 'large',
onInput:(e)=>{
const val = `${e.currentTarget?.value}`;
console.log('val', val)
console.log('val.charAt(0)', val.charAt(0))
if(val.charAt(0) === ''){
console.log('vvv', val)
e.currentTarget.value = ''
}
if(val.length > 3) {
e.currentTarget.value = val.slice(0,3)
}
},
//style:{width: '100%'}
}}
// tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。" // tooltip="限制考试时长的情况下,用户考试中离开,倒计时不会停止。"
/> />
<Row style={{marginBottom:24,marginTop:-7}}> <Row style={{marginBottom:24,marginTop:-7}}>
<Col offset={8} style={{color:'#bfbfbf'}}></Col> <Col offset={8} style={{color:'#bfbfbf'}}></Col>
</Row> </Row>
<ProFormDateRangePicker name="dateRange" label="试卷有效期" initialValue={[ruleData.start_time, ruleData.end_time]} rules={[{ required: true, message: '请输试卷有效期' }]} /> {console.log('###', ruleData)}
<ProFormDateRangePicker width='lg' name="dateRange" label="试卷有效期" initialValue={ (ruleData?.start_time && ruleData?.end_time) ? [ruleData?.start_time, ruleData?.end_time] : []} rules={[{ required: true, message: '请输试卷有效期' }]} />
<Row style={{marginBottom:24,marginTop:-7}}> <Row style={{marginBottom:24,marginTop:-7}}>
<Col offset={8} style={{color:'#bfbfbf'}}></Col> <Col offset={8} style={{color:'#bfbfbf'}}></Col>
</Row> </Row>
@ -372,13 +418,14 @@ export default () => {
options={false} options={false}
search={false} search={false}
toolBarRender={() => ( toolBarRender={() => (
<Space style={{margin:-24}} > <Space style={{margin:-48}} >
<Button <Button
type="primary" type="primary"
key="primary" key="primary"
onClick={() => { onClick={() => {
handleAutoModalVisible(true) handleAutoModalVisible(true)
}} }}
style={{marginRight:5}}
> >
<PlusOutlined /> <PlusOutlined />
</Button> </Button>

@ -584,7 +584,7 @@ const QuestionBank = () => {
<Space direction="horizontal" size="large"> <Space direction="horizontal" size="large">
<Typography>{record?.create_time}</Typography> <Typography>{record?.create_time}</Typography>
<Typography>{record?.tag_name}</Typography> <Typography>{record?.tag_name}</Typography>
<Typography>{record?.course_name}</Typography> <Typography>{record?.course_name}</Typography>
</Space> </Space>
</Col> </Col>
<Col flex={1} style={{textAlign:'right'}}> <Col flex={1} style={{textAlign:'right'}}>

Loading…
Cancel
Save