社团紧密修复
This commit is contained in:
parent
e3f8ce8efd
commit
3ade31f0a1
|
|
@ -655,6 +655,7 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
|
||||||
|
|
||||||
async initGraphCommunityNode() {
|
async initGraphCommunityNode() {
|
||||||
const res = await getCharacterSocialCommunityNodes()
|
const res = await getCharacterSocialCommunityNodes()
|
||||||
|
|
||||||
if (res.code !== 200) return
|
if (res.code !== 200) return
|
||||||
this.communityNodeList = res.data
|
this.communityNodeList = res.data
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,14 @@ watch(
|
||||||
const initChart = () => {
|
const initChart = () => {
|
||||||
const imageSelect = (node) => {
|
const imageSelect = (node) => {
|
||||||
if (node.isIncludePredictNodes) {
|
if (node.isIncludePredictNodes) {
|
||||||
if (node.selfIncludeImplicitRelationship) {
|
const selfIncludeImplicitRelationship =
|
||||||
return `image://${new URL(predictionNodeImg, import.meta.url)}`
|
node.neighbors.map((nei) => nei.id).includes(node.id) &&
|
||||||
} else {
|
node.neighbors.find((nei) => nei.id == node.id).isHidden
|
||||||
|
|
||||||
|
if (selfIncludeImplicitRelationship) {
|
||||||
return `image://${new URL(hiddenNodeImg, import.meta.url)}`
|
return `image://${new URL(hiddenNodeImg, import.meta.url)}`
|
||||||
|
} else {
|
||||||
|
return `image://${new URL(predictionNodeImg, import.meta.url)}`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return `image://${new URL(normalGroupNodeImg, import.meta.url)}`
|
return `image://${new URL(normalGroupNodeImg, import.meta.url)}`
|
||||||
|
|
@ -255,6 +259,8 @@ const initChart = () => {
|
||||||
const handleClickNode = () => {
|
const handleClickNode = () => {
|
||||||
chart.on("click", function (params) {
|
chart.on("click", function (params) {
|
||||||
if (params.dataType === "node") {
|
if (params.dataType === "node") {
|
||||||
|
console.log("点击点params", params)
|
||||||
|
|
||||||
emit("click:node", params.data)
|
emit("click:node", params.data)
|
||||||
} else if (params.dataType == "edge") {
|
} else if (params.dataType == "edge") {
|
||||||
const { data } = params
|
const { data } = params
|
||||||
|
|
|
||||||
|
|
@ -350,8 +350,10 @@ const initChart = async () => {
|
||||||
const edgeSet = new Set()
|
const edgeSet = new Set()
|
||||||
// 使用Map存储边,方便后续查找和更新
|
// 使用Map存储边,方便后续查找和更新
|
||||||
const edgeMap = new 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) => {
|
socialGroupsStore.communityAllNodeList.forEach((item) => {
|
||||||
nodes.push({
|
nodes.push({
|
||||||
id: item.userId,
|
id: item.userId,
|
||||||
|
|
@ -625,7 +627,6 @@ const highLightUserNodes = (newHiglightUserIdList) => {
|
||||||
const handleClickNode = () => {
|
const handleClickNode = () => {
|
||||||
chart.on("click", function (params) {
|
chart.on("click", function (params) {
|
||||||
if (params.dataType == "node" && curHighlightUserIdList.value.includes(params.data.id)) {
|
if (params.dataType == "node" && curHighlightUserIdList.value.includes(params.data.id)) {
|
||||||
console.log("detail点击点:", params.data)
|
|
||||||
emit("click:openDialog", params.data)
|
emit("click:openDialog", params.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,8 @@ onMounted(() => {
|
||||||
socialGroupsStore.initGroupList()
|
socialGroupsStore.initGroupList()
|
||||||
socialGroupsStore.initPostList("212431")
|
socialGroupsStore.initPostList("212431")
|
||||||
socialGroupsStore.initGraphCommunityNode()
|
socialGroupsStore.initGraphCommunityNode()
|
||||||
|
console.log("社团节点:", socialGroupsStore.communityNodeList)
|
||||||
|
|
||||||
socialGroupsStore.initGraphStatistics()
|
socialGroupsStore.initGraphStatistics()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user