|
|
@ -28,6 +28,20 @@ class Addcourses extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
axios.interceptors.response.use((response) => {
|
|
|
|
|
|
|
|
if (response != undefined)
|
|
|
|
|
|
|
|
if (response && response.data.status === 409) {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Addcoursestypes: true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
|
|
|
}, (error) => {
|
|
|
|
|
|
|
|
//TODO 这里如果样式变了会出现css不加载的情况
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let {Addcoursestype}=this.props;
|
|
|
|
let {Addcoursestype}=this.props;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -75,6 +89,7 @@ class Addcourses extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
professor:null,
|
|
|
|
assistant_professor:null,
|
|
|
|
assistant_professor:null,
|
|
|
|
Checkboxteacherchecked:e.target.checked,
|
|
|
|
Checkboxteacherchecked:e.target.checked,
|
|
|
|
Checkboxteachingtype:false
|
|
|
|
Checkboxteachingtype:false
|
|
|
@ -102,7 +117,7 @@ class Addcourses extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hidetojoinclass=()=>{
|
|
|
|
hidetojoinclass=()=>{
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
let {Addcoursestype}=this.props;
|
|
|
|
// console.log(this.props)
|
|
|
|
// console.log(this.props)
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
invite_code:undefined,
|
|
|
|
invite_code:undefined,
|
|
|
@ -114,13 +129,19 @@ class Addcourses extends Component{
|
|
|
|
Checkboxteachingtype:false,
|
|
|
|
Checkboxteachingtype:false,
|
|
|
|
professor:null,
|
|
|
|
professor:null,
|
|
|
|
assistant_professor:null,
|
|
|
|
assistant_professor:null,
|
|
|
|
student:null
|
|
|
|
student:null,
|
|
|
|
|
|
|
|
Addcoursestypes:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Addcoursestype===true){
|
|
|
|
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
submitasyn=(course_id)=>{
|
|
|
|
submitasyn=(course_id)=>{
|
|
|
|
let{professor}=this.state;
|
|
|
|
let{professor,Addcoursestype}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
if(professor===1){
|
|
|
|
if(professor===1){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
loadtype:true,
|
|
|
|
loadtype:true,
|
|
|
@ -129,13 +150,17 @@ class Addcourses extends Component{
|
|
|
|
modalSave:(course_id)=>this.submitasyns(course_id),
|
|
|
|
modalSave:(course_id)=>this.submitasyns(course_id),
|
|
|
|
Addcoursestype:false
|
|
|
|
Addcoursestype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
if(Addcoursestype===true){
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
// let{course_id}=this.state;
|
|
|
|
// let{course_id}=this.state;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Addcoursestype:false
|
|
|
|
Addcoursestype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
if(Addcoursestype===true){
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
|
|
|
}
|
|
|
|
window.location.href ="/courses/"+course_id+"/students";
|
|
|
|
window.location.href ="/courses/"+course_id+"/students";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -145,6 +170,7 @@ class Addcourses extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
submittojoinclass=()=>{
|
|
|
|
submittojoinclass=()=>{
|
|
|
|
|
|
|
|
let{Addcoursestype}=this.state;
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
isSpin:true
|
|
|
|
isSpin:true
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -191,7 +217,9 @@ class Addcourses extends Component{
|
|
|
|
message:"提示",
|
|
|
|
message:"提示",
|
|
|
|
description:response.data.message
|
|
|
|
description:response.data.message
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
if(Addcoursestype===true){
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// this.props.showNotification(response.data.message);
|
|
|
|
// this.props.showNotification(response.data.message);
|
|
|
|
|
|
|
|
|
|
|
@ -204,7 +232,9 @@ class Addcourses extends Component{
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Addcoursestype:false
|
|
|
|
Addcoursestype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
if(Addcoursestype===true){
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
// this.setState({
|
|
|
@ -285,7 +315,8 @@ class Addcourses extends Component{
|
|
|
|
loadtype,
|
|
|
|
loadtype,
|
|
|
|
modalsType,
|
|
|
|
modalsType,
|
|
|
|
modalsTopval,
|
|
|
|
modalsTopval,
|
|
|
|
modalSave
|
|
|
|
modalSave,
|
|
|
|
|
|
|
|
Addcoursestypes
|
|
|
|
}=this.state;
|
|
|
|
}=this.state;
|
|
|
|
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
|
|
|
|
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
|
|
|
|
return(
|
|
|
|
return(
|
|
|
@ -301,7 +332,7 @@ class Addcourses extends Component{
|
|
|
|
keyboard={false}
|
|
|
|
keyboard={false}
|
|
|
|
className={"HomeworkModal"}
|
|
|
|
className={"HomeworkModal"}
|
|
|
|
title="加入课堂"
|
|
|
|
title="加入课堂"
|
|
|
|
visible={Addcoursestype}
|
|
|
|
visible={Addcoursestype===undefined||Addcoursestype===false?Addcoursestypes:Addcoursestype}
|
|
|
|
closable={false}
|
|
|
|
closable={false}
|
|
|
|
footer={null}
|
|
|
|
footer={null}
|
|
|
|
destroyOnClose={true}
|
|
|
|
destroyOnClose={true}
|
|
|
@ -314,7 +345,7 @@ class Addcourses extends Component{
|
|
|
|
<label className="panel-form-label fl">课堂邀请码:</label>
|
|
|
|
<label className="panel-form-label fl">课堂邀请码:</label>
|
|
|
|
<Input type="text" className="input-60-40 fl mt5" name="invite_code"
|
|
|
|
<Input type="text" className="input-60-40 fl mt5" name="invite_code"
|
|
|
|
placeholder="请输入5位课堂邀请码或6位分班邀请码"
|
|
|
|
placeholder="请输入5位课堂邀请码或6位分班邀请码"
|
|
|
|
style={{ height: '30px'}}
|
|
|
|
style={{width:'275px'}}
|
|
|
|
value={invite_code} onInput={this.inputjoinclassvalue}/>
|
|
|
|
value={invite_code} onInput={this.inputjoinclassvalue}/>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|