fix(工作台): 修复工作台接口未通过不包含误报状态入参&测试计划卡片bug

This commit is contained in:
xinxin.wu 2024-12-16 18:05:18 +08:00 committed by Craftsman
parent 91d850a36a
commit 9828dfb123
2 changed files with 14 additions and 13 deletions

View File

@ -342,7 +342,7 @@ export const NAV_NAVIGATION: Record<WorkNavValueEnum, any> = {
lastReportStatus: [ExecuteResultEnum.SUCCESS], // 接口用例-执行结果-已通过 lastReportStatus: [ExecuteResultEnum.SUCCESS], // 接口用例-执行结果-已通过
}, },
[WorkNavValueEnum.API_COUNT_EXECUTE_ERROR]: { [WorkNavValueEnum.API_COUNT_EXECUTE_ERROR]: {
lastReportStatus: [ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 接口用例-执行结果-未通过 lastReportStatus: [ExecuteResultEnum.ERROR], // 接口用例-执行结果-未通过
}, },
[WorkNavValueEnum.API_COUNT_EXECUTED_RESULT]: { [WorkNavValueEnum.API_COUNT_EXECUTED_RESULT]: {
lastReportStatus: [ExecuteResultEnum.SUCCESS, ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 接口用例-有执行结果 lastReportStatus: [ExecuteResultEnum.SUCCESS, ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 接口用例-有执行结果
@ -357,7 +357,7 @@ export const NAV_NAVIGATION: Record<WorkNavValueEnum, any> = {
lastReportStatus: [ExecuteResultEnum.SUCCESS], // 场景用例-执行结果-已通过 lastReportStatus: [ExecuteResultEnum.SUCCESS], // 场景用例-执行结果-已通过
}, },
[WorkNavValueEnum.SCENARIO_COUNT_EXECUTE_ERROR]: { [WorkNavValueEnum.SCENARIO_COUNT_EXECUTE_ERROR]: {
lastReportStatus: [ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 场景用例-执行结果-未通过 lastReportStatus: [ExecuteResultEnum.ERROR], // 场景用例-执行结果-未通过
}, },
[WorkNavValueEnum.SCENARIO_COUNT_EXECUTED_RESULT]: { [WorkNavValueEnum.SCENARIO_COUNT_EXECUTED_RESULT]: {
lastReportStatus: [ExecuteResultEnum.SUCCESS, ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 场景用例-有执行结果 lastReportStatus: [ExecuteResultEnum.SUCCESS, ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 场景用例-有执行结果

View File

@ -162,27 +162,28 @@
]; ];
const statusPercentList = [ const statusPercentList = [
{ status: t('common.notStarted'), count: prepared, percentValue: '0%' }, { status: t('common.notStarted'), count: prepared, percentValue: '0.00%' },
{ status: t('common.inProgress'), count: running, percentValue: '0%' }, { status: t('common.inProgress'), count: running, percentValue: '0.00%' },
{ status: t('common.completed'), count: finished, percentValue: '0%' }, { status: t('common.completed'), count: finished, percentValue: '0.00%' },
{ status: t('common.archived'), count: archived, percentValue: '0%' }, { status: t('common.archived'), count: archived, percentValue: '0.00%' },
]; ];
const total = statusPercentList.reduce((sum, item) => sum + item.count, 0);
const listStatusPercentList = statusPercentList.map((item) => ({
...item,
percentValue: total > 0 ? `${((item.count / total) * 100).toFixed(2)}%` : '0.00%',
}));
statusPercentValue.value = (statusPercentList || []).map((item, index) => { statusPercentValue.value = (statusPercentList || []).map((item, index) => {
return { return {
...item, ...item,
selected: true, selected: true,
color: `${colorMapConfig[props.item.key][index]}`, color: `${colorMapConfig[props.item.key][index]}`,
percentValue: total > 0 ? `${((item.count / total) * 100).toFixed(2)}%` : '0.00%',
}; };
}); });
const total = statusPercentList.reduce((sum, item) => sum + item.count, 0);
const listStatusPercentList = statusPercentList.map((item) => ({
...item,
percentValue: total > 0 ? `${((item.count / total) * 100).toFixed(2)}%` : '0%',
}));
const completeRate = total > 0 ? parseFloat((((finished + archived) / total) * 100).toFixed(2)) : 0; const completeRate = total > 0 ? parseFloat((((finished + archived) / total) * 100).toFixed(2)) : 0;
const completeData = [ const completeData = [