diff --git a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java index af7361cd17..e79000abaf 100644 --- a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java +++ b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java @@ -1323,7 +1323,7 @@ public class DashboardService { List nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize); Map> statusStatisticsMap = new HashMap<>(); statusStatisticsMap.put("retentionRate", nameCountDTOS); - List headerStatusOption = getHeaderStatusOption(projectId, platformName); + List headerStatusOption = getHeaderStatusOption(projectId, platformName, new ArrayList<>()); Map> bugMap = allSimpleList.stream().collect(Collectors.groupingBy(Bug::getStatus)); List bugPercentList = bulidBugPercentList(headerStatusOption, bugMap, totalSize); statisticsDTO.setStatusStatisticsMap(statusStatisticsMap); @@ -1361,10 +1361,10 @@ public class DashboardService { retentionRate.setCount(getTurnCount(divide)); } retentionRates.add(retentionRate); - NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount")); - retentionRates.add(total); NameCountDTO retentionDTO = getNameCountDTO(statusSize, Translator.get("bug_management.retentionCount")); retentionRates.add(retentionDTO); + NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount")); + retentionRates.add(total); return retentionRates; } @@ -1412,7 +1412,7 @@ public class DashboardService { List planBugList = extTestPlanMapper.getPlanBugList(projectId, TestPlanConstants.TEST_PLAN_TYPE_PLAN, new ArrayList<>(platforms), null); List localLastStepStatus = getBugEndStatus(projectId, platformName); List legacyBugList = planBugList.stream().filter(t -> !localLastStepStatus.contains(t.getText())).toList(); - List headerStatusOption = getHeaderStatusOption(projectId, platformName); + List headerStatusOption = getHeaderStatusOption(projectId, platformName, localLastStepStatus); int statusSize = CollectionUtils.isEmpty(legacyBugList) ? 0 : legacyBugList.size(); int totalSize = CollectionUtils.isEmpty(planBugList) ? 0 : planBugList.size(); List nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize); @@ -1441,7 +1441,7 @@ public class DashboardService { } @NotNull - private List getHeaderStatusOption(String projectId, String platformName) { + private List getHeaderStatusOption(String projectId, String platformName, List endStatus) { List allLocalStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); List headerStatusOption = new ArrayList<>(allLocalStatusOptions); if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) { @@ -1450,7 +1450,7 @@ public class DashboardService { headerStatusOption.addAll(thirdStatusOptions); } } - headerStatusOption = headerStatusOption.stream().distinct().toList(); + headerStatusOption = headerStatusOption.stream().filter(t->!endStatus.contains(t.getValue())).distinct().toList(); return headerStatusOption; } diff --git a/frontend/src/views/workbench/homePage/components/defectCount.vue b/frontend/src/views/workbench/homePage/components/defectCount.vue index 11aea89a55..b22390af8d 100644 --- a/frontend/src/views/workbench/homePage/components/defectCount.vue +++ b/frontend/src/views/workbench/homePage/components/defectCount.vue @@ -135,7 +135,9 @@ hasPermission.value = errorCode !== 109001; countOptions.value = handlePieData(props.item.key, hasPermission.value, statusPercentList); - + if (props.item.key === WorkCardEnum.PLAN_LEGACY_BUG) { + countOptions.value.title.text = t('workbench.homePage.legacyDefectsNumber'); + } const [rate, totalBug, legacy] = statusStatisticsMap?.retentionRate || []; const unLegacy = totalBug && legacy ? totalBug.count - legacy.count : 0;