fix: 新建定时任务时,指定结束时间

This commit is contained in:
taojinlong 2023-03-06 15:32:28 +08:00
parent b8c8990a1d
commit b8eead37f7
3 changed files with 10 additions and 6 deletions

View File

@ -574,7 +574,7 @@ export default {
startTime: '',
rate: 'SIMPLE',
cron: '',
endTime: '',
endTime: 0,
end: '0',
extraData: {
simple_cron_type: 'hour',
@ -779,6 +779,7 @@ export default {
this.taskForm.name =
this.table.name + ' ' + this.$t('dataset.task_update')
this.taskForm.startTime = new Date()
this.taskForm.endTime = new Date()
this.update_task_dialog_title = this.$t('dataset.task_add_title')
} else {
// update
@ -908,6 +909,7 @@ export default {
}
this.incrementalConfig.tableId = this.table.id
task.startTime = new Date(task.startTime).getTime()
console.log(task.endTime)
task.endTime = new Date(task.endTime).getTime()
task.tableId = this.table.id
const form = JSON.parse(JSON.stringify(task))
@ -1030,7 +1032,7 @@ export default {
onRateChange() {
if (this.taskForm.rate === 'SIMPLE') {
this.taskForm.end = '0'
this.taskForm.endTime = ''
this.taskForm.endTime = 0
this.taskForm.cron = ''
this.showCron = false
}

View File

@ -530,7 +530,7 @@ export default {
startTime: '',
rate: 'SIMPLE',
cron: '',
endTime: '',
endTime: 0,
end: '0',
extraData: {
simple_cron_type: 'hour',
@ -707,6 +707,7 @@ export default {
this.resetTaskForm()
this.taskForm.name = this.table.name + ' ' + this.$t('dataset.task_update')
this.taskForm.startTime = new Date()
this.taskForm.endTime = new Date()
this.update_task_dialog_title = this.$t('dataset.task_add_title')
} else {
this.taskForm = JSON.parse(JSON.stringify(task))
@ -854,7 +855,7 @@ export default {
onRateChange() {
if (this.taskForm.rate === 'SIMPLE') {
this.taskForm.end = '0'
this.taskForm.endTime = ''
this.taskForm.endTime = 0
this.taskForm.cron = ''
}
if (this.taskForm.rate === 'SIMPLE_CRON') {

View File

@ -295,7 +295,7 @@ export default {
tableId: '',
rate: 'SIMPLE',
cron: '',
endTime: '',
endTime: 0,
end: '0',
extraData: {
simple_cron_type: 'hour',
@ -391,6 +391,7 @@ export default {
this.taskDetail = { datasetName, id, tableId }
if (!id) {
this.taskForm.startTime = new Date()
this.taskForm.endTime = new Date()
return
}
this.getTaskDetail(id)
@ -418,7 +419,7 @@ export default {
onRateChange() {
if (this.taskForm.rate === 'SIMPLE') {
this.taskForm.end = '0'
this.taskForm.endTime = ''
this.taskForm.endTime = 0
this.taskForm.cron = ''
this.showCron = false
}