From d608df0e93e47c37a8875a77845f53c3177dd1a2 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 25 Mar 2024 14:38:09 +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=E8=B0=83=E8=AF=95=E6=A0=B7=E5=BC=8F=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1037308 --user=宋天阳 【接口测试】定义-新建接口-后置-提取参数-表达式没有提示信息 https://www.tapd.cn/55049933/s/1479761 --- .../business/ms-params-input/index.vue | 26 ++++++++++++++++++- .../api-test/components/condition/content.vue | 1 + .../project-management/commonScript/index.vue | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/business/ms-params-input/index.vue b/frontend/src/components/business/ms-params-input/index.vue index f4dcafaa03..37b79d3851 100644 --- a/frontend/src/components/business/ms-params-input/index.vue +++ b/frontend/src/components/business/ms-params-input/index.vue @@ -378,10 +378,34 @@ }; const paramForm = ref>({ ...defaultParamForm }); const paramFormRef = ref(); - const paramTypeOptions: CascaderOption[] = cloneDeep(mockAllGroup); const paramFuncOptions: MockParamItem[] = cloneDeep(mockFunctions); const currentParamsInputGroup = ref([]); + function genMockParamTypeOptions() { + // 国际化处理 + const mockParamTypeOptions: { label: string; value: string; children: any }[] = []; + mockAllGroup.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, + }; + mockParamTypeOptions.push(option); + }); + return mockParamTypeOptions; + } + const paramTypeOptions = genMockParamTypeOptions(); + /** * 切换变量类型,设置变量输入框的输入组 * @param val 变量类型 diff --git a/frontend/src/views/api-test/components/condition/content.vue b/frontend/src/views/api-test/components/condition/content.vue index 14f08de1ff..7258c8ba0a 100644 --- a/frontend/src/views/api-test/components/condition/content.vue +++ b/frontend/src/views/api-test/components/condition/content.vue @@ -373,6 +373,7 @@ v-model:model-value="record.expression" class="ms-params-input" :max-length="255" + :placeholder="t('ms.paramsInput.commonPlaceholder')" size="mini" @input="() => handleExpressionChange(rowIndex)" @change="() => handleExpressionChange(rowIndex)" diff --git a/frontend/src/views/project-management/commonScript/index.vue b/frontend/src/views/project-management/commonScript/index.vue index 65a14fae80..706b7ef1f5 100644 --- a/frontend/src/views/project-management/commonScript/index.vue +++ b/frontend/src/views/project-management/commonScript/index.vue @@ -106,7 +106,7 @@ CommonScriptItem, ParamsRequestType, } from '@/models/projectManagement/commonScript'; - import { TableKeyEnum } from '@/enums/tableEnum'; + import { ColumnEditTypeEnum, TableKeyEnum } from '@/enums/tableEnum'; const appStore = useAppStore(); const currentProjectId = computed(() => appStore.currentProjectId); @@ -137,6 +137,7 @@ dataIndex: 'description', width: 200, showDrag: true, + showTooltip: true, }, { title: 'project.commonScript.enable',