From 408d14062b7515eed12dc05d5102ff187a1aba1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 3 Jul 2019 14:33:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTaskssetting.js | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 5f759f607..dec0889ab 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -288,7 +288,7 @@ class GraduationTaskssettingapp extends Component{ allowlatefun=(e)=>{ let {end_time}=this.state; - debugger + if(e.target.value===true||e.target.value===1){ this.setState({ @@ -317,24 +317,24 @@ class GraduationTaskssettingapp extends Component{ }) } - updatesfuncrosscomment=(types,checked,newlatetime,newcommenttime)=>{ + updatesfuncrosscomment=(types,newlatetime,newcommenttime)=>{ let {endtimetype}=this.state; if(types===1){ this.setState({ latetime:newlatetime, - crosscomment:checked, + crosscomment:true, commenttime:newcommenttime }) }else{ if(endtimetype===true){ this.setState({ - crosscomment:checked, + crosscomment:true, commenttime:newcommenttime }) }else{ this.setState({ end_time:newlatetime, - crosscomment:checked, + crosscomment:true, commenttime:newcommenttime }) } @@ -342,42 +342,41 @@ class GraduationTaskssettingapp extends Component{ } funcrosscomment=(e)=>{ -debugger - let {latetime,end_time,allowlate}=this.state; + let {latetime,end_time,allowlate}=this.state; + let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); + let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm"); + + let newlatetimes=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm"); + let newcommenttimes=moment(latetime).format("YYYY-MM-DD HH:mm"); + + let newend_timeb=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); + let newcommenttimeb=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm"); + + let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); + let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); + let newtime; if(e.target.checked===true){ + if(allowlate===1||allowlate===true){ if(latetime===null||latetime===""){ - let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); - let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm"); - this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime) + this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea) }else{ - let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm"); - let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm"); - this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime) + this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes) } }else{ if(end_time===null||end_time===""){ - let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm"); - let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm"); - this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime) - + this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb) }else{ - let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm"); - let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm"); - this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime) + this.updatesfuncrosscomment(2,newend_timed,newcommenttimed) } } - - }else{ this.setState({ crosscomment:e.target.checked, commenttime:undefined }) } - - } funcommentstatus=(e)=>{