dev_forum
杨树明 5 years ago
parent ad7938d80f
commit 78678a68ba

@ -1482,6 +1482,7 @@ class Listofworksstudentone extends Component {
} }
//计算成绩 //计算成绩
setComputeTime=()=>{ setComputeTime=()=>{
let matchurl = this.props.match.url;
let {teacherdata}=this.state; let {teacherdata}=this.state;
this.setState({ this.setState({
computeTimetype:false computeTimetype:false
@ -1494,6 +1495,7 @@ class Listofworksstudentone extends Component {
this.props.showNotification(`${response.data.message}`); this.props.showNotification(`${response.data.message}`);
// var homeworkid = this.props.match.params.homeworkid; // var homeworkid = this.props.match.params.homeworkid;
this.Getalistofworks(homeworkid); this.Getalistofworks(homeworkid);
this.props.history.replace( matchurl );
// this.Getalistofworkstwo("", "", "", "", 1, 20); // this.Getalistofworkstwo("", "", "", "", 1, 20);
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -2147,6 +2149,9 @@ class Listofworksstudentone extends Component {
} }
setComputeTimet=()=>{ setComputeTimet=()=>{
let matchurl = this.props.match.url;
this.setState({ this.setState({
computeTimetype:false 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.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.showNotification(`${response.data.message}`);
this.props.history.replace( matchurl );
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -123,9 +123,9 @@ class ShixunHomeworkPage extends Component {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state; let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
console.log(119) // console.log(119)
console.log(jobsettingsdatapage); // console.log(jobsettingsdatapage);
console.log(teacherdatapage); // console.log(teacherdatapage);
return ( return (
<div className="newMain clearfix "> <div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width: "1200px"}}> <div className={"educontent mb20"} style={{width: "1200px"}}>

@ -31,6 +31,30 @@ const Option = Select.Option;
const RadioGroup = Radio.Group; 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){ function md_rec_data(k,mdu,id, editor){
if(window.sessionStorage.getItem(k+mdu) !== null){ if(window.sessionStorage.getItem(k+mdu) !== null){
@ -1120,7 +1144,7 @@ export default class TPMsettings extends Component {
} }
onChangeTimePicker =(value, dateString)=> { onChangeTimePicker =(value, dateString)=> {
this.setState({ this.setState({
opening_time:dateString opening_time:moment(handleDateStrings(dateString))
}) })
} }

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC'; 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'; 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' import {getUrl} from 'educoder'
let path = getUrl("/editormd/lib/") let path = getUrl("/editormd/lib/")
const $ = window.$; const $ = window.$;
@ -28,6 +29,34 @@ const Option = Select.Option;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const confirm = Modal.confirm; 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) { function md_rec_data(k, mdu, id, editor) {
if (window.sessionStorage.getItem(k + mdu) !== null) { if (window.sessionStorage.getItem(k + mdu) !== null) {
@ -713,7 +742,7 @@ class Newshixuns extends Component {
onChangeTimePicker = (value, dateString) => { onChangeTimePicker = (value, dateString) => {
this.setState({ this.setState({
TimePickervalue: handleDateString(dateString) TimePickervalue: handleDateStrings(dateString)
}) })
} }
// 附件相关 START // 附件相关 START

Loading…
Cancel
Save