From 3910c8c6904d1fef7cbbb7e81acb681dbd35168c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 31 Dec 2019 12:42:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E7=BB=84=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/Paperreview.js | 41 +++++++---- .../comthetestpaper/Comthetestpapers.js | 73 +++---------------- 2 files changed, 37 insertions(+), 77 deletions(-) diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 36a48dea8..e66cdbe67 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -188,26 +188,41 @@ class Paperreview extends Component { } preservation = () => { + //保存试卷 - if(this.props.Cohetepaperbool===true){ + if(this.state.Cohetepaperbool===true){ if (this.contentMdRef.Getdatas().length === 0) { this.scrollToAnchor("Itembankstopid"); return; } - + console.log("this.contentMdRef.Getdatas()"); + console.log(this.contentMdRef.Getdatas()); + // var Getdatasdata = this.contentMdRef.Getdatas() + // var myrbkc=[]; + // var Getdatasdatas=Getdatasdata[2].rbzsd; + // for(let myda of Getdatasdatas) { + // myrbkc.push(myda.id); + // } + + // const url = `/examination_banks.json`; - var data={ - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - this.props.showNotification(`组卷成功`); - this.props.history.replace('./paperlibrary'); - } - }).catch((error) => { - console.log(error); - }) + // var data={ + // difficulty:this.contentMdRef.Getdatas()[0].rbnd, + // name:this.contentMdRef.Getdatas()[4].classroom, + // duration:this.contentMdRef.Getdatas()[5].kssc, + // duration:this.contentMdRef.Getdatas()[5].kssc, + // + // } + // axios.post(url, data) + // .then((result) => { + // if (result.data.status == 0) { + // this.props.showNotification(`组卷成功`); + // this.props.history.replace('./paperlibrary'); + // } + // }).catch((error) => { + // console.log(error); + // }) }else{ this.setCohetepaperbool(true); diff --git a/public/react/src/modules/question/comthetestpaper/Comthetestpapers.js b/public/react/src/modules/question/comthetestpaper/Comthetestpapers.js index a0e384a47..c4821b14b 100644 --- a/public/react/src/modules/question/comthetestpaper/Comthetestpapers.js +++ b/public/react/src/modules/question/comthetestpaper/Comthetestpapers.js @@ -20,28 +20,6 @@ import './../questioncss/questioncom.css'; const InputGroup = Input.Group; const {Option} = Select; -const options = [ - { - value: '方向', - label: '方向', - children: [ - { - value: '课程', - label: '课程', - }, - ], - }, - { - value: 'jiangsu', - label: 'Jiangsu', - children: [ - { - value: 'nanjing', - label: 'Nanjing', - }, - ], - }, -]; class Comthetestpapers extends Component { constructor(props) { @@ -64,52 +42,16 @@ class Comthetestpapers extends Component { } catch (e) { } + this.setState({ - options: this.props.disciplmy + options: this.props.disciplmy, + knowledgepoints: this.props.knowledgepoints, }) - // knowledgepoints:this.props.knowledgepoints, - - ////console.log("componentDidMount"); - ////console.log(this.state); - ////console.log(this.props); - // let homeworkid = this.props.match.params.homeworkid; - // let url = "/homework_commons/" + homeworkid + "/end_groups.json"; - // axios.get(url).then((response) => { - // if (response.status === 200) { - // this.setState({}) - // } - // }).catch((error) => { - // ////console.log(error) - // });() - // 题型 } - componentDidUpdate(prevProps) { - if (prevProps.item_banksedit !== this.props.item_banksedit) { - if (this.props.item_banksedit.item_type) { - this.handleFormtixing(this.props.item_banksedit.item_type); - } - if (this.props.item_banksedit.difficulty) { - this.handleFormLayoutChange(this.props.item_banksedit.difficulty); - } - if (this.props.item_banksedit.tag_disciplines) { - this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines); - } - - if (this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline) { - this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline); - } - } - if (prevProps.disciplmy !== this.props.disciplmy) { - this.setState({ - options: this.props.disciplmy - }) - } - - } handdisciplinesChange =(name,title)=>{ this.setState({ rbkc:[name.id,title.id] @@ -424,14 +366,17 @@ class Comthetestpapers extends Component { }; render() { - let {page} = this.state; + let {page,options} = this.state; const {getFieldDecorator} = this.props.form; - const options = this.state.searchlist && this.state.searchlist.map(d => ); + const optionss = this.state.searchlist && this.state.searchlist.map(d => ); var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom'); var addonAfteronelens3=0; if(addonAfterthree){ addonAfteronelens3=String(addonAfterthree).length; } + + console.log("Comthetestpapers.js"); + console.log(this.props); return (
@@ -563,7 +508,7 @@ class Comthetestpapers extends Component { style={{width: 704}} onSearch={this.handleSearch} className={"fl construction yslzxueshis "} - dataSource={options} + dataSource={optionss} >