From 67f438ddb321db55aa01b0b4a19cbaa25b973f97 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Fri, 22 Mar 2024 15:51:27 +0800 Subject: [PATCH] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E4=B8=80=E6=8F=BD=E5=AD=90?= =?UTF-8?q?=E6=96=87=E6=A1=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tapd :1479298、1479224、1479311 --- .../ms-common-script/ms-script-menu.vue | 10 +++---- .../business/ms-params-input/index.vue | 27 ++++++++++++++++++- frontend/src/views/api-test/debug/index.vue | 6 ++++- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/business/ms-common-script/ms-script-menu.vue b/frontend/src/components/business/ms-common-script/ms-script-menu.vue index 6b01b1693b..dec9e98939 100644 --- a/frontend/src/components/business/ms-common-script/ms-script-menu.vue +++ b/frontend/src/components/business/ms-common-script/ms-script-menu.vue @@ -71,11 +71,11 @@ const innerLanguageType = useVModel(props, 'languagesType', emit); const languages = [ - { text: 'beanshellJSR223', value: LanguageEnum.BEANSHELL_JSR233 }, - { text: 'beanshell', value: LanguageEnum.BEANSHELL }, - { text: 'python', value: LanguageEnum.PYTHON }, - { text: 'groovy', value: LanguageEnum.GROOVY }, - { text: 'javascript', value: LanguageEnum.JAVASCRIPT }, + { text: 'BeanShell-JSR223', value: LanguageEnum.BEANSHELL_JSR233 }, + { text: 'BeanShell', value: LanguageEnum.BEANSHELL }, + { text: 'Python3', value: LanguageEnum.PYTHON }, + { text: 'Groovy', value: LanguageEnum.GROOVY }, + { text: 'JavaScript', value: LanguageEnum.JAVASCRIPT }, ]; function expandedHandler() { diff --git a/frontend/src/components/business/ms-params-input/index.vue b/frontend/src/components/business/ms-params-input/index.vue index 5d04dfe1e6..44f99bf544 100644 --- a/frontend/src/components/business/ms-params-input/index.vue +++ b/frontend/src/components/business/ms-params-input/index.vue @@ -251,6 +251,7 @@ formalParameterVars, JMeterAllGroup, JMeterAllVars, + JMeterVariableGroup, mockAllGroup, mockAllParams, mockFunctions, @@ -258,6 +259,7 @@ } from './config'; import type { MockParamInputGroupItem, MockParamItem } from './types'; import type { AutoComplete, CascaderOption, FormInstance } from '@arco-design/web-vue'; + import { string } from 'fast-glob/out/utils'; const props = defineProps<{ value: string; @@ -500,7 +502,30 @@ paramFormRef.value?.clearValidate(); } - const JMeterVarsOptions: CascaderOption[] = cloneDeep(JMeterAllGroup); + function genJMeterVarsOptions() { + // 国际化处理 + const JMeterVarsOptions: { label: string; value: string; children: any }[] = []; + JMeterAllGroup.forEach((item) => { + const optionChildren: { label: string; value: string }[] = []; + if (item.children) { + item.children.forEach((child) => { + const childOpt = { + label: t(child.label), + value: child.value, + }; + optionChildren.push(childOpt); + }); + } + const option = { + label: t(item.label), + value: item.value, + children: optionChildren, + }; + JMeterVarsOptions.push(option); + }); + return JMeterVarsOptions; + } + const JMeterVarsOptions = genJMeterVarsOptions(); function cancel() { paramFormRef.value?.resetFields(); diff --git a/frontend/src/views/api-test/debug/index.vue b/frontend/src/views/api-test/debug/index.vue index f33002f5fe..fe41740c03 100644 --- a/frontend/src/views/api-test/debug/index.vue +++ b/frontend/src/views/api-test/debug/index.vue @@ -27,7 +27,11 @@ >