|
|
@ -655,9 +655,9 @@ const QuestionBank = () => {
|
|
|
|
console.log('answertrue,,,',answertrue)
|
|
|
|
console.log('answertrue,,,',answertrue)
|
|
|
|
const answerTrueData = labels?.filter((x, idx, self)=>(`${answertrue[idx]}` === '1'))
|
|
|
|
const answerTrueData = labels?.filter((x, idx, self)=>(`${answertrue[idx]}` === '1'))
|
|
|
|
console.log('$$$', answerTrueData)
|
|
|
|
console.log('$$$', answerTrueData)
|
|
|
|
//Number(currentRow?.question_type) === 1 ? answerTrueData : answerTrueData[0]
|
|
|
|
const trueData = Number(currentRow?.question_type) === 1 ? answerTrueData : answerTrueData[0] // 处理单选和判断
|
|
|
|
|
|
|
|
|
|
|
|
return {...currentRow, answers: currentRow?.answers.map((item)=>(item.answer)), answertrue: answerTrueData }
|
|
|
|
return {...currentRow, answers: currentRow?.answers.map((item)=>(item.answer)), answertrue: trueData }
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onFinish={async (values: any) => {
|
|
|
|
onFinish={async (values: any) => {
|
|
|
|
// 表单处理
|
|
|
|
// 表单处理
|
|
|
@ -678,7 +678,6 @@ const QuestionBank = () => {
|
|
|
|
//question_type: currentRow?.question_type, // 题型
|
|
|
|
//question_type: currentRow?.question_type, // 题型
|
|
|
|
// subject_id: params?.id || 0,
|
|
|
|
// subject_id: params?.id || 0,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log('123', success)
|
|
|
|
|
|
|
|
if(success){
|
|
|
|
if(success){
|
|
|
|
handleUpdateModalVisible(false);
|
|
|
|
handleUpdateModalVisible(false);
|
|
|
|
actionRef.current?.reloadAndRest?.();
|
|
|
|
actionRef.current?.reloadAndRest?.();
|
|
|
|