|
@@ -106,7 +106,7 @@ const TaskCreaterView = () => {
|
|
|
.then(() => {
|
|
|
taskForm
|
|
|
.validateFields()
|
|
|
- .then(() => {
|
|
|
+ .then(async () => {
|
|
|
let nodes = []
|
|
|
let edges = []
|
|
|
let type = ''
|
|
@@ -150,16 +150,19 @@ const TaskCreaterView = () => {
|
|
|
}
|
|
|
|
|
|
// 单位非空判断
|
|
|
- if (taskFormData.executionCycle === 2 && cronNum && cronUnit) {
|
|
|
+ if (taskFormData.executionCycle === 1 || (cronNum && cronUnit)) {
|
|
|
+ let res = {}
|
|
|
if (state !== null) {
|
|
|
params['id'] = state.id
|
|
|
- updateJmJobInfo(params).then(() => {
|
|
|
- navigate(-1)
|
|
|
- })
|
|
|
+ res = await updateJmJobInfo(params)
|
|
|
} else {
|
|
|
- createJmJob(params).then(() => {
|
|
|
- navigate(-1)
|
|
|
- })
|
|
|
+ res = await createJmJob(params)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ navigate(-1)
|
|
|
+ } else {
|
|
|
+ message.error(res.data.msg)
|
|
|
}
|
|
|
} else {
|
|
|
message.error('执行周期数据有误')
|