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