From e3caf65b33c1e02aed297e528986f60f5c4afd3d Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 1 Mar 2024 19:53:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/models/projectManagement/environmental.ts | 2 +- .../src/store/modules/setting/useProjectEnvStore.ts | 12 ++++++------ .../environmental/components/allParams/index.vue | 9 +++++---- .../components/envParams/EnvParamsTab.vue | 4 ++-- .../environmental/components/envParams/HttpTab.vue | 10 ++-------- .../project-management/environmental/locale/en-US.ts | 1 + .../project-management/environmental/locale/zh-CN.ts | 2 +- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/frontend/src/models/projectManagement/environmental.ts b/frontend/src/models/projectManagement/environmental.ts index af0377cfb9..a98732dad3 100644 --- a/frontend/src/models/projectManagement/environmental.ts +++ b/frontend/src/models/projectManagement/environmental.ts @@ -39,7 +39,7 @@ export interface AssertionConfig { } export interface EnvConfig { commonParams?: EnvConfigItem; - commmonVariables: EnvConfigItem[]; + commonVariables: EnvConfigItem[]; httpConfig: EnvConfigItem[]; dataSources: DataSourceItem[]; hostConfig: EnvConfigItem; diff --git a/frontend/src/store/modules/setting/useProjectEnvStore.ts b/frontend/src/store/modules/setting/useProjectEnvStore.ts index a46cc18a33..1124ce1f13 100644 --- a/frontend/src/store/modules/setting/useProjectEnvStore.ts +++ b/frontend/src/store/modules/setting/useProjectEnvStore.ts @@ -10,8 +10,8 @@ import { ContentTabItem, ContentTabsMap, EnvDetailItem, GlobalParams } from '@/m export const ALL_PARAM = 'allParam'; export const NEW_ENV_PARAM = 'newEnvParam'; export const NEW_ENV_GROUP = 'newEnvGroup'; -const envParmasDefaultConfig = { - commmonVariables: [], +const envParamsDefaultConfig = { + commonVariables: [], httpConfig: [], dataSources: [], hostConfig: { @@ -39,12 +39,12 @@ const useProjectEnvStore = defineStore( const currentEnvDetailInfo = ref({ projectId: '', name: '', - config: envParmasDefaultConfig, + config: envParamsDefaultConfig, }); const backupEnvDetailInfo = ref({ projectId: '', name: '', - config: envParmasDefaultConfig, + config: envParamsDefaultConfig, }); const allParamDetailInfo = ref(); // 全局参数详情 const httpNoWarning = ref(true); @@ -75,12 +75,12 @@ const useProjectEnvStore = defineStore( currentEnvDetailInfo.value = { projectId: appStore.currentProjectId, name: '', - config: envParmasDefaultConfig, + config: envParamsDefaultConfig, }; backupEnvDetailInfo.value = { projectId: appStore.currentProjectId, name: '', - config: envParmasDefaultConfig, + config: envParamsDefaultConfig, }; } else if (id === ALL_PARAM) { allParamDetailInfo.value = await getGlobalParamDetail(appStore.currentProjectId); diff --git a/frontend/src/views/project-management/environmental/components/allParams/index.vue b/frontend/src/views/project-management/environmental/components/allParams/index.vue index d488fc27be..b63e6f94f9 100644 --- a/frontend/src/views/project-management/environmental/components/allParams/index.vue +++ b/frontend/src/views/project-management/environmental/components/allParams/index.vue @@ -58,7 +58,7 @@ const { t } = useI18n(); const innerParams = useVModel(props, 'params', emit); - const backupParmas = ref(props.params); + const backupParams = ref(props.params); const firstSearch = ref(true); const defaultParamItem = { @@ -84,6 +84,7 @@ slotName: 'paramType', showInTable: true, showDrag: true, + hasRequired: true, columnSelectorDisabled: true, typeOptions: [ { @@ -155,13 +156,13 @@ function handleSearch() { if (firstSearch.value) { - backupParmas.value = [...innerParams.value]; + backupParams.value = [...innerParams.value]; firstSearch.value = false; } if (!searchValue.value) { - innerParams.value = [...backupParmas.value]; + innerParams.value = [...backupParams.value]; } else { - const result = backupParmas.value.filter((item) => item.key.includes(searchValue.value)); + const result = backupParams.value.filter((item) => item.key.includes(searchValue.value)); innerParams.value = [...result]; } } diff --git a/frontend/src/views/project-management/environmental/components/envParams/EnvParamsTab.vue b/frontend/src/views/project-management/environmental/components/envParams/EnvParamsTab.vue index 7d6eb8bc08..ef7ac9c905 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/EnvParamsTab.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/EnvParamsTab.vue @@ -13,9 +13,9 @@ const allParams = computed({ set: (value: any) => { - store.currentEnvDetailInfo.config.commmonVariables = value; + store.currentEnvDetailInfo.config.commonVariables = value; }, - get: () => store.currentEnvDetailInfo.config.commmonVariables || [], + get: () => store.currentEnvDetailInfo.config.commonVariables || [], }); diff --git a/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue b/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue index 45715c9d70..de0ee01989 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/HttpTab.vue @@ -90,12 +90,6 @@ showDrag: true, showInTable: true, }, - { - title: 'project.environmental.http.applyScope', - dataIndex: 'applyScope', - showDrag: true, - showInTable: true, - }, { title: 'project.environmental.http.enableScope', dataIndex: 'enableScope', @@ -130,8 +124,8 @@ }); const form = reactive({ - linkOutTime: undefined, - timeOutTime: undefined, + linkOutTime: 60000, + timeOutTime: 60000, authType: 'Basic Auth', }); diff --git a/frontend/src/views/project-management/environmental/locale/en-US.ts b/frontend/src/views/project-management/environmental/locale/en-US.ts index dc45e40f97..ed0bd7b8bc 100644 --- a/frontend/src/views/project-management/environmental/locale/en-US.ts +++ b/frontend/src/views/project-management/environmental/locale/en-US.ts @@ -11,6 +11,7 @@ export default { 'project.environmental.mustContain': 'Must Contain', 'project.environmental.searchParamsHolder': 'Search by name or tag', 'project.environmental.paramName': 'Parameter Name', + 'project.environmental.globalVariable': 'Parameter', 'project.environmental.paramType': 'Type', 'project.environmental.paramTypeTooltip': 'json: only supports UI testing', 'project.environmental.paramValue': 'Parameter Value', diff --git a/frontend/src/views/project-management/environmental/locale/zh-CN.ts b/frontend/src/views/project-management/environmental/locale/zh-CN.ts index 2cf7b6170a..bc738009c4 100644 --- a/frontend/src/views/project-management/environmental/locale/zh-CN.ts +++ b/frontend/src/views/project-management/environmental/locale/zh-CN.ts @@ -11,7 +11,7 @@ export default { 'project.environmental.GLOBAL': '全局参数', 'project.environmental.ENVIRONMENT': '全局参数', 'project.environmental.ENVIRONMENT_PARAM': '全局参数', - 'project.environmental.globalVariable': '全局变量', + 'project.environmental.globalVariable': '参数', 'project.environmental.supportFormat': '仅支持MeterSphere导出的Json文件,单个大小不超过 50M', 'project.environmental.importTile': '注意!导入后会覆盖原全局参数', 'project.environmental.mustContain': '必含',