From 1c16c4f968ca15f786fc7c3afed3ba3006cefffe Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Tue, 21 Jul 2020 17:42:58 +0800 Subject: [PATCH] When modifying the dag, if the DAG is not saved, it cannot be formatted --- .../src/js/conf/home/pages/dag/_source/dag.vue | 4 ++++ dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js | 1 + dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js | 3 ++- dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js | 3 ++- 4 files changed, 9 insertions(+), 2 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 51ec2316e7..7565ebe86a 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 @@ -181,6 +181,10 @@ // DAG automatic layout dagAutomaticLayout() { + if(this.store.state.dag.isEditDag) { + this.$message.warning(`${i18n.$t('Please save the DAG before formatting')}`) + return false + } $('#canvas').html('') // Destroy round robin diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js index 09d51b91dd..e2f3f2b9dc 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js @@ -230,6 +230,7 @@ export default { id: payload }, res => { resolve(res) + state.isEditDag = false }).catch(e => { reject(e) }) 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 6de5d94672..2cca526bdd 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -620,5 +620,6 @@ export default { zkDirectory: 'zkDirectory', 'Directory detail': 'Directory detail', 'Connection name': 'Connection name', - 'Current connection settings': 'Current connection settings' + 'Current connection settings': 'Current connection settings', + 'Please save the DAG before formatting': 'Please save the DAG before formatting' } 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 9fcbb8e88a..425f46a147 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -619,5 +619,6 @@ export default { zkDirectory: 'zk注册目录', 'Directory detail': '查看目录详情', 'Connection name': '连线名', - 'Current connection settings': '当前连线设置' + 'Current connection settings': '当前连线设置', + 'Please save the DAG before formatting': '格式化前请先保存DAG' }