From 266fbd008f803ab3809fca2c17e78bff8597c9c0 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 23 Mar 2021 19:44:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E5=9B=BE=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/service/TrackService.java | 9 --------- .../components/track/home/TrackHome.vue | 18 +++++++++++------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TrackService.java b/backend/src/main/java/io/metersphere/track/service/TrackService.java index 36377ea65c..a2aae3ce11 100644 --- a/backend/src/main/java/io/metersphere/track/service/TrackService.java +++ b/backend/src/main/java/io/metersphere/track/service/TrackService.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; @Service @Transactional(rollbackFor = Exception.class) @@ -87,18 +86,10 @@ public class TrackService { public List getCaseMaintenanceBar(String projectId) { List funcMaintainer = extTestCaseMapper.countFuncMaintainer(projectId); List relevanceMaintainer = extTestCaseMapper.countRelevanceMaintainer(projectId); - List list = relevanceMaintainer.stream().map(TrackCountResult::getGroupField).collect(Collectors.toList()); List charts = new ArrayList<>(); for (TrackCountResult result : funcMaintainer) { String groupField = result.getGroupField(); - if (!list.contains(groupField)) { - // 创建了功能用例,但是未关联测试 - TrackCountResult trackCount = new TrackCountResult(); - trackCount.setCountNumber(0); - trackCount.setGroupField(groupField); - relevanceMaintainer.add(trackCount); - } ChartsData chartsData = new ChartsData(); chartsData.setxAxis(groupField); chartsData.setyAxis(BigDecimal.valueOf(result.getCountNumber())); diff --git a/frontend/src/business/components/track/home/TrackHome.vue b/frontend/src/business/components/track/home/TrackHome.vue index 206a2af82e..db7d4f2ad3 100644 --- a/frontend/src/business/components/track/home/TrackHome.vue +++ b/frontend/src/business/components/track/home/TrackHome.vue @@ -34,7 +34,8 @@
- +
@@ -73,7 +74,7 @@ import MsMainContainer from "@/business/components/common/components/MsMainConta import MsContainer from "@/business/components/common/components/MsContainer"; import CaseCountCard from "@/business/components/track/home/components/CaseCountCard"; import RelevanceCaseCard from "@/business/components/track/home/components/RelevanceCaseCard"; -import {getCurrentProjectID,getUUID} from "@/common/js/utils"; +import {getCurrentProjectID, getUUID} from "@/common/js/utils"; import CaseMaintenance from "@/business/components/track/home/components/CaseMaintenance"; import {COUNT_NUMBER, COUNT_NUMBER_SHALLOW} from "@/common/js/constants"; import BugCountCard from "@/business/components/track/home/components/BugCountCard"; @@ -136,8 +137,8 @@ export default { xAxis.push(d.xAxis); } }); - let yAxis1 = data.filter(d => d.groupName === 'FUNCTIONCASE').map(d => d.yAxis); - let yAxis2 = data.filter(d => d.groupName === 'RELEVANCECASE').map(d => d.yAxis); + let yAxis1 = data.filter(d => d.groupName === 'FUNCTIONCASE').map(d => [d.xAxis, d.yAxis]); + let yAxis2 = data.filter(d => d.groupName === 'RELEVANCECASE').map(d => [d.xAxis, d.yAxis]); let option = { tooltip: { trigger: 'axis', @@ -186,12 +187,15 @@ export default { }; this.caseOption = option; }, - redirectPage(page,dataType,selectType){ + redirectPage(page, dataType, selectType) { //test_plan 页面跳转 // this.$router.push('/track/plan/view/'+selectType); - switch (page){ + switch (page) { case "case": - this.$router.push({name:'testCase',params:{dataType:dataType,dataSelectRange:selectType, projectId: getCurrentProjectID()}}); + this.$router.push({ + name: 'testCase', + params: {dataType: dataType, dataSelectRange: selectType, projectId: getCurrentProjectID()} + }); break; } }