diff --git a/public/react/src/modules/paths/PathDetail/sendPanel.js b/public/react/src/modules/paths/PathDetail/sendPanel.js index 84c7d8e23..2f9059a18 100644 --- a/public/react/src/modules/paths/PathDetail/sendPanel.js +++ b/public/react/src/modules/paths/PathDetail/sendPanel.js @@ -15,7 +15,6 @@ class sendPanel extends Component{ openSearch:false, sendToCourseId:undefined, sendToShixunArray:[], - shixunNum:0, Modalstype:false, cardsModalcancel:this.cardsModalcancel, cardsModalsave:this.cardsModalsave, @@ -35,7 +34,9 @@ class sendPanel extends Component{ //隐藏发送至弹框 hideSenttothevalue =()=>{ this.setState({ - sentShixunPath:false + sentShixunPath:false, + sendToShixunArray:[], + sendToCourseId:undefined, }) } //打开课堂列表下拉框 @@ -63,7 +64,7 @@ class sendPanel extends Component{ changeCheckBoxs=(list)=>{ this.setState({ sendToShixunArray:list, - shixunNum:list.length + // shixunNum:list.length }) } @@ -86,7 +87,9 @@ class sendPanel extends Component{ Modalstype:true, sentShixunPath:false, Modalstopval:result.data.message, - courseurl:result.data.url + courseurl:result.data.url, + sendToShixunArray:[], + sendToCourseId:undefined, }) } }).catch((error)=>{ @@ -118,8 +121,33 @@ class sendPanel extends Component{ let {courseurl}=this.state; window.location.href =courseurl; } + + + allChange = (e) => { + + if(e.target.checked===false){ + this.setState({ + sendToShixunArray: [], + }) + }else{ + let { sendToCourseList} = this.state; + let newlist = []; + + sendToCourseList.stages.map((item,key)=>{ + item.shixuns.map((items,keys)=>{ + newlist.push(items.shixun_id) + }) + }) + + this.setState({ + sendToShixunArray: newlist, + }) + } + + } + render(){ - let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state; + let{sentShixunPath,sendToCourseList,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state; return(
已选择 {shixunNum} 个实训
+已选择 {this.state.sendToShixunArray.length} 个实训