Skip to content

Commit 4499240

Browse files
界面直接修改计划时间
1 parent aeff02f commit 4499240

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/dashboard/Data/Jobs/JobEdit.react.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* This source code is licensed under the license found in the LICENSE file in
66
* the root directory of this source tree.
77
*/
8-
import PropTypes from 'lib/PropTypes';
8+
import PropTypes from 'lib/PropTypes';
99
import { ActionTypes } from 'lib/stores/JobsStore';
1010
import history from 'dashboard/history';
1111
import JobsForm from 'dashboard/Data/Jobs/JobsForm.react';
@@ -37,10 +37,16 @@ class JobEdit extends React.Component {
3737
}
3838
if (changes.repeat) {
3939
let hour = changes.repeatStartHour;
40-
if (hour.length < 2) {
41-
hour = '0' + hour;
40+
var subHour=0
41+
if(hour<8){
42+
subHour=hour-8+24
43+
}else{
44+
subHour=hour-8
4245
}
43-
schedule.job_schedule.timeOfDay = `${hour}:${changes.repeatStartMinute}:00.000Z`;
46+
if (subHour.length < 2) {
47+
subHour = '0' + hour;
48+
}
49+
schedule.job_schedule.timeOfDay = `${subHour}:${changes.repeatStartMinute}:00.000Z`;
4450
let interval = 0;
4551
if (changes.repeatType === 'daily') {
4652
interval = 1440;

src/dashboard/Data/Jobs/JobsForm.react.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export default class JobsForm extends DashboardView {
4040
}
4141
if (!this.props.initialFields.repeatStartHour) {
4242
changes.repeatStartHour = '12';
43+
}else{
44+
if(parseInt(this.props.initialFields.repeatStartHour)>15){
45+
changes.repeatStartHour=(parseInt(this.props.initialFields.repeatStartHour)+8-24).toString()
46+
}else{
47+
this.props.initialFields.repeatStartHour=(parseInt(this.props.initialFields.repeatStartHour)+8).toString()
48+
}
4349
}
4450
if (!this.props.initialFields.repeatStartMinute) {
4551
changes.repeatStartHour = '00';

0 commit comments

Comments
 (0)