diff --git a/src/components/CustomPages/SE/SE018EditPage.js b/src/components/CustomPages/SE/SE018EditPage.js index ee3b436..122f786 100644 --- a/src/components/CustomPages/SE/SE018EditPage.js +++ b/src/components/CustomPages/SE/SE018EditPage.js @@ -372,7 +372,8 @@ class SE018EditPage extends React.Component { showUserSign(it.Nav_User, config.picServerHost) } - {this.state.isExam && {this.state.data.Nav_Papers.find(item => item.USER_ID == it.USER_ID)?.SCORE}} + {/* {this.state.isExam && {this.state.data.Nav_Papers.find(item => item.USER_ID == it.USER_ID)?.SCORE}} */} + {this.state.isExam && {it?.SCORE}}
this.showDetailModal(it.RECORD_ID, it.USER_ID)}>
}) diff --git a/src/components/CustomPages/SE/SE018PaperPage.js b/src/components/CustomPages/SE/SE018PaperPage.js index e89bce2..7ef89e6 100644 --- a/src/components/CustomPages/SE/SE018PaperPage.js +++ b/src/components/CustomPages/SE/SE018PaperPage.js @@ -62,8 +62,11 @@ class SE018PaperPage extends React.Component { let json = initFilter(this.props.login.OrgId); json.Parameter22 = this.props.data.ORG_ID_HV; json.OrgType = 2; - // extendRule(json, 'RECORD_ID', 1, this.props.data.id); - extendRule(json, 'TEXT_ID', 1, this.props.data.id); + if (this.props.data.TaskID) { + extendRule(json, 'TEXT_ID', 1, this.props.data.id); + } else { + extendRule(json, 'RECORD_ID', 1, this.props.data.id); + } extendInclude(json, 'Nav_User'); this.state.loading = true; this.props.dispatch({ @@ -108,12 +111,18 @@ class SE018PaperPage extends React.Component { return; } - - let json = initFilter(this.props.login.OrgId, '', 'Nav_Test.TYPE', 1); + var scort = 'Nav_Test.TYPE' + if (!this.props.data.TaskID) { + scort = 'TEXT_ID' + } + let json = initFilter(this.props.login.OrgId, '', scort, 1); json.Parameter22 = this.props.data.ORG_ID_HV; json.OrgType = 2; - // extendRule(json, 'RECORD_ID', 1, this.props.data.id); - extendRule(json, 'TEXT_ID', 1, this.props.data.id); + if (this.props.data.TaskID) { + extendRule(json, 'TEXT_ID', 1, this.props.data.id); + } else { + extendRule(json, 'RECORD_ID', 1, this.props.data.id); + } extendRule(json, 'USER_ID', 1, SelUsrID); extendInclude(json, 'Nav_Record'); extendInclude(json, 'Nav_Record.Nav_Notify'); @@ -185,17 +194,25 @@ class SE018PaperPage extends React.Component { let data = { Nav_Config: JSON.parse(JSON.stringify(this.state.config)), Nav_Papers: JSON.parse(JSON.stringify(this.state.papers)), - TaskID: this.props.data.TaskID + TaskID: this.props.data.TaskID, + TEXT_ID: this.props.data.id, } this.props.dispatch({ type: 'app/getDataByPost', payload: data, url: 'SE/SETrainRecord/SavePapers', onComplete: (ret) => { - if (ret) { - message.success('提交成功'); - this.BtnClose(); + if (ret && ret.IsOperateSuccessful) { + // message.success('提交成功'); + if (ret.IsPass) { + message.success(ret.Msg) + } else { + message.warn(ret.Msg) + } + } else { + message.error('提交失败,请稍后重试'); } + this.BtnClose(); } }); } @@ -283,39 +300,48 @@ class SE018PaperPage extends React.Component { if (!this.state.readonly) { return ""; } + let score = 0; - let sscore = 1; - let mscore = 1; - let cscore = 1; - if (this.state.config) { - if (this.state.config.S_TEST_SCORE > 0) { - sscore = this.state.config.S_TEST_SCORE; + // let sscore = 1; + // let mscore = 1; + // let cscore = 1; + // if (this.state.config) { + // if (this.state.config.S_TEST_SCORE > 0) { + // sscore = this.state.config.S_TEST_SCORE; + // } + // if (this.state.config.M_TEST_SCORE > 0) { + // mscore = this.state.config.M_TEST_SCORE; + // } + // if (this.state.config.C_TEST_SCORE > 0) { + // cscore = this.state.config.C_TEST_SCORE; + // } + // } + // this.state.papers.map((it, idx) => { + // if (it.ANSWER !== 0 && it.ANSWER == it.Nav_Test.ANSWER) { + // switch (it.Nav_Test.TYPE) { + // case 0: { + // score += cscore; + // break; + // } + // case 1: { + // score += sscore; + // break; + // } + // case 2: { + // score += mscore; + // break; + // } + // } + // } + // }) + // forEach (this.state.papers, (it, idx) => { + // this.state.papers + // }); + this.state.papers.forEach(element => { + if (score < element.SCORE) { + score = element.SCORE; } - if (this.state.config.M_TEST_SCORE > 0) { - mscore = this.state.config.M_TEST_SCORE; - } - if (this.state.config.C_TEST_SCORE > 0) { - cscore = this.state.config.C_TEST_SCORE; - } - } - this.state.papers.map((it, idx) => { - if (it.ANSWER !== 0 && it.ANSWER == it.Nav_Test.ANSWER) { - switch (it.Nav_Test.TYPE) { - case 0: { - score += cscore; - break; - } - case 1: { - score += sscore; - break; - } - case 2: { - score += mscore; - break; - } - } - } - }) + }); return score; } getType(type) { @@ -450,12 +476,12 @@ class SE018PaperPage extends React.Component { { it.Nav_Test.TYPE === 1 ? - this.doOptionChange(it, idx, 1, evt)} /> + this.doOptionChange(it, idx, 1, evt)} >A.{it.Nav_Test.OPTION_A} : - this.doOptionChange(it, idx, 1, evt)} /> + this.doOptionChange(it, idx, 1, evt)} >A.{it.Nav_Test.OPTION_A} } - A. - {it.Nav_Test.OPTION_A} + {/* A.{it.Nav_Test.OPTION_A} + */} } @@ -471,12 +497,12 @@ class SE018PaperPage extends React.Component { { it.Nav_Test.TYPE === 1 ? - this.doOptionChange(it, idx, 2, evt)} /> + this.doOptionChange(it, idx, 2, evt)} >B.{it.Nav_Test.OPTION_B} : - this.doOptionChange(it, idx, 2, evt)} /> + this.doOptionChange(it, idx, 2, evt)} >B.{it.Nav_Test.OPTION_B} } - B. - {it.Nav_Test.OPTION_B} + {/* B.{it.Nav_Test.OPTION_B} + */} } @@ -486,12 +512,12 @@ class SE018PaperPage extends React.Component { { it.Nav_Test.TYPE === 1 ? - this.doOptionChange(it, idx, 4, evt)} /> + this.doOptionChange(it, idx, 4, evt)} >C.{it.Nav_Test.OPTION_C} : - this.doOptionChange(it, idx, 4, evt)} /> + this.doOptionChange(it, idx, 4, evt)} >C.{it.Nav_Test.OPTION_C} } - C. - {it.Nav_Test.OPTION_C} + {/* C. + {it.Nav_Test.OPTION_C} */} } @@ -501,12 +527,12 @@ class SE018PaperPage extends React.Component { { it.Nav_Test.TYPE === 1 ? - this.doOptionChange(it, idx, 8, evt)} /> + this.doOptionChange(it, idx, 8, evt)} >D.{it.Nav_Test.OPTION_D} : - this.doOptionChange(it, idx, 8, evt)} /> + this.doOptionChange(it, idx, 8, evt)} >D.{it.Nav_Test.OPTION_D} } - D. - {it.Nav_Test.OPTION_D} + {/* D. + {it.Nav_Test.OPTION_D} */} } @@ -516,12 +542,12 @@ class SE018PaperPage extends React.Component { { it.Nav_Test.TYPE === 1 ? - this.doOptionChange(it, idx, 16, evt)} /> + this.doOptionChange(it, idx, 16, evt)} >E.{it.Nav_Test.OPTION_E} : - this.doOptionChange(it, idx, 16, evt)} /> + this.doOptionChange(it, idx, 16, evt)} >E.{it.Nav_Test.OPTION_E} } - E. - {it.Nav_Test.OPTION_E} + {/* E. + {it.Nav_Test.OPTION_E} */} } diff --git a/src/components/CustomPages/SE/SEConfigPage.js b/src/components/CustomPages/SE/SEConfigPage.js index f257d78..8ae331e 100644 --- a/src/components/CustomPages/SE/SEConfigPage.js +++ b/src/components/CustomPages/SE/SEConfigPage.js @@ -194,6 +194,19 @@ class SEConfigPage extends React.Component { 多选题总分 {data.M_TEST_COUNT * data.M_TEST_SCORE} + + 培训补考限制次数 + + { + let data = this.state.data; + data.COUNT_RETRY = value; + this.setState(data) + }} + > + + + 合格线