|
|
|
@ -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,32 +628,24 @@ 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,
|
|
|
|
|
visible:true,
|
|
|
|
|
typs:"end",
|
|
|
|
|
Topval:"学生将能立即收到资源",
|
|
|
|
|
// Botvalleft:"暂不发布",
|
|
|
|
|
// Botval:`本操作只对"未发布"的分班有效`,
|
|
|
|
|
// starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
|
|
|
|
|
// starttimes:starttime,
|
|
|
|
|
// endtime:"截止时间:"+endtime,
|
|
|
|
|
Cancelname:"暂不发布",
|
|
|
|
|
Savesname:"立即发布",
|
|
|
|
|
Cancel:this.homeworkhide,
|
|
|
|
|
Saves:this.homeworkstartend,
|
|
|
|
|
course_groups:response.data.course_groups,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
modalname:"立即发布",
|
|
|
|
|
modaltype:this.state.course_groups===null||this.state.course_groups.length===0?2:1,
|
|
|
|
|
visible:true,
|
|
|
|
|
typs:"end",
|
|
|
|
|
Topval:"学生将能立即收到资源",
|
|
|
|
|
// Botvalleft:"暂不发布",
|
|
|
|
|
// Botval:`本操作只对"未发布"的分班有效`,
|
|
|
|
|
// starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
|
|
|
|
|
// starttimes:starttime,
|
|
|
|
|
// endtime:"截止时间:"+endtime,
|
|
|
|
|
Cancelname:"暂不发布",
|
|
|
|
|
Savesname:"立即发布",
|
|
|
|
|
Cancel:this.homeworkhide,
|
|
|
|
|
Saves:this.homeworkstartend,
|
|
|
|
|
course_groups:this.state.course_groups,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 立即发布
|
|
|
|
@ -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 >
|
|
|
|
|
|
|
|
|
|