From c23ffa42f956668f4b47ff62e51ff56a0a44079a Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 24 Oct 2024 13:47:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83):=20Ta?= =?UTF-8?q?pd=E4=B8=AA=E4=BA=BA=E9=85=8D=E7=BD=AE=E5=8F=8A=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047467 --user=宋昌昌 [个人中心]三方平台账号的TAPD账号和v2一致,是tapd昵称 https://www.tapd.cn/55049933/s/1597196 --- .../system/service/PlatformPluginService.java | 3 +- .../components/tripartite.vue | 26 ++++++++++++++++- .../ms-personal-drawer/locale/en-US.ts | 1 + .../ms-personal-drawer/locale/zh-CN.ts | 1 + frontend/src/views/bug-management/edit.vue | 1 + frontend/src/views/bug-management/utils.ts | 29 ++++++++++--------- 6 files changed, 45 insertions(+), 16 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/PlatformPluginService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/PlatformPluginService.java index 2c653e4aa6..fbdf2154d8 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/PlatformPluginService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/PlatformPluginService.java @@ -4,6 +4,7 @@ import io.metersphere.plugin.platform.dto.request.PlatformRequest; import io.metersphere.plugin.platform.spi.Platform; import io.metersphere.sdk.constants.PluginScenarioType; import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.Translator; import io.metersphere.system.domain.Plugin; import io.metersphere.system.domain.ServiceIntegration; import io.metersphere.system.domain.ServiceIntegrationExample; @@ -45,7 +46,7 @@ public class PlatformPluginService { public Platform getPlatform(String pluginId, String orgId) { ServiceIntegration serviceIntegration = getServiceIntegrationByPluginId(pluginId, orgId); if (serviceIntegration == null) { - throw new MSException("service_integration.configuration.not_blank"); + throw new MSException(Translator.get("service_integration.configuration.not_blank")); } return getPlatform(pluginId, orgId, new String(serviceIntegration.getConfiguration())); } diff --git a/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue b/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue index 8fac01d5ef..0707c2d860 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue @@ -38,7 +38,15 @@ :option="options" > - + + {{ t('ms.personal.save') }} + + {{ t('ms.personal.valid') }} @@ -217,6 +225,22 @@ }); } + async function saveNoValidate(config: any) { + config.validateLoading = true; + const configForms: Record = {}; + Object.keys(dynamicForm.value).forEach((key) => { + configForms[key] = { + ...dynamicForm.value[key].formModel.form, + }; + }); + await savePlatform({ + [currentOrg.value]: configForms, + }); + Message.success(t('ms.personal.validPass')); + config.validateLoading = false; + config.status = 1; + } + async function handleOrgChange() { await initPlatformAccountInfo(); initPlatformInfo(); diff --git a/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts b/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts index 9a3965c2ad..a392f10486 100644 --- a/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts +++ b/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts @@ -73,6 +73,7 @@ export default { 'ms.personal.validFail': 'Verification failed', 'ms.personal.unValid': 'Not verified', 'ms.personal.valid': 'Verify and save', + 'ms.personal.save': 'Save', 'ms.personal.authType': 'Authentication', 'ms.personal.platformAccount': 'Account', 'ms.personal.platformAccountPlaceholder': 'Please enter {type} account', diff --git a/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts b/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts index 9a89063cde..ec1cceb90d 100644 --- a/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts +++ b/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts @@ -67,6 +67,7 @@ export default { 'ms.personal.validFail': '校验失败', 'ms.personal.unValid': '未校验', 'ms.personal.valid': '校验并保存', + 'ms.personal.save': '保存', 'ms.personal.authType': '认证方式', 'ms.personal.platformAccount': '平台账号', 'ms.personal.platformAccountPlaceholder': '请输入 {type} 账号', diff --git a/frontend/src/views/bug-management/edit.vue b/frontend/src/views/bug-management/edit.vue index 8d3f0a7f0c..855249290c 100644 --- a/frontend/src/views/bug-management/edit.vue +++ b/frontend/src/views/bug-management/edit.vue @@ -413,6 +413,7 @@ // 处理表单格式 const getFormRules = (arr: BugEditCustomField[]) => { formRules.value = []; + console.log(arr); if (Array.isArray(arr) && arr.length) { formRules.value = arr.map((item: any) => { const initOptions = item.options || JSON.parse(item.platformOptionJson || '[]'); diff --git a/frontend/src/views/bug-management/utils.ts b/frontend/src/views/bug-management/utils.ts index 9588d9619a..b620382442 100644 --- a/frontend/src/views/bug-management/utils.ts +++ b/frontend/src/views/bug-management/utils.ts @@ -98,22 +98,23 @@ export function makeCustomFieldsParams(formItem: FormRuleItem[]) { // 设置成员默认值 export function getDefaultMemberValue(item: DetailCustomField, initOptions: FieldOptions[]) { - // 系统模板创建人 - if ((item.defaultValue as string | string[]).includes('CREATE_USER')) { - const optionsIds = initOptions.map((e: any) => e.value); - const userId = userStore.id as string; - if (optionsIds.includes(userId)) { - item.defaultValue = item.type === 'MEMBER' ? userId : [userId]; + if (item.defaultValue) { + // 系统模板创建人 + if ((item.defaultValue as string | string[]).includes('CREATE_USER')) { + const optionsIds = initOptions.map((e: any) => e.value); + const userId = userStore.id as string; + if (optionsIds.includes(userId)) { + item.defaultValue = item.type === 'MEMBER' ? userId : [userId]; + } else { + item.defaultValue = item.type === 'MEMBER' ? '' : []; + } + // 三方默认创建人 } else { - item.defaultValue = item.type === 'MEMBER' ? '' : []; + item.defaultValue = + item.type === 'MULTIPLE_MEMBER' && item.defaultValue && typeof item.defaultValue === 'string' + ? JSON.parse(item.defaultValue) + : item.defaultValue; } - // 三方默认创建人 - } else { - const value = - item.type === 'MULTIPLE_MEMBER' && item.defaultValue && typeof item.defaultValue === 'string' - ? JSON.parse(item.defaultValue) - : item.defaultValue; - item.defaultValue = value; } return item.defaultValue; }