dev_ysm
杨树明 6 years ago
parent f30f770134
commit 113842ebed

@ -43,7 +43,23 @@ class Fileslists extends Component{
course_second_categories:[]
}
}
getcourse_groupslist=()=>{
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/all_course_groups.json";
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
course_groups:response.data.course_groups
})
}
}).catch((error) => {
console.log(error)
});
}
componentDidMount=()=>{
this.getcourse_groupslist()
this.setState({
isSpin:true,
checkBoxValues:[],
@ -81,6 +97,7 @@ class Fileslists extends Component{
}
componentDidUpdate = (prevProps) => {
if(prevProps.match.params.main_id != this.props.match.params.main_id){
this.getcourse_groupslist()
this.setState({
isSpin:true,
checkBoxValues:[],
@ -95,6 +112,7 @@ class Fileslists extends Component{
}
}
if(prevProps.match.params.Id != this.props.match.params.Id){
this.getcourse_groupslist()
this.setState({
isSpin:true,
checkBoxValues:[],
@ -610,13 +628,10 @@ class Fileslists extends Component{
}
let starttime= this.props.getNowFormatDates(1);
let endtime=this.props.getNowFormatDates(2);
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/all_course_groups.json";
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
modaltype:this.state.course_groups===null||this.state.course_groups.length===0?2:1,
visible:true,
typs:"end",
Topval:"学生将能立即收到资源",
@ -629,13 +644,8 @@ class Fileslists extends Component{
Savesname:"立即发布",
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
course_groups:response.data.course_groups,
course_groups:this.state.course_groups,
})
}
}).catch((error) => {
console.log(error)
});
}
// 立即发布
@ -724,7 +734,7 @@ class Fileslists extends Component{
let category_id= this.props.match.params.category_id;
console.log(this.state.course_groups)
return(
<React.Fragment >

Loading…
Cancel
Save