From ea01543ab9649658773c886ebcd8dcf64a2401c9 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 29 Oct 2021 13:50:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=BF=E5=85=8D=E5=85=B3=E7=B3=BB?= =?UTF-8?q?=E5=9B=BE=E9=97=B4=E9=9A=99=E5=A4=AA=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/dto/RelationshipGraphData.java | 5 +++++ .../java/io/metersphere/service/RelationshipEdgeService.java | 4 ++-- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java b/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java index 0e6fd4bccc..2adc97e09a 100644 --- a/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java +++ b/backend/src/main/java/io/metersphere/dto/RelationshipGraphData.java @@ -15,6 +15,11 @@ public class RelationshipGraphData { private List data; private List links; + // x 轴占用了多少单位 + private int xUnitCount; + // y 轴占用了多少单位 + private int yUnitCount; + public RelationshipGraphData() { this.data = new ArrayList<>(); this.links = new ArrayList<>(); diff --git a/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java b/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java index fc9b7ac07d..398a9bf04c 100644 --- a/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java +++ b/backend/src/main/java/io/metersphere/service/RelationshipEdgeService.java @@ -63,7 +63,7 @@ public class RelationshipEdgeService { // 去掉要删除的边 edges = edges.stream() - .filter(i -> i.getSourceId() != sourceId || i.getTargetId() != targetId) + .filter(i -> !i.getSourceId().equals(sourceId) && !i.getTargetId().equals(targetId)) .collect(Collectors.toList()); Set nodes = new HashSet<>(); @@ -114,7 +114,7 @@ public class RelationshipEdgeService { } nextLevelNodes.forEach(nextNode -> { - if (!markSet.contains(node)) { + if (!markSet.contains(nextNode)) { dfsForMark(nextNode, edges, markSet, true); dfsForMark(nextNode, edges, markSet, false); } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 1f86f9d47a..0405160366 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 1f86f9d47a27e67b4c1e21d94c2ccfacfccc7288 +Subproject commit 040516036651363ae9775ccfb57714ac81e7230e diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index b50fa6030e..295f852bd8 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit b50fa6030ea19d01985aabed1e7d9d804737ad59 +Subproject commit 295f852bd8ae7062e769a6de6011d08a2bd6b4c4