diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index db58e95fd..81e388d6f 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1482,6 +1482,7 @@ class Listofworksstudentone extends Component { } //计算成绩 setComputeTime=()=>{ + let matchurl = this.props.match.url; let {teacherdata}=this.state; this.setState({ computeTimetype:false @@ -1494,6 +1495,7 @@ class Listofworksstudentone extends Component { this.props.showNotification(`${response.data.message}`); // var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid); + this.props.history.replace( matchurl ); // this.Getalistofworkstwo("", "", "", "", 1, 20); }).catch((error) => { console.log(error) @@ -2147,6 +2149,9 @@ class Listofworksstudentone extends Component { } setComputeTimet=()=>{ + + let matchurl = this.props.match.url; + this.setState({ computeTimetype:false }) @@ -2163,6 +2168,7 @@ class Listofworksstudentone extends Component { }) this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit); this.props.showNotification(`${response.data.message}`); + this.props.history.replace( matchurl ); } }).catch((error) => { console.log(error) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index e2285a7a6..fec98e69b 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -123,9 +123,9 @@ class ShixunHomeworkPage extends Component { let {tab, teacherdatapage, jobsettingsdatapage} = this.state; const isAdmin = this.props.isAdmin(); - console.log(119) - console.log(jobsettingsdatapage); - console.log(teacherdatapage); + // console.log(119) + // console.log(jobsettingsdatapage); + // console.log(teacherdatapage); return (
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index ed1249f0d..f6af871dd 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -31,6 +31,30 @@ const Option = Select.Option; const RadioGroup = Radio.Group; +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + // 恢复数据 function md_rec_data(k,mdu,id, editor){ if(window.sessionStorage.getItem(k+mdu) !== null){ @@ -1120,7 +1144,7 @@ export default class TPMsettings extends Component { } onChangeTimePicker =(value, dateString)=> { this.setState({ - opening_time:dateString + opening_time:moment(handleDateStrings(dateString)) }) } diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js index cb0f08c0f..8cb79e9d0 100644 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {TPMIndexHOC} from '../TPMIndexHOC'; -import {SnackbarHOC,handleDateString} from 'educoder'; +import {SnackbarHOC} from 'educoder'; import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd'; @@ -16,6 +16,7 @@ import './css/Newshixuns.css'; import {getUrl} from 'educoder' + let path = getUrl("/editormd/lib/") const $ = window.$; @@ -28,6 +29,34 @@ const Option = Select.Option; const RadioGroup = Radio.Group; const confirm = Modal.confirm; + + +// 处理整点 半点 +// 取传入时间往后的第一个半点 +export function handleDateStrings(dateString) { + if (!dateString) return dateString; + const ar = dateString.split(':') + if (ar[1] == '00' || ar[1] == '30') { + return dateString + } + const miniute = parseInt(ar[1]); + if (miniute < 30 || miniute == 60) { + return [ar[0], '30'].join(':') + } + if (miniute < 60) { + // 加一个小时 + const tempStr = [ar[0], '00'].join(':'); + const format = "YYYY-MM-DD HH:mm"; + const _moment = moment(tempStr, format) + _moment.add(1, 'hours') + return _moment.format(format) + } + + return dateString +} + + + // 恢复数据 function md_rec_data(k, mdu, id, editor) { if (window.sessionStorage.getItem(k + mdu) !== null) { @@ -713,7 +742,7 @@ class Newshixuns extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ - TimePickervalue: handleDateString(dateString) + TimePickervalue: handleDateStrings(dateString) }) } // 附件相关 START