This commit is contained in:
qumeng039@126.com 2025-08-01 17:02:53 +08:00
commit 9698f25da9
2 changed files with 49 additions and 13 deletions

View File

@ -469,8 +469,9 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
customStatisticsObj.hiddenInteractionCount == null
) {
customStatisticsObj.hiddenInteractionCount = 1
customStatisticsObj.groupCount = ids[0] === ids[1] ? 1 : 3
// 创建一个Set来获取不重复的ids
const uniqueIds = new Set(ids);
customStatisticsObj.groupCount = uniqueIds.size;
}
this.statisticsDetailList = this.statisticsDetailList.map((item) => ({

View File

@ -56,7 +56,7 @@
<script setup>
import { defineEmits, onMounted, ref, onUnmounted, computed, watch, nextTick } from "vue"
import { TansTimestamp } from "@/utils/transform"
import { TansTimestamp, getAvatarUrl } from "@/utils/transform"
import nodeHoverImg from "@/assets/images/nodeHover.png"
import * as echarts from "echarts"
import { storeToRefs } from "pinia"
@ -302,10 +302,13 @@ const initChart = async () => {
const links = []
const nodes = []
const edgeWidth = (interactionTime) => {
if (interactionTime > 3) return 4
else if (interactionTime > 10) return 6
else if (interactionTime > 20) return 8
else if (interactionTime > 30) return 10
if(interactionTime === 0) return 1
if(interactionTime === 1) return 2
if(interactionTime <= 2) return 3
if (interactionTime <= 3) return 4
else if (interactionTime <= 10) return 6
else if (interactionTime <= 20) return 8
else if (interactionTime <= 30) return 10
else return 1
}
//
@ -321,9 +324,9 @@ const initChart = async () => {
//
avatarData: item.avatarData,
//
defaultAvatar: item.defaultAvatar,
defaultAvatar: getAvatarUrl(item.defaultAvatar),
//
activeAvatar: item.activeAvatar,
activeAvatar: getAvatarUrl(item.activeAvatar),
//
fans: item.fans,
symbolSize: 40,
@ -558,7 +561,8 @@ const initChart = async () => {
animationDurationUpdate: 3500, //
data: data.nodes.map((node) => ({
...node,
symbolSize: 40,
symbol: node.defaultAvatar ? `image://${node.defaultAvatar}` : "circle",
symbolSize: node.defaultAvatar ? 140 : 40,
itemStyle: {
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
{ offset: 1, color: "#1a3860" }, //
@ -586,7 +590,6 @@ const initChart = async () => {
links: data.links,
lineStyle: {
color: "#37ACD7",
width: 1
}
}
]
@ -596,7 +599,39 @@ const initChart = async () => {
const highLightUserNodes = (newHiglightUserIdList) => {
if (!newHiglightUserIdList) return
chart.dispatchAction({
// activeAvatar
chartsData.value.nodes.forEach((node) => {
if (newHiglightUserIdList.includes(node.id) && node.activeAvatar) {
node.symbol = `image://${node.activeAvatar}`
node.symbolSize = 140
} else {
node.symbol = "circle"
node.symbolSize = 40
node.itemStyle = {
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
{ offset: 1, color: "#1a3860" }, //
{ offset: 0.5, color: "#38546b" }, //
{ offset: 0, color: "#5fb3b3" } //
]),
opacity: 1,
borderColor: "#46C6AD",
borderWidth: 1,
shadowBlur: 4,
borderType: "dashed",
shadowColor: "rgba(19, 27, 114, 0.25)"
}
}
})
chart.setOption({
series: [
{
data: chartsData.value.nodes
}
]
})
/* chart.dispatchAction({
type: "downplay",
seriesIndex: 0
})
@ -612,7 +647,7 @@ const highLightUserNodes = (newHiglightUserIdList) => {
})
}
})
}, 1000)
}, 1000) */
}
const handleClickNode = () => {