Skip to content

Commit

Permalink
Fixed the front-end task page issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
BinChengZhao committed Jul 28, 2021
1 parent f9025e4 commit 0017993
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions delicate-web/src/pages/taskList/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class TaskModal extends PureComponent {
setParams(data) {
const params = { task: data, binding_ids: data.binding_ids }
delete data.binding_ids
console.log(params)
return params
}

Expand All @@ -58,12 +57,19 @@ class TaskModal extends PureComponent {
this.formRef.current
.validateFields()
.then((values) => {
const count = parseInt(values.frequency.extend.count)
values.frequency.extend.count = count ? count : 0

const cron_space_len = values.cron_expression.split(' ').length - 1
const cron_str_raw = values.cron_expression.replaceAll('?', '*')
const cron_str = cron_space_len >= 6 ? cron_str_raw : cron_str_raw + ' *'

const data = {
...item,
...values,
tag: values.tag.join(','),
frequency: JSON.stringify(values.frequency),
cron_expression: values.cron_expression.replaceAll('?', '*') + ' *'
cron_expression: cron_str
}
const params = this.setParams(data)
onOk(params)
Expand Down

0 comments on commit 0017993

Please sign in to comment.