From f18e51a4e3d062edd207cac178e3a02bee571b25 Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Tue, 9 Apr 2024 16:37:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=89=B9=E9=87=8F=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=AE=8C=E6=88=90=E5=90=8E=E6=B2=A1=E6=9C=89=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=87=BA=E5=A4=B1=E8=B4=A5=E6=95=B0=E6=8D=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1038854 --user=宋天阳 【接口测试】场景列表-批量移动场景到目标模块下已存在-提示成功-实际失败 https://www.tapd.cn/55049933/s/1491870 --- frontend/src/api/modules/api-test/scenario.ts | 5 +++-- frontend/src/models/apiTest/scenario.ts | 6 ++++++ .../views/api-test/scenario/components/scenarioTable.vue | 6 ++++-- frontend/src/views/api-test/scenario/locale/en-US.ts | 2 +- frontend/src/views/api-test/scenario/locale/zh-CN.ts | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index c4c92d793a..e8b1887ea0 100644 --- a/frontend/src/api/modules/api-test/scenario.ts +++ b/frontend/src/api/modules/api-test/scenario.ts @@ -46,6 +46,7 @@ import { ExecuteConditionProcessor } from '@/models/apiTest/common'; import { ApiScenarioBatchDeleteParams, ApiScenarioBatchEditParams, + ApiScenarioBatchOptionResult, ApiScenarioBatchRunParams, ApiScenarioDebugRequest, ApiScenarioGetModuleParams, @@ -147,10 +148,10 @@ export function batchOptionScenario( } ) { if (optionType === 'batchMove') { - return MSR.post({ url: BatchMoveScenarioUrl, data }); + return MSR.post({ url: BatchMoveScenarioUrl, data }); } if (optionType === 'batchCopy') { - return MSR.post({ url: BatchCopyScenarioUrl, data }); + return MSR.post({ url: BatchCopyScenarioUrl, data }); } } diff --git a/frontend/src/models/apiTest/scenario.ts b/frontend/src/models/apiTest/scenario.ts index 37aaf5f252..0437fa1c9e 100644 --- a/frontend/src/models/apiTest/scenario.ts +++ b/frontend/src/models/apiTest/scenario.ts @@ -472,3 +472,9 @@ export interface GetSystemRequestParams { scenarioRequest?: GetSystemRequestTypeParams; refType: ScenarioStepRefType.COPY | ScenarioStepRefType.REF; } + +// 场景批量操作结果 +export interface ApiScenarioBatchOptionResult { + success: number; + error: number; +} diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index 3f7a6406cb..ecc5d3bb9c 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -790,6 +790,7 @@ dataIndex: 'environmentName', showDrag: true, width: 159, + showTooltip: true, }, { title: 'apiScenario.table.columns.steps', @@ -1361,7 +1362,7 @@ } else if (isBatchCopy.value) { optionType = 'batchCopy'; } - await batchOptionScenario(optionType, { + const res = await batchOptionScenario(optionType, { selectIds: batchParams.value?.selectedIds || [], selectAll: !!batchParams.value?.selectAll, excludeIds: batchParams.value?.excludeIds || [], @@ -1374,7 +1375,8 @@ Message.success( t('api_scenario.batch_operation.success', { opt: batchOptionType.value, - name: selectedBatchOptModuleName?.value, + success: res?.success, + error: res?.error, }) ); tableSelected.value = []; 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 4ca034b0e8..cbe916c800 100644 --- a/frontend/src/views/api-test/scenario/locale/en-US.ts +++ b/frontend/src/views/api-test/scenario/locale/en-US.ts @@ -57,7 +57,7 @@ export default { 'apiScenario.times': 'bout', 'apiScenario.executionResult': 'Execution result', // 批量操作文案 - 'api_scenario.batch_operation.success': 'Success {opt} to {name}', + 'api_scenario.batch_operation.success': 'Success {success} ,error {error} ', 'api_scenario.table.batchMoveConfirm': 'Ready to {opt} {count} scenarios', 'apiScenario.name': 'Scene name', 'apiScenario.nameRequired': 'Scene name cannot be empty', 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 594ce15f62..4df1876120 100644 --- a/frontend/src/views/api-test/scenario/locale/zh-CN.ts +++ b/frontend/src/views/api-test/scenario/locale/zh-CN.ts @@ -72,7 +72,7 @@ export default { 'apiScenario.updateRefScenarioSuccess': '引用场景数据已更新', 'apiScenario.replaceSuccess': '步骤替换成功', // 批量操作文案 - 'api_scenario.batch_operation.success': '成功{opt}至 {name}', + 'api_scenario.batch_operation.success': '成功{opt} {success} 条,失败 {error} 条', 'api_scenario.table.batchMoveConfirm': '{opt}{count}个场景至已选模块', 'apiScenario.name': '场景名称', 'apiScenario.nameRequired': '场景名称不能为空',