@ -447,7 +447,7 @@ export default () => {
< div style = { { background : '#ffffff' , padding : 24 } } >
< Space direction = "vertical" style = { { width : '100%' } } >
< strong > 试 卷 信 息 与 设 置 < / strong >
< Typography > 共 { '0' } 题 { '-' } 分 < / Typography >
< Typography > 共 { questions ? . length } 题 { '-' } 分 < / Typography >
< Divider style = { { margin : '6px 0' , opacity : 0.5 } } / >
< Space direction = "vertical" >
{ questionType . map ( ( item ) = > {
@ -504,11 +504,15 @@ export default () => {
//actionRef={actionRef}
title = { false }
request = { async ( ) = > {
const result = await queryRulesView ( params )
console . log ( 'rulesId...' , rulesId )
//{rules_id: rulesId}
console . log ( 'params...' , params )
const result = await queryRulesView ( { id : rulesId } )
console . log ( 'queryRulesView' , result )
const subjectInfo = await getSubjectInfo ( { subject_id : result.bean.subject_id } )
console . log ( 'subjectInfo' , subjectInfo )
return { data : { . . . result . bean , subject_name : subjectInfo.data.subject_name } } ;
} }
extra = { false }
>
@ -516,13 +520,12 @@ export default () => {
< ProDescriptions.Item dataIndex = "rules_name" label = "考试名称" valueType = "text" / >
< ProDescriptions.Item dataIndex = "subject_name" label = "关联主题" valueType = "text" / >
< ProDescriptions.Item dataIndex = "examination_time" label = "考试时长" valueType = "text" renderText = { ( text ) = > ( ` ${ text } 分钟 ` ) } / >
< ProDescriptions.Item dataIndex = "grade" label = "试卷信息" valueType = "text" render = { ( ) = > {
{ /** 需要从试卷 或 临时试卷 中读取 需要处理 */ }
{ /** 从试卷中读取 临时卷必须保存后才进入此页 */ }
return < Space direction = "vertical" >
< span > 共 0 道 题 , { paperInfo ? . sum_score } 分 < / span >
< span > 单 选 : 0 道 题 单 选 : 0 道 题 单 选 : 0 道 题 < / span >
< span > 通 过 线 { paperInfo ? . pass_score } 分 < / span >
< span > 共 { paperInfo ? . question_type_count ? . map ( item = > item . count ) ? . reduce ( ( prev , curr ) = > prev + curr ) } 道 题 , { paperInfo ? . sum_score || '-' } 分 < / span >
< span > { paperInfo ? . question_type_count ? . map ( item = > ( < span style = { { paddingRight :10 } } > { ` ${ item ? . type_name } ${ item ? . count } 道题 ` } < / span > ) ) } < / span >
< span > 通 过 线 { paperInfo ? . pass_score || '-' } 分 < / span >
< / Space >
} } / >
< / ProDescriptions >
@ -569,7 +572,8 @@ export default () => {
//console.log('111')
//const values = autoRef?.current?.getData()
//console.log('2222')
//const {code, data: paper, msg} = await autoPaper({rules_id: Number(params?.id), auto_param: JSON.stringify(values)})
const values = [ { "question_type" : 0 , "chapter_list" : [ { "chapter_id" : 76 , "count" : 1 } , { "chapter_id" : 77 , "count" : 1 } ] } ]
const { code , data : paper , msg } = await autoPaper ( { rules_id : Number ( params ? . id ) , auto_param : JSON.stringify ( values ) } )
//console.log('paper', paper)
//setUuidPaper(paper?.paper_uuid)
// message.success('提交成功');
@ -589,23 +593,13 @@ export default () => {
console . log ( 'typeQuestionCount' , typeQuestionCount )
const values = setterRef . current ? . getData ( ) // 获取题型分值数据
const passSocre = setterRef . current ? . getValue ( ) // 获取通过分数线
const sumCore = setterRef . current ? . getSum ( ) // 获取总分
console . log ( '批量设置分值v::::2' , values ) ;
// 题型分数
const { code , data : paper , msg } = await saveQuestionTypeScore ( { rules_id : Number ( params ? . id || rulesId ) , type_score : JSON.stringify ( values ) } )
// 总分及通过分
let _sumScore = 0 ;
values ? . forEach ( ( item ) = > {
console . log ( 'item--' , item )
_sumScore += item ? . score
} )
//console.log('_sumScore', _sumScore)
//console.log('passScore',passScore)
console . log ( 'sumScore' , sumScore )
const { success } = await updateScore ( { rules_id : Number ( params ? . id || rulesId ) , pass_socre : passSocre , sum_score : _sumScore } )
setSumScore ( _sumScore )
console . log ( 'paper' , paper )
const { success } = await updateScore ( { rules_id : Number ( params ? . id || rulesId ) , pass_socre : passSocre , sum_score : sumCore } )
//setSumScore(_sumScore)
//console.log('paper', paper)
// setUuidPaper(paper?.paper_uuid)
// message.success('提交成功');
handleScoreModalVisible ( false )