|
|
@ -206,7 +206,7 @@ class ExamPaperAdd extends Component<any, States> { |
|
|
|
// 手动选题
|
|
|
|
// 手动选题
|
|
|
|
handleOpenModal = () => { |
|
|
|
handleOpenModal = () => { |
|
|
|
const { questions, selectedQuestionList } = this.state; |
|
|
|
const { questions, selectedQuestionList } = this.state; |
|
|
|
this.formRef.current.validateFields(['industryId']) |
|
|
|
this.formRef.current.validateFields(['industryId', 'questionCount']) |
|
|
|
.then((values: any) => { |
|
|
|
.then((values: any) => { |
|
|
|
const industryId = values.industryId; |
|
|
|
const industryId = values.industryId; |
|
|
|
const questionCount = values.questionCount; |
|
|
|
const questionCount = values.questionCount; |
|
|
@ -313,7 +313,6 @@ class ExamPaperAdd extends Component<any, States> { |
|
|
|
if (this.formRefSub.current) { |
|
|
|
if (this.formRefSub.current) { |
|
|
|
this.formRefSub.current.resetFields(); |
|
|
|
this.formRefSub.current.resetFields(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.formRef.current.setFieldsValue({ questionCount : selectedQuestionList.length }); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 保存试卷
|
|
|
|
// 保存试卷
|
|
|
@ -367,7 +366,7 @@ class ExamPaperAdd extends Component<any, States> { |
|
|
|
selectedRowKeys, |
|
|
|
selectedRowKeys, |
|
|
|
skipValidation, |
|
|
|
skipValidation, |
|
|
|
questionCountSum, |
|
|
|
questionCountSum, |
|
|
|
total |
|
|
|
selectedParams |
|
|
|
} = this.state; |
|
|
|
} = this.state; |
|
|
|
|
|
|
|
|
|
|
|
const changePage = (current: number, pageSize: number) => { |
|
|
|
const changePage = (current: number, pageSize: number) => { |
|
|
@ -695,7 +694,7 @@ class ExamPaperAdd extends Component<any, States> { |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<h3 style={{fontWeight: 'bold'}}>已选列表</h3> |
|
|
|
<h3 style={{fontWeight: 'bold'}}>已选列表</h3> |
|
|
|
<div style={{textAlign: 'right'}}> |
|
|
|
<div style={{textAlign: 'right'}}> |
|
|
|
{selectedQuestionList.length}/{total} |
|
|
|
{selectedQuestionList.length}/{selectedParams.questionCount} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Table |
|
|
|
<Table |
|
|
|
dataSource={selectedQuestionList} |
|
|
|
dataSource={selectedQuestionList} |
|
|
@ -777,6 +776,10 @@ class ExamPaperAdd extends Component<any, States> { |
|
|
|
item => !deselectedIds.includes(item.id) |
|
|
|
item => !deselectedIds.includes(item.id) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(finalSelectedQuestionList.length > selectedParams.questionCount){ |
|
|
|
|
|
|
|
message.warning('选择的问题数量超过了允许的最大题目数量'); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
const selectedRowKeys = finalSelectedQuestionList.map(item => String(item.id)); |
|
|
|
const selectedRowKeys = finalSelectedQuestionList.map(item => String(item.id)); |
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
selectedQuestionList: finalSelectedQuestionList, |
|
|
|
selectedQuestionList: finalSelectedQuestionList, |
|
|
|