添加注释

This commit is contained in:
qumeng039@126.com 2025-08-01 11:09:49 +08:00
parent d2dbe82781
commit 817205ffeb
2 changed files with 33 additions and 17 deletions

View File

@ -25,7 +25,6 @@ import tightCommunityPrefix from "@/assets/images/linkPrediction/icon/tightCommu
export const useCharacterInteractionStore = defineStore("characterInteraction", { export const useCharacterInteractionStore = defineStore("characterInteraction", {
state: () => ({ state: () => ({
userList: [], //用户组列表 userList: [], //用户组列表
userChartList: [], //组相关性
posts: [], //贴文列表 posts: [], //贴文列表
communityNodeList: [], //所有社团数据 communityNodeList: [], //所有社团数据
curComponent: "CommunityNode", curComponent: "CommunityNode",
@ -159,6 +158,7 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
] ]
}), }),
actions: { actions: {
//初始化用户组列表
async initGroupList() { async initGroupList() {
const res = await getGroupUserListFromInteraction() const res = await getGroupUserListFromInteraction()
if (res.code != 200) { if (res.code != 200) {
@ -166,20 +166,19 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
} }
this.userList = res.data.userList.sort((a, b) => a.rank - b.rank) this.userList = res.data.userList.sort((a, b) => a.rank - b.rank)
}, },
//初始化贴文数据 && 点击用户组列表展示该用户组的贴文
initGroupCorrelationForChart() {
this.userChartList = this.userList
},
async initInteractionPostList(userGroupId) { async initInteractionPostList(userGroupId) {
const res = await getInteractionPostList(userGroupId) const res = await getInteractionPostList(userGroupId)
if (res.code != 200) return if (res.code != 200) return
this.posts = res.data this.posts = res.data
}, },
//初始化社团节点
async initGraphCommunityNode() { async initGraphCommunityNode() {
const res = await getInteractionCommunityNodes() const res = await getInteractionCommunityNodes()
if (res.code != 200) return if (res.code != 200) return
this.communityNodeList = res.data this.communityNodeList = res.data
}, },
//点击社团节点的黄色边,或者存在预测节点的社团,获取社团内部详情
async initGraphCommunityDetailNode(ids, time = "2024-05-16 16:56:04", relationId = -1) { async initGraphCommunityDetailNode(ids, time = "2024-05-16 16:56:04", relationId = -1) {
this.curSelecedGroupIds = ids this.curSelecedGroupIds = ids
const res = await getInteractionCommunityDetailNodes(ids, relationId, time) const res = await getInteractionCommunityDetailNodes(ids, relationId, time)
@ -203,6 +202,7 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
this.timeList = res.data.timeList this.timeList = res.data.timeList
this.predictionUserIds = res.data.predictNodes this.predictionUserIds = res.data.predictNodes
}, },
//初始化社团统计数据
async initGraphStatistics() { async initGraphStatistics() {
const res = await getInteractionCommunityStatistics() const res = await getInteractionCommunityStatistics()
this.statisticsList = this.statisticsList.map((item) => ({ this.statisticsList = this.statisticsList.map((item) => ({
@ -461,7 +461,7 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
this.curSelecedGroupIds = ids this.curSelecedGroupIds = ids
const res = await getSocialCommunityDetailNodes(ids, relationId, time) const res = await getSocialCommunityDetailNodes(ids, relationId, time)
if (res.code != 200) return if (res.code != 200) return
console.log("index.js:",res.data) console.log("index.js:", res.data)
const customStatisticsObj = Object.assign({}, res.data.communityStatistics) const customStatisticsObj = Object.assign({}, res.data.communityStatistics)
//计算两个用户是否同属与同一个社团 //计算两个用户是否同属与同一个社团
if ( if (

View File

@ -76,9 +76,10 @@ const props = defineProps({
required: true required: true
} }
}) })
const { communityDetailNodeRelation, timeList, predictionUserIds } = storeToRefs(
props.interactionStore const { communityDetailNodeRelation, timeList, predictionUserIds, curSelecedGroupIds } =
) storeToRefs(props.interactionStore)
const emit = defineEmits(["click:goback"]) const emit = defineEmits(["click:goback"])
const chartsData = ref({}) const chartsData = ref({})
const handleGoback = () => { const handleGoback = () => {
@ -86,6 +87,29 @@ const handleGoback = () => {
emit("click:goback", "CommunityNode") emit("click:goback", "CommunityNode")
} }
//
const startTime = ref(new Date("2024-05-16 16:56:04"))
const endTime = ref(new Date("2024-05-23 10:16:56"))
const currentTime = ref(new Date("2024-05-16 16:56:04")) //
const currentPosition = ref(0) //
const isPlaying = ref(false) //
let playTimer = null
// curSelecedGroupIdswatch
watch(
curSelecedGroupIds,
(newIds) => {
if (newIds && newIds.length > 0) {
//
currentPosition.value = 0
currentTime.value = new Date("2024-05-16 16:56:04")
//
pause() //
play() //
}
},
{ deep: true }
)
//communityDetailNodeList //communityDetailNodeList
watch( watch(
communityDetailNodeRelation, communityDetailNodeRelation,
@ -108,14 +132,6 @@ watch(
{ deep: true, immediate: true } { deep: true, immediate: true }
) )
//
const startTime = ref(new Date("2024-05-16 16:56:04"))
const endTime = ref(new Date("2024-05-23 10:16:56"))
const currentTime = ref(new Date("2024-05-16 16:56:04")) //
const currentPosition = ref(0) //
const isPlaying = ref(false) //
let playTimer = null
// //
const play = () => { const play = () => {
if (isPlaying.value) return if (isPlaying.value) return