diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index c63348c83..be4195d1f 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -610,21 +610,33 @@ class Fileslists extends Component{ } let starttime= this.props.getNowFormatDates(1); let endtime=this.props.getNowFormatDates(2); - this.setState({ - modalname:"立即发布", - visible:true, - typs:"start", - 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, - }) + 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:"start", + 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) + }); + + } // 立即发布 homeworkstartend=(ds,endtime)=>{ @@ -674,6 +686,12 @@ class Fileslists extends Component{ starttimes:undefined, }) } + + getcourse_groupslist=(id)=>{ + this.setState({ + course_groupslist:id + }) + } render(){ let { searchValue, checkBoxValues,