From 76bdd3535ab9caffb13f48f8bfd60fef4b37968d Mon Sep 17 00:00:00 2001 From: duanhao Date: Mon, 11 Aug 2025 09:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BA=A2=E8=89=B2=E5=9C=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GroupEvolution/component/groupGraph.vue | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/views/GroupEvolution/component/groupGraph.vue b/src/views/GroupEvolution/component/groupGraph.vue index b329fbb..5dd8158 100644 --- a/src/views/GroupEvolution/component/groupGraph.vue +++ b/src/views/GroupEvolution/component/groupGraph.vue @@ -185,7 +185,7 @@ const clusterAnalyze = () => { node.color = color }) graphVis.addNodesInGroup(nodes, { - shape: "polygon", //circle|rect|polygon|bubbleset + shape: "circle", //circle|rect|polygon|bubbleset color: color, alpha: 0.2 }) @@ -233,43 +233,53 @@ const clusterAnalyze = () => { g.smoothPath = false; }); */ - // 时间门控:达到阈值就把各组异常节点染红 + 加红圈 + // 时间门控:达到阈值就把各组异常节点染红 const shouldA = now >= TA; const shouldB = now >= TB; const shouldC = now >= TC; if(shouldA) { - console.log("A异常") - graphVis.nodes = graphVis.nodes.map(n => { if(props.store.graphAbnormalData.groupA.includes(n.id)) { n.fillColor = RED; } return n; }) + console.log(graphVis.nodes) + graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupA.includes(n.id)), { + shape: "circle", + color: RED, + alpha: GROUP_ALPHA + }) + } if(shouldB) { - console.log("B异常") graphVis.nodes = graphVis.nodes.map(n => { if(props.store.graphAbnormalData.groupB.includes(n.id)) { n.fillColor = RED; } return n; }) + graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupB.includes(n.id)), { + shape: "circle", + color: RED, + alpha: GROUP_ALPHA + }) + } if(shouldC) { - console.log("C异常") - graphVis.nodes = graphVis.nodes.map(n => { if(props.store.graphAbnormalData.groupC.includes(n.id)) { n.fillColor = RED; } return n; }) + graphVis.addNodesInGroup(graphVis.nodes.filter(n => props.store.graphAbnormalData.groupC.includes(n.id)), { + shape: "circle", + color: RED, + alpha: GROUP_ALPHA + }) } - - - graphVis.autoGroupLayout(graphVis.nodes); graphVis.zoomFit(); // 没有 refresh;这两个就够 }