diff --git a/frontend/src/config/workbench.ts b/frontend/src/config/workbench.ts index be4d491d95..4fe5fc9663 100644 --- a/frontend/src/config/workbench.ts +++ b/frontend/src/config/workbench.ts @@ -342,7 +342,7 @@ export const NAV_NAVIGATION: Record = { lastReportStatus: [ExecuteResultEnum.SUCCESS], // 接口用例-执行结果-已通过 }, [WorkNavValueEnum.API_COUNT_EXECUTE_ERROR]: { - lastReportStatus: [ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 接口用例-执行结果-未通过 + lastReportStatus: [ExecuteResultEnum.ERROR], // 接口用例-执行结果-未通过 }, [WorkNavValueEnum.API_COUNT_EXECUTED_RESULT]: { lastReportStatus: [ExecuteResultEnum.SUCCESS, ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 接口用例-有执行结果 @@ -357,7 +357,7 @@ export const NAV_NAVIGATION: Record = { lastReportStatus: [ExecuteResultEnum.SUCCESS], // 场景用例-执行结果-已通过 }, [WorkNavValueEnum.SCENARIO_COUNT_EXECUTE_ERROR]: { - lastReportStatus: [ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 场景用例-执行结果-未通过 + lastReportStatus: [ExecuteResultEnum.ERROR], // 场景用例-执行结果-未通过 }, [WorkNavValueEnum.SCENARIO_COUNT_EXECUTED_RESULT]: { lastReportStatus: [ExecuteResultEnum.SUCCESS, ExecuteResultEnum.ERROR, ExecuteResultEnum.FAKE_ERROR], // 场景用例-有执行结果 diff --git a/frontend/src/views/workbench/homePage/components/testPlanCount.vue b/frontend/src/views/workbench/homePage/components/testPlanCount.vue index 9d58b506c2..e05ff2ffbf 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanCount.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanCount.vue @@ -162,27 +162,28 @@ ]; const statusPercentList = [ - { status: t('common.notStarted'), count: prepared, percentValue: '0%' }, - { status: t('common.inProgress'), count: running, percentValue: '0%' }, - { status: t('common.completed'), count: finished, percentValue: '0%' }, - { status: t('common.archived'), count: archived, percentValue: '0%' }, + { status: t('common.notStarted'), count: prepared, percentValue: '0.00%' }, + { status: t('common.inProgress'), count: running, percentValue: '0.00%' }, + { status: t('common.completed'), count: finished, percentValue: '0.00%' }, + { 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) => { return { ...item, selected: true, 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 completeData = [