实践课程发送至完善

master
杨树明 5 years ago
parent ae79081ae0
commit 65e7c3231e

@ -15,7 +15,6 @@ class sendPanel extends Component{
openSearch:false, openSearch:false,
sendToCourseId:undefined, sendToCourseId:undefined,
sendToShixunArray:[], sendToShixunArray:[],
shixunNum:0,
Modalstype:false, Modalstype:false,
cardsModalcancel:this.cardsModalcancel, cardsModalcancel:this.cardsModalcancel,
cardsModalsave:this.cardsModalsave, cardsModalsave:this.cardsModalsave,
@ -35,7 +34,9 @@ class sendPanel extends Component{
//隐藏发送至弹框 //隐藏发送至弹框
hideSenttothevalue =()=>{ hideSenttothevalue =()=>{
this.setState({ this.setState({
sentShixunPath:false sentShixunPath:false,
sendToShixunArray:[],
sendToCourseId:undefined,
}) })
} }
//打开课堂列表下拉框 //打开课堂列表下拉框
@ -63,7 +64,7 @@ class sendPanel extends Component{
changeCheckBoxs=(list)=>{ changeCheckBoxs=(list)=>{
this.setState({ this.setState({
sendToShixunArray:list, sendToShixunArray:list,
shixunNum:list.length // shixunNum:list.length
}) })
} }
@ -86,7 +87,9 @@ class sendPanel extends Component{
Modalstype:true, Modalstype:true,
sentShixunPath:false, sentShixunPath:false,
Modalstopval:result.data.message, Modalstopval:result.data.message,
courseurl:result.data.url courseurl:result.data.url,
sendToShixunArray:[],
sendToCourseId:undefined,
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
@ -118,8 +121,33 @@ class sendPanel extends Component{
let {courseurl}=this.state; let {courseurl}=this.state;
window.location.href =courseurl; 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(){ render(){
let{sentShixunPath,sendToCourseList,openSearch,shixunNum,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state; let{sentShixunPath,sendToCourseList,Modalstype,Modalstopval,Modalsbottomval,cardsModalcancel,cardsModalsave}= this.state;
return( return(
<div> <div>
@ -178,7 +206,7 @@ class sendPanel extends Component{
</Select> </Select>
</div> </div>
<div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5"> <div className="edu-back-skyblue pl15 pr15 clearfix over280 pt5">
<CheckboxGroup onChange={this.changeCheckBoxs}> <CheckboxGroup onChange={this.changeCheckBoxs} value={this.state.sendToShixunArray}>
{ {
sendToCourseList && sendToCourseList.stages.map((item,key)=>{ sendToCourseList && sendToCourseList.stages.map((item,key)=>{
@ -197,7 +225,16 @@ class sendPanel extends Component{
</CheckboxGroup> </CheckboxGroup>
</div> </div>
<p className="color-grey-9 pl15 font-12 mt10">已选择 {shixunNum} 个实训</p> <div className="mt10 clearfix">
<span className="fl ml15">
<Checkbox className="fl"
onChange={(e)=>this.allChange(e)}
>全选</Checkbox>
</span>
</div>
<p className="color-grey-9 pl15 font-12 mt10">已选择 {this.state.sendToShixunArray.length} 个实训</p>
<div className="mt20 clearfix edu-txt-center"> <div className="mt20 clearfix edu-txt-center">
<a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a> <a onClick={this.hideSenttothevalue} className="pop_close task-btn mr30">取消</a>
<a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a> <a className="task-btn task-btn-orange" onClick={this.submitInfo}>确定</a>

@ -532,13 +532,14 @@ class Collaborators extends Component {
</Spin> </Spin>
</div> </div>
<div className="mt10 clearfix"> <div className="mt10 clearfix">
<span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox> <span className="fl mr15">
<div className="fl" style={{height: '27px'}}> <Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<span className="color-orange fl" id="add_teacher_notice" <div className="fl" style={{height: '27px'}}>
style={{display: Collaboratorslisttype === true ? 'inline' : 'none'}}>请至少选择一个用户</span> <span className="color-orange fl" id="add_teacher_notice"
</div> style={{display: Collaboratorslisttype === true ? 'inline' : 'none'}}>请至少选择一个用户</span>
</span> </div>
</span>
</div> </div>

Loading…
Cancel
Save