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() })