diff --git a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js index a001e6d86..ee19745c9 100644 --- a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js +++ b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js @@ -46,10 +46,16 @@ class HomeworkModal extends Component{ } if(this.props.starttimes!=undefined&&this.props.starttimes!=""){ + if(this.props.starttimesend!=undefined&&this.props.starttimesend!=""){ + this.setState({ + endtime:this.props.starttimesend, + }) + }else { + this.setState({ + endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") + }) + } - this.setState({ - endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") - }) } } componentDidUpdate=(prevProps)=>{ @@ -69,9 +75,16 @@ class HomeworkModal extends Component{ if(prevProps.starttimes!=this.props.starttimes){ if(this.props.starttimes!=undefined&&this.props.starttimes!=""){ - this.setState({ - endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") - }) + if(this.props.starttimesend!=undefined&&this.props.starttimesend!=""){ + this.setState({ + endtime:this.props.starttimesend, + }) + }else{ + this.setState({ + endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm") + }) + } + } } } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 5eed392d5..6de412525 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -80,6 +80,7 @@ class Listofworksstudentone extends Component { teacherdata: undefined, task_status: [], visibles: false, + starttimesend:undefined, course_group_info: [], styletable: { "display": "none" @@ -2789,6 +2790,7 @@ class Listofworksstudentone extends Component { axios.get(url).then((response) => { if (response.status === 200) { + const dataformat = 'YYYY-MM-DD HH:mm'; let starttime = this.props.getNowFormatDates(1); let endtime = this.props.getNowFormatDates(2); this.setState({ @@ -2801,6 +2803,7 @@ class Listofworksstudentone extends Component { starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), endtime: "截止时间:" + endtime, starttimes:starttime, + starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:moment(response.data.end_time, dataformat), typs:"start", Cancelname: "暂不发布", Savesname: "立即发布", @@ -2949,6 +2952,7 @@ class Listofworksstudentone extends Component { course_groupyslstwo: undefined, typs:undefined, starttimes:undefined, + starttimesend:undefined, }) } @@ -3170,6 +3174,7 @@ class Listofworksstudentone extends Component { course_groups={this.state.course_groups} getcourse_groupslist={(id) => this.getcourse_groupslist(id)} starttimes={this.state.starttimes} + starttimesend={this.state.starttimesend} typs={this.state.typs} /> { diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 3caa63ac3..074bab663 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -74,6 +74,7 @@ class ShixunStudentWork extends Component { DownloadType:false, DownloadMessageval:undefined, lunxun:true, + starttimesend:undefined, } } @@ -432,6 +433,7 @@ class ShixunStudentWork extends Component { Saves:this.homeworkstartend, course_groups:response.data.course_groups, starttimes:starttime, + starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:moment(response.data.end_time, dataformat), typs:"start", }) } @@ -754,6 +756,7 @@ class ShixunStudentWork extends Component { course_groups={this.state.course_groups} getcourse_groupslist={(id)=>this.getcourse_groupslist(id)} starttimes={this.state.starttimes} + starttimesend={this.state.starttimesend} typs={this.state.typs} />