From 90a902441de008914b90efc2b8055abc06041333 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Thu, 14 Jan 2021 18:28:14 +0800 Subject: [PATCH] optimization --- .../_source/createWarningInstance.vue | 19 +++++++++++++++++-- .../src/js/conf/home/router/index.js | 3 ++- .../js/conf/home/store/security/actions.js | 6 +++--- .../src/js/module/i18n/locale/en_US.js | 4 +++- .../src/js/module/i18n/locale/zh_CN.js | 4 +++- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue index 95b901a73f..73ef61f53c 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue @@ -116,15 +116,23 @@ }, // Select plugin changePlugin () { - this.store.dispatch('security/getUiPluginsByID', { + this.store.dispatch('security/getUiPluginById', { pluginId: this.pluginDefineId }).then(res => { this.rule = JSON.parse(res.pluginParams) + this.rule.forEach(item => { + if (item.title.indexOf('$t') !== -1) { + item.title = $t(item.field) + } + }) }).catch(e => { this.$message.error(e.msg || '') }) }, _submit () { + this.$f.rule.forEach(item => { + item.title = item.name + }) let param = { instanceName: this.instanceName, pluginDefineId: this.pluginDefineId, @@ -152,10 +160,17 @@ }, watch: {}, created () { + let pluginInstanceParams = [] if (this.item) { this.instanceName = this.item.instanceName this.pluginDefineId = this.item.pluginDefineId - this.rule = JSON.parse(this.item.pluginInstanceParams) + JSON.parse(this.item.pluginInstanceParams).forEach(item => { + if (item.title.indexOf('$t') !== -1) { + item.title = $t(item.field) + } + pluginInstanceParams.push(item) + }) + this.rule = pluginInstanceParams } }, mounted () { diff --git a/dolphinscheduler-ui/src/js/conf/home/router/index.js b/dolphinscheduler-ui/src/js/conf/home/router/index.js index 7b85f845b0..8d205b81c8 100644 --- a/dolphinscheduler-ui/src/js/conf/home/router/index.js +++ b/dolphinscheduler-ui/src/js/conf/home/router/index.js @@ -387,7 +387,8 @@ const router = new Router({ name: 'users-manage', component: resolve => require(['../pages/security/pages/users/index'], resolve), meta: { - title: `${i18n.$t('User Manage')}` + title: `${i18n.$t('User Manage')}`, + refresh_in_switched_tab: false } }, { diff --git a/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js index 48eaa12c41..9405d264a4 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js @@ -382,11 +382,11 @@ export default { }) }, /** - * queryUiPluginsByID + * queryUiPluginById */ - getUiPluginsByID ({ state }, payload) { + getUiPluginById ({ state }, payload) { return new Promise((resolve, reject) => { - io.post('ui-plugins/queryUiPluginsByID', payload, res => { + io.post('ui-plugins/queryUiPluginDetailById', payload, res => { resolve(res.data) }).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 78204e018d..ed8dfde995 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -673,5 +673,7 @@ export default { 'The workflow canvas is abnormal and cannot be saved, please recreate': 'The workflow canvas is abnormal and cannot be saved, please recreate', Info: 'Info', 'Datasource userName': 'owner', - 'Resource userName': 'owner' + 'Resource userName': 'owner', + receivers: 'receivers', + receiverCcs: 'receiverCcs' } 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 53989a70ec..ee35b87b54 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -672,5 +672,7 @@ export default { 'The workflow canvas is abnormal and cannot be saved, please recreate': '该工作流画布异常,无法保存,请重新创建', Info: '提示', 'Datasource userName': '所属用户', - 'Resource userName': '所属用户' + 'Resource userName': '所属用户', + receivers: '收件人', + receiverCcs: '抄送人' }