|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import { Modal,Checkbox,Input} from "antd";
|
|
|
|
|
import { Modal,Checkbox,Input, Spin, Icon } from "antd";
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import Modals from '../../modals/Modals';
|
|
|
|
|
const CheckboxGroup = Checkbox.Group;
|
|
|
|
@ -23,6 +23,7 @@ class Addcourses extends Component{
|
|
|
|
|
modalsType:false,
|
|
|
|
|
modalsTopval:undefined,
|
|
|
|
|
modalSave:undefined,
|
|
|
|
|
isSpin:false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -144,17 +145,22 @@ class Addcourses extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submittojoinclass=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
let {invite_code,professor,assistant_professor,student}=this.state;
|
|
|
|
|
if(invite_code===undefined||invite_code===""){
|
|
|
|
|
this.setState({
|
|
|
|
|
invite_codetype:true,
|
|
|
|
|
invite_codevalue:"邀请码不能为空"
|
|
|
|
|
invite_codevalue:"邀请码不能为空",
|
|
|
|
|
spinning:false
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
invite_codetype:false,
|
|
|
|
|
invite_codevalue:" "
|
|
|
|
|
invite_codevalue:" ",
|
|
|
|
|
spinning:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -178,7 +184,12 @@ class Addcourses extends Component{
|
|
|
|
|
// // modalSave:this.submitasyn,
|
|
|
|
|
// course_id:response.data.course_id
|
|
|
|
|
// })
|
|
|
|
|
this.submitasyn(response.data.course_id)
|
|
|
|
|
if(response.data.course_id!=undefined){
|
|
|
|
|
this.submitasyn(response.data.course_id)
|
|
|
|
|
}
|
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
Addcoursestype:false
|
|
|
|
@ -193,8 +204,15 @@ class Addcourses extends Component{
|
|
|
|
|
// course_id:undefined
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
spinning:false
|
|
|
|
|
})
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
this.setState({
|
|
|
|
|
spinning:false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// if(value===0){
|
|
|
|
@ -258,7 +276,7 @@ class Addcourses extends Component{
|
|
|
|
|
modalsTopval,
|
|
|
|
|
modalSave
|
|
|
|
|
}=this.state;
|
|
|
|
|
|
|
|
|
|
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
|
|
|
|
|
return(
|
|
|
|
|
<div>
|
|
|
|
|
<Modals
|
|
|
|
@ -277,6 +295,7 @@ class Addcourses extends Component{
|
|
|
|
|
footer={null}
|
|
|
|
|
destroyOnClose={true}
|
|
|
|
|
>
|
|
|
|
|
<Spin indicator={antIcon} spinning={this.state.isSpin}>
|
|
|
|
|
<div className="task_popup_con ml30">
|
|
|
|
|
<div className="mr15">
|
|
|
|
|
<ul>
|
|
|
|
@ -331,6 +350,7 @@ class Addcourses extends Component{
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Spin>
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|