fix(接口测试): 修复场景批量操作完成后没有提示出失败数据统计的问题

--bug=1038854 --user=宋天阳 【接口测试】场景列表-批量移动场景到目标模块下已存在-提示成功-实际失败 https://www.tapd.cn/55049933/s/1491870
This commit is contained in:
Jianguo-Genius 2024-04-09 16:37:17 +08:00 committed by 刘瑞斌
parent 3b4a12a362
commit f18e51a4e3
5 changed files with 15 additions and 6 deletions

View File

@ -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<ApiScenarioBatchOptionResult>({ url: BatchMoveScenarioUrl, data });
}
if (optionType === 'batchCopy') {
return MSR.post({ url: BatchCopyScenarioUrl, data });
return MSR.post<ApiScenarioBatchOptionResult>({ url: BatchCopyScenarioUrl, data });
}
}

View File

@ -472,3 +472,9 @@ export interface GetSystemRequestParams {
scenarioRequest?: GetSystemRequestTypeParams;
refType: ScenarioStepRefType.COPY | ScenarioStepRefType.REF;
}
// 场景批量操作结果
export interface ApiScenarioBatchOptionResult {
success: number;
error: number;
}

View File

@ -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 = [];

View File

@ -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',

View File

@ -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': '场景名称不能为空',