边权重修改

This commit is contained in:
duanhao 2025-08-01 16:55:47 +08:00
parent b0a09203d3
commit d3dc2daed9
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 == null
) { ) {
customStatisticsObj.hiddenInteractionCount = 1 customStatisticsObj.hiddenInteractionCount = 1
// 创建一个Set来获取不重复的ids
customStatisticsObj.groupCount = ids[0] === ids[1] ? 1 : 3 const uniqueIds = new Set(ids);
customStatisticsObj.groupCount = uniqueIds.size;
} }
this.statisticsDetailList = this.statisticsDetailList.map((item) => ({ this.statisticsDetailList = this.statisticsDetailList.map((item) => ({

View File

@ -56,7 +56,7 @@
<script setup> <script setup>
import { defineEmits, onMounted, ref, onUnmounted, computed, watch, nextTick } from "vue" 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 nodeHoverImg from "@/assets/images/nodeHover.png"
import * as echarts from "echarts" import * as echarts from "echarts"
import { storeToRefs } from "pinia" import { storeToRefs } from "pinia"
@ -302,10 +302,13 @@ const initChart = async () => {
const links = [] const links = []
const nodes = [] const nodes = []
const edgeWidth = (interactionTime) => { const edgeWidth = (interactionTime) => {
if (interactionTime > 3) return 4 if(interactionTime === 0) return 1
else if (interactionTime > 10) return 6 if(interactionTime === 1) return 2
else if (interactionTime > 20) return 8 if(interactionTime <= 2) return 3
else if (interactionTime > 30) return 10 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 else return 1
} }
// //
@ -321,9 +324,9 @@ const initChart = async () => {
// //
avatarData: item.avatarData, avatarData: item.avatarData,
// //
defaultAvatar: item.defaultAvatar, defaultAvatar: getAvatarUrl(item.defaultAvatar),
// //
activeAvatar: item.activeAvatar, activeAvatar: getAvatarUrl(item.activeAvatar),
// //
fans: item.fans, fans: item.fans,
symbolSize: 40, symbolSize: 40,
@ -558,7 +561,8 @@ const initChart = async () => {
animationDurationUpdate: 3500, // animationDurationUpdate: 3500, //
data: data.nodes.map((node) => ({ data: data.nodes.map((node) => ({
...node, ...node,
symbolSize: 40, symbol: node.defaultAvatar ? `image://${node.defaultAvatar}` : "circle",
symbolSize: node.defaultAvatar ? 140 : 40,
itemStyle: { itemStyle: {
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [ color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
{ offset: 1, color: "#1a3860" }, // { offset: 1, color: "#1a3860" }, //
@ -586,7 +590,6 @@ const initChart = async () => {
links: data.links, links: data.links,
lineStyle: { lineStyle: {
color: "#37ACD7", color: "#37ACD7",
width: 1
} }
} }
] ]
@ -596,7 +599,39 @@ const initChart = async () => {
const highLightUserNodes = (newHiglightUserIdList) => { const highLightUserNodes = (newHiglightUserIdList) => {
if (!newHiglightUserIdList) return 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", type: "downplay",
seriesIndex: 0 seriesIndex: 0
}) })
@ -612,7 +647,7 @@ const highLightUserNodes = (newHiglightUserIdList) => {
}) })
} }
}) })
}, 1000) }, 1000) */
} }
const handleClickNode = () => { const handleClickNode = () => {