From 65e7c3231e09ed30c781cdae88dd501ca4b765c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 14:12:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E5=8F=91?= =?UTF-8?q?=E9=80=81=E8=87=B3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/paths/PathDetail/sendPanel.js | 51 ++++++++++++++++--- .../Collaborators/Collaborators.js | 15 +++--- 2 files changed, 52 insertions(+), 14 deletions(-) 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(
@@ -178,7 +206,7 @@ class sendPanel extends Component{
- + { sendToCourseList && sendToCourseList.stages.map((item,key)=>{ @@ -197,7 +225,16 @@ class sendPanel extends Component{
-

已选择 {shixunNum} 个实训

+
+ + + this.allChange(e)} + >全选 + + +
+

已选择 {this.state.sendToShixunArray.length} 个实训

取消 确定 diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index 7811d12fd..95ce4b8aa 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -532,13 +532,14 @@ class Collaborators extends Component {
- - 全选 -
- 请至少选择一个用户 -
-
+ + + 全选 +
+ 请至少选择一个用户 +
+