From 6868513ec28fb361329b022a6705fa58748955f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 10 Jan 2020 15:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/modals/Bottomsubmit.js | 1 - .../question/component/IntelligentModel.js | 34 +++++- .../question/component/Itembankstop.js | 13 ++- .../comthetestpaper/Comthetestpaperst.js | 17 ++- .../comthetestpaper/Intelligentcomponents.js | 31 ++++- .../src/modules/testpaper/Intecomponents.js | 106 +++++++++++++++--- 6 files changed, 178 insertions(+), 24 deletions(-) diff --git a/public/react/src/modules/modals/Bottomsubmit.js b/public/react/src/modules/modals/Bottomsubmit.js index 670049003..16174c480 100644 --- a/public/react/src/modules/modals/Bottomsubmit.js +++ b/public/react/src/modules/modals/Bottomsubmit.js @@ -12,7 +12,6 @@ class Bottomsubmit extends Component { cannelfun = () => { // window.location.href= - debugger if(this.props.Cohetepaperbool===true){ this.props.setCohetepaperbool(false); }else { diff --git a/public/react/src/modules/question/component/IntelligentModel.js b/public/react/src/modules/question/component/IntelligentModel.js index 502e1938a..fecef37d0 100644 --- a/public/react/src/modules/question/component/IntelligentModel.js +++ b/public/react/src/modules/question/component/IntelligentModel.js @@ -24,7 +24,7 @@ class IntelligentModel extends Component { constructor(props) { super(props); this.state={ - + iconLoading:false, } } @@ -46,8 +46,12 @@ class IntelligentModel extends Component { }; Confirmationofvolumeformation=()=>{ + this.props.form.validateFields((err, values) => { if (!err) { + this.setState({ + iconLoading:true + }) const url=`/examination_intelligent_settings/${this.props.exam_id}/save_exam.json`; let data={ name:values.classroom, @@ -58,10 +62,21 @@ class IntelligentModel extends Component { if (result.data.status == 0) { console.log(result); this.props.history.push(`/paperlibrary`); + } + setTimeout(() => { + this.setState({ + iconLoading:false + }) + }, 1500) + }).catch((error) => { - console.log(error); - }) + setTimeout(() => { + this.setState({ + iconLoading:false + }) + }, 1500) + }) @@ -73,6 +88,7 @@ class IntelligentModel extends Component { render() { + let {iconLoading}=this.state; const {getFieldDecorator} = this.props.form; const optionss = this.state.searchlist && this.state.searchlist.map(d => ); var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom'); @@ -180,13 +196,21 @@ class IntelligentModel extends Component { -
提示:组卷完成后,在试卷库—我的试卷库查看!
+
提示:组卷完成后,在试卷库—我的试卷库查看!
this.props.Confirmationofvolumeformations()}>取消 - this.Confirmationofvolumeformation()}>确定 + +
) diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index 4b3cfa0f6..5a2fc7b9c 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -200,7 +200,7 @@ class Itembankstop extends Component { this.handleFormtixing(this.props.item_banksedit.item_type); } if (this.props.item_banksedit.difficulty) { - this.handleFormLayoutChange(this.props.item_banksedit.difficulty); + this.handleFormLayoutChangeysl(this.props.item_banksedit.difficulty); } if (this.props.item_banksedit.tag_disciplines) { this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines); @@ -366,7 +366,18 @@ class Itembankstop extends Component { }); } + handleFormLayoutChangeysl = (value) => { + //难度塞选 + ////console.log("难度塞选"); + ////console.log(value); + this.props.form.setFieldsValue({ + rbnd: value+ "", + }); + this.setState({ + rbnd: value + "", + }) + } handleFormLayoutChange = (e) => { //难度塞选 ////console.log("难度塞选"); diff --git a/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js b/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js index c3bc094c5..c01ae95c8 100644 --- a/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js +++ b/public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js @@ -131,7 +131,9 @@ class Comthetestpaperst extends Component { // this.handleFormtixing(this.props.item_banksedit.item_type); // } if (this.props.item_banksedit.difficulty) { - this.handleFormLayoutChange(this.props.item_banksedit.difficulty); + // this.handleFormLayoutChange(this.props.item_banksedit.difficulty); + this.handleFormLayoutChangeysl(this.props.item_banksedit.difficulty); + } if (this.props.item_banksedit.tag_disciplines) { this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines); @@ -330,11 +332,24 @@ class Comthetestpaperst extends Component { }); } + handleFormLayoutChangeysl = (value) => { + //难度塞选 + ////console.log("难度塞选"); + ////console.log(value); + this.props.form.setFieldsValue({ + rbnd: value + "", + }); + this.setState({ + rbnd: value + "", + }) + + } handleFormLayoutChange = (e) => { //难度塞选 ////console.log("难度塞选"); ////console.log(value); + this.props.form.setFieldsValue({ rbnd: e.target.value + "", }); diff --git a/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js b/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js index f80f44d66..43deace7d 100644 --- a/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js +++ b/public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js @@ -229,6 +229,12 @@ class Intelligentcomponents extends Component { rbly: e.target.value + "", }) + try { + this.props.getdatassssy(e.target.value); + }catch (e) { + + } + } handleFormLayoutChange = (e) => { // console.log("handleFormLayoutChange"); @@ -280,6 +286,12 @@ class Intelligentcomponents extends Component { knowledgepoints2: _result, }) + try { + this.props.getdatassss(this.state.Knowpoints); + }catch (e) { + + } + } handleFormzhishidian = (value) => { @@ -334,6 +346,12 @@ class Intelligentcomponents extends Component { this.setState({ rbzsd: undefined, }) + + try { + this.props.getdatasss(parseInt(value[1])); + }catch (e) { + + } } handleFormtixing = (value) => { @@ -353,7 +371,7 @@ class Intelligentcomponents extends Component { ////console.log('Clicked! But prevent default.'); } deletesobject = (item, index) => { - debugger + var tmp = this.state.Knowpoints; for (var i = 0; i < tmp.length; i++) { if (i ===index) { @@ -390,6 +408,12 @@ class Intelligentcomponents extends Component { } } + //删除知识点 + try { + this.props.getdatassss(this.state.Knowpoints); + }catch (e) { + + } } @@ -476,7 +500,12 @@ class Intelligentcomponents extends Component { }).catch((error) => { //console.log(error); }) + //新增知识点 + try { + this.getdatassss(this.state.Knowpoints); + }catch (e) { + } this.setState({ NewknTypedel:false }) diff --git a/public/react/src/modules/testpaper/Intecomponents.js b/public/react/src/modules/testpaper/Intecomponents.js index 60903af14..a69d7185b 100644 --- a/public/react/src/modules/testpaper/Intecomponents.js +++ b/public/react/src/modules/testpaper/Intecomponents.js @@ -110,6 +110,7 @@ class Intecomponents extends Component { } + //难度 getdatas=()=>{ if (this.Judquestio.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); @@ -129,25 +130,96 @@ class Intecomponents extends Component { difficulty:this.Judquestio.Getdatas()[0].rbnd, } - axios.post(url,data).then((response) => { - if (response) { - console.log("智能组卷"); - console.log(response); - if(response.data){ - this.setState({ - single_question_count:response.data.single_question_count, - multiple_question_count:response.data.multiple_question_count, - judgement_question_count:response.data.judgement_question_count, - program_question_count:response.data.program_question_count, - }) + this.getwangluodata(url,data); - } + } + //课程 + getdatasss=(kech)=>{ + if (this.Judquestio.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return false; + } + console.log(this.Judquestio.Getdatas()); + var myrbkc=[]; + var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; + for(let myda of Getdatasdatas) { + myrbkc.push(myda.id); + } + const url="/examination_intelligent_settings/optinal_items.json"; + var data={ + sub_discipline_id:kech, + tag_discipline_id:myrbkc, + source:this.Judquestio.Getdatas()[7].rbly, + difficulty:this.Judquestio.Getdatas()[0].rbnd, + } + + this.getwangluodata(url,data); - } - }); + } + //知识点 + getdatassss=(zhishidian)=>{ + if (this.Judquestio.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return false; + } + console.log(this.Judquestio.Getdatas()); + var myrbkc=[]; + var Getdatasdatas=zhishidian; + for(let myda of Getdatasdatas) { + myrbkc.push(myda.id); + } + const url="/examination_intelligent_settings/optinal_items.json"; + var data={ + sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], + tag_discipline_id:myrbkc, + source:this.Judquestio.Getdatas()[7].rbly, + difficulty:this.Judquestio.Getdatas()[0].rbnd, + } + this.getwangluodata(url,data); + } + //来源 + getdatassssy=(rbly)=>{ + if (this.Judquestio.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return false; + } + console.log(this.Judquestio.Getdatas()); + var myrbkc=[]; + var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; + for(let myda of Getdatasdatas) { + myrbkc.push(myda.id); + } + const url="/examination_intelligent_settings/optinal_items.json"; + var data={ + sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], + tag_discipline_id:myrbkc, + source:rbly, + difficulty:this.Judquestio.Getdatas()[0].rbnd, + } + this.getwangluodata(url,data); } + + getwangluodata=(url,data)=>{ + axios.post(url,data).then((response) => { + if (response) { + console.log("智能组卷"); + console.log(response); + if(response.data){ + this.setState({ + single_question_count:response.data.single_question_count, + multiple_question_count:response.data.multiple_question_count, + judgement_question_count:response.data.judgement_question_count, + program_question_count:response.data.program_question_count, + }) + + } + + } + }); + } + //难度 getdatass=(nandu)=>{ if (this.Judquestio.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); @@ -313,7 +385,10 @@ class Intecomponents extends Component { program_question_count={this.state.program_question_count} getdatas={()=>this.getdatas()} getdatass={(nd)=>this.getdatass(nd)} - getJudquestio={(ref) => this.getJudquestio(ref)} + getJudquestio={(ref) => this.getJudquestio(ref)} + getdatasss={(e)=>this.getdatasss(e)} + getdatassss={(e)=>this.getdatassss(e)} + getdatassssy={(e)=>this.getdatassssy(e)} > @@ -326,6 +401,7 @@ class Intecomponents extends Component { { newmyshixunmodelbool === true ? "" : this.setCohetepaperbool(bool)} onSubmits={() => this.preservation()} url={'/paperlibrary'}> }