From 2b6b9b7d51bcdae9d8d5d3cb3f57b26c796b139e Mon Sep 17 00:00:00 2001 From: duanhao Date: Wed, 6 Aug 2025 16:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/groupEvolution.js | 6 - .../GroupEvolution/component/groupGraph.vue | 126 ------------------ .../GroupEvolution/groupMember/index.vue | 1 - 3 files changed, 133 deletions(-) diff --git a/src/service/api/groupEvolution.js b/src/service/api/groupEvolution.js index a439e23..5e1dd96 100644 --- a/src/service/api/groupEvolution.js +++ b/src/service/api/groupEvolution.js @@ -26,7 +26,6 @@ export function getRelationGraphByUtcTime(utcTime) { } // 3.群体成员演化分析 -<<<<<<< HEAD // 3.1 获取时间线数据 export function getGroupMemberTimeLine() { return http.get(`/groupEvolution/groupMember/timeline`) @@ -45,9 +44,4 @@ export function getGroupMemberChart() { // 3.4 群体演化信息 export function getGroupMemberEvolutionInfoByTime(date) { return http.get(`/groupEvolution/groupMember/changeList?date=${date}`) -======= -// 3.1 群体成员演化信息列表信息 -export function getGroupMemberInfoList() { - return http.get(`/groupEvolution/groupMember/infoList`) ->>>>>>> 90124585f151f0a2286527a4c2e9232b86951cfb } diff --git a/src/views/GroupEvolution/component/groupGraph.vue b/src/views/GroupEvolution/component/groupGraph.vue index 8e8a263..5bfc4db 100644 --- a/src/views/GroupEvolution/component/groupGraph.vue +++ b/src/views/GroupEvolution/component/groupGraph.vue @@ -39,132 +39,6 @@ const handlePointerDown = (time) => { emit("click:pointerDownAndSlide", utcTime) } -<<<<<<< HEAD -======= -const initChart = () => { - if (chart == null) { - chart = echarts.init(document.getElementById("container")) - } - if (Object.keys(graph.value).length === 0) { - chart.clear() - return - } - - function variableColorAndPos(groupId) { - const resultMap = { - 0: { color: "#1f8473", x: 100, y: 100 }, - 1: { color: "#807d2c", x: 300, y: 300 }, - 6: { color: "#0c7090", x: 600, y: 600 } - } - return resultMap[parseInt(groupId)] - } - - const option = { - //hover上去的窗口 - tooltip: { - trigger: "item", - backgroundColor: "rgba(0,0,0,0)", // 透明背景 - borderColor: "rgba(0,0,0,0)", // 透明边框 - borderWidth: 0, - extraCssText: "box-shadow:none;padding:0;", - formatter: function (params) { - if (params.dataType === "node") { - return `
-
-
用户名:${params.data.name}
-
组ID:${params.data.groupId}
-
-
` - } - return "" - } - }, - emphasis: { - edgeLabel: { - show: true, - color: "#fff", - fontSize: 18, - textShadowColor: "#fff", - textShadowBlur: 0, - textShadowOffsetX: 0, - textShadowOffsetY: 0 - } - }, - series: [ - { - type: "graph", - layout: "force", - animation: false, - draggable: true, - roam: true, - zoom: 0.1, - force: { - initLayout: "circular", // 初始布局使用圆形 - edgeLength: 6000, - repulsion: 5000, - gravity: 0.1, - friction: 0.02, - coolingFactor: 0.1 - }, - - animationDurationUpdate: 3500, // 节点移动更平滑 - data: graph.value?.nodes.map((node) => ({ - ...node, - symbol: "circle", - x: variableColorAndPos(node.groupId).x, - y: variableColorAndPos(node.groupId).y, - symbolSize: 40, - itemStyle: { - color: variableColorAndPos(node.groupId).color, - opacity: 1, - borderColor: "#46C6AD", - borderWidth: 1, - shadowBlur: 4, - borderType: "solid", - shadowColor: "rgba(19, 27, 114, 0.25)" - } - })), - links: graph.value?.links, - lineStyle: { - color: "#37ACD7", - width: 1 - } - } - ] - } - chart.setOption(option) -} - -onMounted(() => { - initChart() -}) -let lastPostsLength = 0 //当列表更新时,记录上一次的长度 -watch( - () => graph.value, - (newValue) => { - if (newValue.nodes.length > lastPostsLength) { - nextTick(() => { - initChart() - }) - } - lastPostsLength = newValue.nodes.length //实现按需更新 - }, - { deep: true } -) ->>>>>>> 90124585f151f0a2286527a4c2e9232b86951cfb