From 3ade31f0a10acbb083d427af268aa1f7d72aaa47 Mon Sep 17 00:00:00 2001 From: duanhao Date: Mon, 18 Aug 2025 17:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E5=9B=A2=E7=B4=A7=E5=AF=86=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/linkPrediction/index.js | 1 + .../socialGroups/components/communityNode.vue | 12 +++++++++--- .../socialGroups/components/detailNode.vue | 5 +++-- src/views/LinkPrediction/socialGroups/index.vue | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/store/linkPrediction/index.js b/src/store/linkPrediction/index.js index 28e6d18..aa0d776 100644 --- a/src/store/linkPrediction/index.js +++ b/src/store/linkPrediction/index.js @@ -655,6 +655,7 @@ export const useCharacterHiddenStore = defineStore("characterHidden", { async initGraphCommunityNode() { const res = await getCharacterSocialCommunityNodes() + if (res.code !== 200) return this.communityNodeList = res.data }, diff --git a/src/views/LinkPrediction/socialGroups/components/communityNode.vue b/src/views/LinkPrediction/socialGroups/components/communityNode.vue index 635f39f..bbabfc5 100644 --- a/src/views/LinkPrediction/socialGroups/components/communityNode.vue +++ b/src/views/LinkPrediction/socialGroups/components/communityNode.vue @@ -37,10 +37,14 @@ watch( const initChart = () => { const imageSelect = (node) => { if (node.isIncludePredictNodes) { - if (node.selfIncludeImplicitRelationship) { - return `image://${new URL(predictionNodeImg, import.meta.url)}` - } else { + const selfIncludeImplicitRelationship = + node.neighbors.map((nei) => nei.id).includes(node.id) && + node.neighbors.find((nei) => nei.id == node.id).isHidden + + if (selfIncludeImplicitRelationship) { return `image://${new URL(hiddenNodeImg, import.meta.url)}` + } else { + return `image://${new URL(predictionNodeImg, import.meta.url)}` } } else { return `image://${new URL(normalGroupNodeImg, import.meta.url)}` @@ -255,6 +259,8 @@ const initChart = () => { const handleClickNode = () => { chart.on("click", function (params) { if (params.dataType === "node") { + console.log("点击点params", params) + emit("click:node", params.data) } else if (params.dataType == "edge") { const { data } = params diff --git a/src/views/LinkPrediction/socialGroups/components/detailNode.vue b/src/views/LinkPrediction/socialGroups/components/detailNode.vue index 71c0891..951d4a2 100644 --- a/src/views/LinkPrediction/socialGroups/components/detailNode.vue +++ b/src/views/LinkPrediction/socialGroups/components/detailNode.vue @@ -350,8 +350,10 @@ const initChart = async () => { const edgeSet = new Set() // 使用Map存储边,方便后续查找和更新 const edgeMap = new Map() - if (!Object.keys(socialGroupsStore.communityDetailNodeList).length) return + if (!Object.keys(socialGroupsStore.communityAllNodeList).length) return + // 先获取到所有节点 + console.log("301加入节点前:") socialGroupsStore.communityAllNodeList.forEach((item) => { nodes.push({ id: item.userId, @@ -625,7 +627,6 @@ const highLightUserNodes = (newHiglightUserIdList) => { const handleClickNode = () => { chart.on("click", function (params) { if (params.dataType == "node" && curHighlightUserIdList.value.includes(params.data.id)) { - console.log("detail点击点:", params.data) emit("click:openDialog", params.data) } }) diff --git a/src/views/LinkPrediction/socialGroups/index.vue b/src/views/LinkPrediction/socialGroups/index.vue index 87699cc..05f9ffa 100644 --- a/src/views/LinkPrediction/socialGroups/index.vue +++ b/src/views/LinkPrediction/socialGroups/index.vue @@ -187,6 +187,8 @@ onMounted(() => { socialGroupsStore.initGroupList() socialGroupsStore.initPostList("212431") socialGroupsStore.initGraphCommunityNode() + console.log("社团节点:", socialGroupsStore.communityNodeList) + socialGroupsStore.initGraphStatistics() })