From 58e2e87328adf6ae452691b257f3b368f0738674 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 14 Mar 2024 14:07:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=BA=E6=99=AF=E5=88=9B=E5=BB=BA=E5=8F=82?= =?UTF-8?q?=E6=95=B0tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/api-test/components/paramTable.vue | 4 +- .../api-test/scenario/components/params.vue | 154 +++++++++++++++++- .../views/api-test/scenario/detail/index.vue | 3 +- .../views/api-test/scenario/locale/en-US.ts | 9 + .../views/api-test/scenario/locale/zh-CN.ts | 9 + 5 files changed, 174 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue index 85e24b4883..3b884a50d4 100644 --- a/frontend/src/views/api-test/components/paramTable.vue +++ b/frontend/src/views/api-test/components/paramTable.vue @@ -721,7 +721,7 @@ if (!item) { // 批量添加过来的数据最后一行会是 undefined return { - ...props.defaultParamItem, + ...cloneDeep(props.defaultParamItem), id: new Date().getTime() + i, }; } @@ -743,7 +743,7 @@ paramsData.value = [ { id, // 默认给时间戳 id,若 props.defaultParamItem 有 id,则覆盖 - ...props.defaultParamItem, + ...cloneDeep(props.defaultParamItem), enable: true, // 是否勾选 }, ] as any[]; diff --git a/frontend/src/views/api-test/scenario/components/params.vue b/frontend/src/views/api-test/scenario/components/params.vue index e140bbe2b7..fba35ce946 100644 --- a/frontend/src/views/api-test/scenario/components/params.vue +++ b/frontend/src/views/api-test/scenario/components/params.vue @@ -1,7 +1,157 @@ - + diff --git a/frontend/src/views/api-test/scenario/detail/index.vue b/frontend/src/views/api-test/scenario/detail/index.vue index 876ade1098..8c51749087 100644 --- a/frontend/src/views/api-test/scenario/detail/index.vue +++ b/frontend/src/views/api-test/scenario/detail/index.vue @@ -51,7 +51,7 @@ :title="t('apiScenario.params')" class="px-[24px] py-[16px]" > - + import('../components/quote.vue')); const setting = defineAsyncComponent(() => import('../components/setting.vue')); + const allParams = ref([]); const props = defineProps<{ detail: RequestParam; }>(); diff --git a/frontend/src/views/api-test/scenario/locale/en-US.ts b/frontend/src/views/api-test/scenario/locale/en-US.ts index 53440cae2a..56fa0b2586 100644 --- a/frontend/src/views/api-test/scenario/locale/en-US.ts +++ b/frontend/src/views/api-test/scenario/locale/en-US.ts @@ -23,4 +23,13 @@ export default { 'apiScenario.changeHistory': 'Change history', 'apiScenario.dependency': 'Dependencies', 'apiScenario.quote': 'Reference', + 'apiScenario.params.convention': 'Convention parameter', + 'apiScenario.params.searchPlaceholder': 'Search by name or tag', + 'apiScenario.params.priority': + 'Variable priority: Temporary parameters>Scene parameters>Environment parameters>Global parameters; Note: Avoid using variables with the same name. When using variables with the same name, scene level CSV has the highest priority', + 'apiScenario.params.name': 'Variable name', + 'apiScenario.params.type': 'Type', + 'apiScenario.params.paramValue': 'Parameter value', + 'apiScenario.params.tag': 'Tag', + 'apiScenario.params.desc': 'Description', }; diff --git a/frontend/src/views/api-test/scenario/locale/zh-CN.ts b/frontend/src/views/api-test/scenario/locale/zh-CN.ts index aa2ea19305..5642dfec92 100644 --- a/frontend/src/views/api-test/scenario/locale/zh-CN.ts +++ b/frontend/src/views/api-test/scenario/locale/zh-CN.ts @@ -22,4 +22,13 @@ export default { 'apiScenario.changeHistory': '变更历史', 'apiScenario.dependency': '依赖关系', 'apiScenario.quote': '引用关系', + 'apiScenario.params.convention': '常规参数', + 'apiScenario.params.searchPlaceholder': '通过名称或标签搜索', + 'apiScenario.params.priority': + '变量优先级:临时参数>场景参数 >环境参数>全局参数;注: 避免使用同名变量,同名变量时场景级 CSV 优先级最高', + 'apiScenario.params.name': '变量名称', + 'apiScenario.params.type': '类型', + 'apiScenario.params.paramValue': '参数值', + 'apiScenario.params.tag': '标签', + 'apiScenario.params.desc': '描述', };