diff --git a/src/store/llinkPrediction/index.js b/src/store/llinkPrediction/index.js index 302f230..5df1832 100644 --- a/src/store/llinkPrediction/index.js +++ b/src/store/llinkPrediction/index.js @@ -207,6 +207,10 @@ export const useSocialGroupsStore = defineStore("socialGroups", { curSelecedGroupIds: [], communityDetailNodeList: [], timeList: [], + // 当前需要高亮的用户id + curHighlightUserIdList: [], + // 记录点击边的时序列表 + clickEdgeTimeList: [], statisticsList: [ { id: 1, icon: nodePrefix, name: "节点数", key: "nodesCount" }, { id: 2, icon: communityPrefix, name: "社团数", key: "groupCount" }, @@ -442,6 +446,19 @@ export const useSocialGroupsStore = defineStore("socialGroups", { })) this.timeList = res.data.timeList || [] this.communityDetailNodeList = res.data.userRelation + }, + + // 修改timeList + setTimeList(timeList) { + this.timeList = timeList + }, + // 点击边,先获取需要的timeList + async getClickEdgeTimeList(ids, time = "2024-05-16 16:56:04") { + const res = await getSocialCommunityDetailNodes(ids, time) + if (res.code != 200) return + console.log("3.获取边中的timelist并设置成它") + this.curHighlightUserIdList = res.data.predictNodes + this.setTimeList(res.data.timeList) } }, persist: true // 开启持久化 diff --git a/src/views/LinkPrediction/socialGroups/components/detailNode.vue b/src/views/LinkPrediction/socialGroups/components/detailNode.vue index bda0c5d..752fd32 100644 --- a/src/views/LinkPrediction/socialGroups/components/detailNode.vue +++ b/src/views/LinkPrediction/socialGroups/components/detailNode.vue @@ -17,6 +17,20 @@
{{ TansTimestamp(startTime, "YYYY.MM.DD HH:mm:ss") }}
+ +
+
@@ -456,6 +600,30 @@ onMounted(() => { border-radius: 20px; z-index: 1; } + .time-sign{ + width: 4px; + height: 18px; + border-radius: 10px; + background: linear-gradient(180deg, #FEE39E 0%, #F9BD25 100%); + z-index: 1; + // 新增:添加绝对定位 + position: absolute; + // 调整垂直位置使其居中于时间轴 + top: -6px; + &::before { + content: ''; + position: absolute; + top: -6px; + left: -8px; + width: 20px; + height: 30px; + background: transparent; + } + &.active { + opacity: 0; + pointer-events: none; + } + } .active-sign { position: relative; z-index: 2; @@ -499,6 +667,7 @@ onMounted(() => { position: absolute; } } + } } .current-time-display { diff --git a/src/views/LinkPrediction/socialGroups/components/graph.vue b/src/views/LinkPrediction/socialGroups/components/graph.vue index 35fd312..acec173 100644 --- a/src/views/LinkPrediction/socialGroups/components/graph.vue +++ b/src/views/LinkPrediction/socialGroups/components/graph.vue @@ -34,8 +34,13 @@ const handleClickNode = async (nodeInfo) => { } const handleClickEdge = async (edgeInfo) => { + console.log("点击边"); socialGroupsStore.curComponent = "detailNode" - socialGroupsStore.initGraphCommunityDetailNode([edgeInfo.source, edgeInfo.target]) + // 先设置socialGroupsStore.clickEdgeTimeList + console.log("1.初始化获取边中的详情节点-initGraphCommunityDetailNode"); + await socialGroupsStore.initGraphCommunityDetailNode([edgeInfo.source, edgeInfo.target]) + console.log("2.获取边中的timelist并设置"); + await socialGroupsStore.getClickEdgeTimeList([edgeInfo.source, edgeInfo.target]) } const handleClickGoBack = (currentComponentName) => { diff --git a/src/views/LinkPrediction/socialGroups/components/userPanel.vue b/src/views/LinkPrediction/socialGroups/components/userPanel.vue index 85d4afb..0664451 100644 --- a/src/views/LinkPrediction/socialGroups/components/userPanel.vue +++ b/src/views/LinkPrediction/socialGroups/components/userPanel.vue @@ -40,6 +40,8 @@ diff --git a/src/views/LinkPrediction/socialGroups/index.vue b/src/views/LinkPrediction/socialGroups/index.vue index 1a9c8e1..11380e1 100644 --- a/src/views/LinkPrediction/socialGroups/index.vue +++ b/src/views/LinkPrediction/socialGroups/index.vue @@ -83,12 +83,12 @@ const currentPostPost = ref(null); const handleSelectedUserGroup = (group) => { socialGroupsStore.curComponent = "detailkNode" - const groupIds = group?.list.map((item)=>item.groupId) - socialGroupsStore.timeList = group?.timeList - const length = socialGroupsStore.timeList.length - const lastTime = socialGroupsStore.timeList[length - 1] + const groupIds = group.list.map((item)=>item.groupId) + const length = group.timeList.length + const lastTime = group.timeList[length - 1] socialGroupsStore.initGraphCommunityDetailNode(groupIds, lastTime) - socialGroupsStore.getSocialGroupPostListByRelationId(group?.relationId) + socialGroupsStore.setTimeList(group.timeList) + socialGroupsStore.getSocialGroupPostListByRelationId(group.relationId) }; onMounted(() => {