From 667d6aef03c548563b3776ee6ba7356f846774cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 6 Jan 2020 09:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A2=98=E5=BA=93=E8=AF=95?= =?UTF-8?q?=E5=8D=B7=E7=BC=96=E8=BE=91=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/Paperreview.js | 1 - .../modules/testpaper/Paperlibraryeditid.js | 28 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 75869c666..50a1a3c89 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -192,7 +192,6 @@ class Paperreview extends Component { } preservation = () => { //保存试卷 - debugger if(this.state.Cohetepaperbool===true){ if (this.contentMdRef.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 712566946..0b80e8bf8 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -141,7 +141,33 @@ class Paperlibraryeditid extends Component { } preservation = () => { //保存试卷 - + if (this.Judquestio.Getdatas().length === 0) { + this.scrollToAnchor("Itembankstopid"); + return; + } + var myrbkc=[]; + var Getdatasdatas=this.Judquestio.Getdatas()[2].rbzsd; + for(let myda of Getdatasdatas) { + myrbkc.push(myda.id); + } + const url = `/examination_banks/${this.props.match.params.id}.json`; + var data={ + difficulty:this.Judquestio.Getdatas()[0].rbnd, + name:this.Judquestio.Getdatas()[4].classroom, + duration:this.Judquestio.Getdatas()[5].kssc, + discipline_id: this.Judquestio.Getdatas()[3].rbkc[0], + sub_discipline_id: this.Judquestio.Getdatas()[3].rbkc[1], + tag_discipline_id: myrbkc, + } + axios.put(url, data) + .then((result) => { + if (result.data.status === 0) { + this.props.showNotification(`试卷更新成功`); + this.props.history.replace('./paperlibrary'); + } + }).catch((error) => { + console.log(error); + }) }