From eb94be7cf01ac17cbb4f379891152170845f08bf Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Sat, 9 May 2020 15:17:54 +0800 Subject: [PATCH] Fix conditions node save exception --- .../js/conf/home/pages/dag/_source/dag.vue | 19 ++++++++++--------- .../src/js/module/i18n/locale/en_US.js | 2 +- .../src/js/module/i18n/locale/zh_CN.js | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue index ae15e20f74..878a0616b1 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue @@ -333,11 +333,11 @@ * Storage interface */ _save (sourceType) { - if(this._verifConditions()) { - return new Promise((resolve, reject) => { - this.spinnerLoading = true - // Storage store - Dag.saveStore().then(res => { + return new Promise((resolve, reject) => { + this.spinnerLoading = true + // Storage store + Dag.saveStore().then(res => { + if(this._verifConditions(res.tasks)) { if (this.urlParam.id) { /** * Edit @@ -371,12 +371,12 @@ reject(e) }) } - }) + } }) - } + }) }, - _verifConditions () { - let tasks = this.$store.state.dag.tasks + _verifConditions (value) { + let tasks = value let bool = true tasks.map(v=>{ if(v.type == 'CONDITIONS' && (v.conditionResult.successNode[0] =='' || v.conditionResult.successNode[0] == null || v.conditionResult.failedNode[0] =='' || v.conditionResult.failedNode[0] == null)) { @@ -386,6 +386,7 @@ }) if(!bool) { this.$message.warning(`${i18n.$t('Successful branch flow and failed branch flow are required')}`) + this.spinnerLoading = false return false } return true diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index 537fc856ef..4b883a2c91 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -584,7 +584,7 @@ export default { 'Some Columns': 'Some Columns', 'Branch flow': 'Branch flow', 'Cannot select the same node for successful branch flow and failed branch flow': 'Cannot select the same node for successful branch flow and failed branch flow', - 'Successful branch flow and failed branch flow are required': 'Successful branch flow and failed branch flow are required', + 'Successful branch flow and failed branch flow are required': 'conditions node Successful and failed branch flow are required', 'Unauthorized or deleted resources': 'Unauthorized or deleted resources', 'Please delete all non-existent resources': 'Please delete all non-existent resources', } diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index 1cdda6ec4f..5f295377de 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -584,7 +584,7 @@ export default { 'Some Columns': '选择列', 'Branch flow': '分支流转', 'Cannot select the same node for successful branch flow and failed branch flow': '成功分支流转和失败分支流转不能选择同一个节点', - 'Successful branch flow and failed branch flow are required': '成功分支流转和失败分支流转必填', + 'Successful branch flow and failed branch flow are required': 'conditions节点成功和失败分支流转必填', 'Unauthorized or deleted resources': '未授权或已删除资源', 'Please delete all non-existent resources': '请删除所有未授权或已删除资源', }