diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js index 07d17d1eb..e874944ed 100644 --- a/public/react/src/modules/question/Questionitem_banks.js +++ b/public/react/src/modules/question/Questionitem_banks.js @@ -236,6 +236,10 @@ class Questionitem_banks extends Component { this.scrollToAnchor("Itembankstopid"); return; } + + + console.log("preservation"); + console.log(this.contentMdRef.Getdatas()); if (this.state.item_type === null) { diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index ac2765b1b..2f7b1f8cd 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -48,6 +48,7 @@ class Itembankstop extends Component { page:1, Knowpoints:[], rbtx:undefined, + rbkc:undefined, knowledgepoints:[], options:[], } @@ -60,9 +61,10 @@ class Itembankstop extends Component { } this.setState({ - knowledgepoints:this.props.knowledgepoints, options:this.props.disciplmy }) + // knowledgepoints:this.props.knowledgepoints, + ////console.log("componentDidMount"); ////console.log(this.state); ////console.log(this.props); @@ -96,11 +98,11 @@ class Itembankstop extends Component { } - if(prevProps.knowledgepoints !== this.props.knowledgepoints){ - this.setState({ - knowledgepoints:this.props.knowledgepoints - }) - } + // if(prevProps.knowledgepoints !== this.props.knowledgepoints){ + // this.setState({ + // knowledgepoints:this.props.knowledgepoints + // }) + // } if(prevProps.disciplmy !== this.props.disciplmy){ this.setState({ @@ -124,7 +126,19 @@ class Itembankstop extends Component { if (!err) { // ////console.log("获取的form 数据"); // ////console.log(values); - data= values; + data.push({ + rbnd:values.rbnd + }) + data.push({ + rbtx:values.rbtx + }) + data.push({ + rbzsd:this.state.Knowpoints + }) + data.push({ + rbkc:values.rbkc + }) + } }); @@ -160,14 +174,16 @@ class Itembankstop extends Component { //课程 ////console.log("课程"); ////console.log(value); + var valuename=undefined; this.props.form.setFieldsValue({ - rbkc:value, + rbzsd:value, }); var arr= this.state.knowledgepoints; for(let data of arr) { if(data.id===value){ this.state.Knowpoints.push(data); + valuename=data.name; } } @@ -179,6 +195,7 @@ class Itembankstop extends Component { } this.setState({ + rbzsd:valuename, Knowpoints:this.state.Knowpoints, knowledgepoints:this.state.knowledgepoints, }) @@ -188,7 +205,7 @@ class Itembankstop extends Component { handleFormzhishidian=(value)=>{ //课程 this.props.form.setFieldsValue({ - rbzsd:value, + rbkc:value, }); // console.log("handleFormzhishidian"); @@ -226,8 +243,11 @@ class Itembankstop extends Component { }) this.props.form.setFieldsValue({ - rbkc:undefined, + rbzsd:undefined, }); + this.setState({ + rbzsd:undefined, + }) } handleFormtixing=(value)=>{ @@ -271,6 +291,23 @@ class Itembankstop extends Component { this.setState({ Knowpoints:this.state.Knowpoints, }) + + if(this.state.Knowpoints.length===0){ + this.setState({ + rbzsd:undefined, + }) + } else if(this.state.Knowpoints.length>0){ + try { + const myknowda=this.state.Knowpoints; + this.setState({ + rbzsd:myknowda[this.state.Knowpoints.length-1].name, + }) + }catch (e) { + + } + + } + } @@ -319,14 +356,14 @@ class Itembankstop extends Component { - {getFieldDecorator("rbzsd", + {getFieldDecorator("rbkc", { rules: [{ required: true, message: '请选择课程' }], } )(
- + @@ -356,14 +393,14 @@ class Itembankstop extends Component { - {getFieldDecorator("rbkc", + {getFieldDecorator("rbzsd", { rules: [{ required: true, message: '请选择知识点' }], } )(
- {this.state.knowledgepoints&&this.state.knowledgepoints.map((object, index) => { return (