From 51e60e70efa27aeeebd3134e03820c67817244dd Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 2 Feb 2023 13:53:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E6=8F=92=E4=BB=B6=E8=A1=A8=E5=8D=95=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=8C=89=E6=9D=A1=E4=BB=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../personal/PlatformAccountConfig.vue | 22 +++++---- .../template/CustomFiledComponent.vue | 11 +++++ .../frontend/src/i18n/lang/en-US.js | 3 ++ .../frontend/src/i18n/lang/zh-CN.js | 3 ++ .../frontend/src/i18n/lang/zh-TW.js | 3 ++ pom.xml | 2 +- .../workspace/integration/PlatformConfig.vue | 45 ++++++++++--------- 7 files changed, 60 insertions(+), 29 deletions(-) diff --git a/framework/sdk-parent/frontend/src/components/personal/PlatformAccountConfig.vue b/framework/sdk-parent/frontend/src/components/personal/PlatformAccountConfig.vue index 6f9ecbeac0..bad3925651 100644 --- a/framework/sdk-parent/frontend/src/components/personal/PlatformAccountConfig.vue +++ b/framework/sdk-parent/frontend/src/components/personal/PlatformAccountConfig.vue @@ -3,16 +3,20 @@ - - + + + + {{ $t('commons.validate') }} @@ -54,7 +58,7 @@ export default { this.init(); }, }, - mounted() { + created() { this.init(); }, methods: { @@ -65,7 +69,9 @@ export default { } // 设置默认值 if (this.accountConfig[item.name]) { - this.$set(item, 'defaultValue', this.accountConfig[item.name]); + if (this.accountConfig[item.name]) { + this.$set(item, 'defaultValue', this.accountConfig[item.name]); + } } }); this.rules = getPlatformFormRules(this.config); diff --git a/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue b/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue index cd7ab95cce..56d44b8eb1 100644 --- a/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue +++ b/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue @@ -169,6 +169,7 @@ export default { } } } + this.setFormData(); if (['member', 'multipleMember'].indexOf(this.data.type) < 0) { return; } @@ -180,6 +181,11 @@ export default { } }); }, + watch: { + form() { + this.setFormData(); + } + }, methods: { getTranslateOption(item) { return item.system ? this.$t(item.text) : item.text; @@ -191,6 +197,11 @@ export default { this.$emit('change', this.data.name); this.$forceUpdate(); }, + setFormData() { + if (this.form && this.data && this.data[this.prop]) { + this.$set(this.form, this.data.name, this.data[this.prop]); + } + } } }; diff --git a/framework/sdk-parent/frontend/src/i18n/lang/en-US.js b/framework/sdk-parent/frontend/src/i18n/lang/en-US.js index e1d04780db..76fb9b9508 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/en-US.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/en-US.js @@ -742,11 +742,14 @@ const message = { app_key: 'APP key', account: 'Account', password: 'Password', + token_auth: 'Token', + password_auth: 'Password', jira_url: 'JIRA url', jira_issuetype: 'JIRA issue type', jira_storytype: 'JIRA story type', input_api_account: 'please enter account', input_api_password: 'Please enter password', + input_token: 'Please enter token', input_jira_url: 'Please enter Jira address, for example: https://metersphere.atlassian.net/', input_jira_issuetype: 'Please enter the issue type', input_jira_storytype: 'Please enter the story type', diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js index 6da45e872f..a3dee5fcf6 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js @@ -747,11 +747,14 @@ const message = { app_key: '密钥', account: '账号', password: '密码', + token_auth: 'Token 认证', + password_auth: '账号密码认证', jira_url: 'JIRA 地址', jira_issuetype: '问题类型', jira_storytype: '需求类型', input_api_account: '请输入账号', input_api_password: '请输入密码', + input_token: '请输入Token', input_jira_url: '请输入Jira地址,例:https://metersphere.atlassian.net/', input_jira_issuetype: '请输入问题类型', input_jira_storytype: '请输入需求类型', diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js index ece0634960..293e539b74 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-TW.js @@ -746,11 +746,14 @@ const message = { app_key: '密鑰', account: '賬號', password: '密碼', + token_auth: 'Token 認證', + password_auth: '賬號密碼認證', jira_url: 'JIRA 地址', jira_issuetype: '問題類型', jira_storytype: '需求類型', input_api_account: '請輸入賬號', input_api_password: '請輸入密碼', + input_token: '請輸入Token', input_jira_url: '請輸入Jira地址,例:https://metersphere.atlassian.net/', input_jira_issuetype: '請輸入問題類型', input_jira_storytype: '請輸入需求類型', diff --git a/pom.xml b/pom.xml index 2f2ce7f6fa..2285b11b6c 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 17 2022.0.1 2.7.18 - 1.3.0 + 1.4.0 1.11.0 7.4.1.jre8 42.3.8 diff --git a/system-setting/frontend/src/business/workspace/integration/PlatformConfig.vue b/system-setting/frontend/src/business/workspace/integration/PlatformConfig.vue index e2df028ce7..156165a9d0 100644 --- a/system-setting/frontend/src/business/workspace/integration/PlatformConfig.vue +++ b/system-setting/frontend/src/business/workspace/integration/PlatformConfig.vue @@ -3,24 +3,27 @@
{{ $t('organization.integration.basic_auth_info') }}
- - - - - - + + + + + + + +
@@ -34,7 +37,7 @@ :show.sync="show" ref="bugBtn"/> -
+
{{ $t('organization.integration.use_tip') }}
@@ -113,7 +116,9 @@ export default { this.form = form; // 设置默认值 this.config.formItems.forEach(item => { - this.$set(item, 'defaultValue', this.form[item.name]); + if (this.form[item.name]) { + this.$set(item, 'defaultValue', this.form[item.name]); + } }); } else { this.clear();