dev_aliyun2
杨树明 5 years ago
parent fd6f4f93cf
commit 4c9d349bbe

@ -190,12 +190,13 @@ class PublishRightnow extends Component{
this.setState({ visible : false })
return;
}
this.showDialog(response.data.course_groups)
this.setState({
course_groups: response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
starttimeslate_time:response.data.late_time===undefined||response.data.late_time===null||response.data.late_time===""?undefined:response.data.late_time,
})
this.showDialog(response.data.course_groups)
})
.catch(function (error) {
console.log(error);

@ -58,11 +58,7 @@ class OneSelfOrderModal extends Component{
// }else{
// item.end_time = moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm");
// }
if(this.props.starttimesend){
item.end_time = moment(moment(handleDateString(this.props.starttimesend))).format("YYYY-MM-DD HH:mm");
}else{
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
}
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
newarr.push(item)
} else {
newarr.push(item)
@ -78,7 +74,7 @@ class OneSelfOrderModal extends Component{
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
if(this.props.starttimesend===undefined){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
@ -89,7 +85,7 @@ class OneSelfOrderModal extends Component{
}else{
if(this.props.starttimesend===undefined){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
@ -108,11 +104,7 @@ class OneSelfOrderModal extends Component{
course_groups.map((item,key)=>{
if(item.end_time===null){
// item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
if(this.props.starttimesend){
item.end_time = moment(moment(handleDateString(this.props.starttimesend))).format("YYYY-MM-DD HH:mm");
}else{
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
}
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
newarr.push(item)
}else{
newarr.push(item)
@ -131,7 +123,7 @@ class OneSelfOrderModal extends Component{
if(this.props.starttimes===undefined||this.props.starttimes===""||this.props.starttimes===null){
if(this.props.starttimesend===undefined){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({
@ -142,7 +134,7 @@ class OneSelfOrderModal extends Component{
}else{
if(this.props.starttimesend===undefined){
this.setState({
endtime:moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
endtime:moment(moment(handleDateString(this.props.starttimes)).add(1, 'week')).format("YYYY-MM-DD HH:mm")
})
}else{
this.setState({

@ -57,11 +57,12 @@ class Immediatelypublish extends Component{
if(this.props.Exercisetype==="exercise"){
let url=`/exercises/${this.props.match.params.Id}/publish_groups.json`;
axios.get(url).then((response) => {
if(response.status===200){
if (response.data) {
let starttimesend=response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time;
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
OneSelftype:true,
Topval:this.props.Exercisetype==="exercise"?"学生将立即收到试卷":"学生将立即收到问卷",
// Botvalleft:"暂不发布",
Botval:this.props.single ? "":this.props.Exercisetype==="exercise"?`本操作只对"未发布"的试卷有效`:`本操作只对"未发布"的问卷有效`,
@ -73,8 +74,9 @@ class Immediatelypublish extends Component{
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
course_groups:response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
starttimesend:starttimesend,
immediatelyopen:response.data.course_groups===null||response.data.course_groups.length===0?false:true,
OneSelftype:true,
})
}
@ -84,12 +86,12 @@ class Immediatelypublish extends Component{
}else{
let url=`/polls/${this.props.match.params.pollId}/publish_groups.json`;
axios.get(url).then((response) => {
if(response){
if (response.data) {
let starttimesend=response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time;
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
OneSelftype:true,
Topval:this.props.Exercisetype==="exercise"?"学生将立即收到试卷":"学生将立即收到问卷",
// Botvalleft:"暂不发布",
Botval:this.props.single ? "":this.props.Exercisetype==="exercise"?`本操作只对"未发布"的试卷有效`:`本操作只对"未发布"的问卷有效`,
@ -101,8 +103,9 @@ class Immediatelypublish extends Component{
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
course_groups:response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time,
starttimesend:starttimesend,
immediatelyopen:response.data.course_groups===null||response.data.course_groups.length===0?false:true,
OneSelftype:true,
})
}
}).catch((error) => {

@ -383,14 +383,15 @@ class ShixunStudentWork extends Component {
axios.get(url).then((response) => {
if(response.status===200){
if (response.data) {
const dataformat = 'YYYY-MM-DD HH:mm';
let starttime= this.props.getNowFormatDates(1);
let endtime=this.props.getNowFormatDates(2);
let starttimesend=response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time;
this.setState({
modalname:"立即发布",
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
OneSelftype:true,
Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的作业有效`,
@ -402,8 +403,9 @@ 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:response.data.end_time,
starttimesend:starttimesend,
typs:"start",
OneSelftype:true,
})
}
}).catch((error) => {

@ -1813,20 +1813,21 @@ class Trainingjobsetting extends Component {
axios.get(url).then((response) => {
if (response.status === 200) {
if (response.data) {
const dataformat = 'YYYY-MM-DD HH:mm';
let starttime = this.props.getNowFormatDates(1);
let endtime = this.props.getNowFormatDates(2);
let starttimesend=response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time;
this.setState({
modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
OneSelftype: true,
Topval: "学生将立即收到作业",
// Botvalleft:"暂不发布",
Botval: `本操作只对"未发布"的作业有效`,
starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
starttimes: starttime,
starttimesend: response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time,
starttimesend:starttimesend,
typs: "start",
endtime: "截止时间:" + endtime,
Cancelname: "暂不发布",
@ -1836,6 +1837,7 @@ class Trainingjobsetting extends Component {
course_groups:response.data.course_groups,
immediatelyopen:true,
modallate_time:response.data.late_time,
OneSelftype: true,
})
}
}).catch((error) => {

@ -159,14 +159,15 @@ class Workquestionandanswer extends Component {
axios.get(url).then((response) => {
if (response.status === 200) {
if (response.data) {
const dataformat = 'YYYY-MM-DD HH:mm';
let starttime = this.props.getNowFormatDates(1);
let endtime = this.props.getNowFormatDates(2);
let starttimesend=response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time;
this.setState({
modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
OneSelftype: true,
Topval: "学生将立即收到作业",
// Botvalleft:"暂不发布",
Botval: `本操作只对"未发布"的作业有效`,
@ -178,8 +179,9 @@ class Workquestionandanswer 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:response.data.end_time,
starttimesend:starttimesend,
typs: "start",
OneSelftype: true,
})
}
}).catch((error) => {

Loading…
Cancel
Save