数量分析统计模块联动效果完成
This commit is contained in:
		
							parent
							
								
									1bc34271f3
								
							
						
					
					
						commit
						27cb12f9af
					
				| 
						 | 
				
			
			@ -117,3 +117,8 @@ export function getInteractionCount(source, target) {
 | 
			
		|||
export function getPostDetail(postId) {
 | 
			
		||||
  return http.get(`/linkPrediction/postDetail?postId=${postId}`)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//获取数值分析
 | 
			
		||||
export function getAnalyseStatistics(relationld) {
 | 
			
		||||
  return http.get(`/linkPrediction/commonInfo?relationId=${relationld}`)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,8 @@ import {
 | 
			
		|||
  getCharacterSocialCommunityStatistics,
 | 
			
		||||
  getCharacterSocialCommunityDetailNodes,
 | 
			
		||||
  getInteractionCount,
 | 
			
		||||
  getPostDetail
 | 
			
		||||
  getPostDetail,
 | 
			
		||||
  getAnalyseStatistics
 | 
			
		||||
} from "@/service/api/linkPrediction"
 | 
			
		||||
 | 
			
		||||
import defaultAvatar from "@/assets/images/avatar/default.png"
 | 
			
		||||
| 
						 | 
				
			
			@ -44,10 +45,11 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
 | 
			
		|||
        id: 1,
 | 
			
		||||
        title: "平均评论数",
 | 
			
		||||
        unit: "数量",
 | 
			
		||||
        xAxis: [0, 20, 40, 60, 80, 100],
 | 
			
		||||
        max: 100,
 | 
			
		||||
        xAxis: [0, 30, 60, 90, 120, 150, 180],
 | 
			
		||||
        max: 180,
 | 
			
		||||
        targetUserKey: "commComments",
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 98.8, type: "leader" },
 | 
			
		||||
          { label: "关注用户", value: 131, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.01, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -55,21 +57,23 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
 | 
			
		|||
        id: 2,
 | 
			
		||||
        title: "平均转发次数",
 | 
			
		||||
        unit: "数量",
 | 
			
		||||
        xAxis: [0, 3, 6, 9, 12, 16, 18],
 | 
			
		||||
        max: 18,
 | 
			
		||||
        xAxis: [0, 3, 6, 9, 12, 16, 18, 21, 24, 26],
 | 
			
		||||
        targetUserKey: "commRetweet",
 | 
			
		||||
        max: 26,
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 17, type: "leader" },
 | 
			
		||||
          { label: "关注用户", value: 4, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.01, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        title: "互动时间间隔",
 | 
			
		||||
        unit: "秒",
 | 
			
		||||
        xAxis: [0, 30, 60, 90, 120, 150],
 | 
			
		||||
        max: 150,
 | 
			
		||||
        unit: "小时",
 | 
			
		||||
        xAxis: [0, 20, 40, 60, 80, 100],
 | 
			
		||||
        max: 100,
 | 
			
		||||
        targetUserKey: "avgTimeDiff",
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 3.63, type: "leader", highlight: false },
 | 
			
		||||
          { label: "关注用户", value: 16.9, type: "leader", highlight: false },
 | 
			
		||||
          { label: "所有用户", value: 127.63, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -228,6 +232,17 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
 | 
			
		|||
      if (res.code == 200) {
 | 
			
		||||
        return res.data
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    //获取数值分析板块内容
 | 
			
		||||
    async initAnalyse(relationId) {
 | 
			
		||||
      const res = await getAnalyseStatistics(relationId)
 | 
			
		||||
      Object.keys(res.data).forEach((key) => {
 | 
			
		||||
        this.anlysisList.forEach((item) => {
 | 
			
		||||
          if (key == item.targetUserKey) {
 | 
			
		||||
            item.rows[0].value = res.data[key]
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  persist: true // 开启持久化
 | 
			
		||||
| 
						 | 
				
			
			@ -332,33 +347,36 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
 | 
			
		|||
        id: 1,
 | 
			
		||||
        title: "平均评论数",
 | 
			
		||||
        unit: "数量",
 | 
			
		||||
        xAxis: [0, 20, 40, 60, 80, 100],
 | 
			
		||||
        max: 100,
 | 
			
		||||
        xAxis: [0, 30, 60, 90, 120, 150, 180],
 | 
			
		||||
        max: 180,
 | 
			
		||||
        targetUserKey: "commComments",
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 37.33, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.06, type: "user" }
 | 
			
		||||
          { label: "关注用户", value: 1, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.01, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 2,
 | 
			
		||||
        title: "平均转发次数",
 | 
			
		||||
        unit: "数量",
 | 
			
		||||
        xAxis: [0, 0.1, 0.2, 0.3, 0.4, 0.5],
 | 
			
		||||
        max: 0.5,
 | 
			
		||||
        xAxis: [0, 3, 6, 9, 12, 16, 18, 21, 24, 26],
 | 
			
		||||
        targetUserKey: "commRetweet",
 | 
			
		||||
        max: 26,
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 0.31, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.004, type: "user" }
 | 
			
		||||
          { label: "关注用户", value: 8, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.01, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        title: "互动时间间隔",
 | 
			
		||||
        unit: "秒",
 | 
			
		||||
        xAxis: [0, 100, 200, 300, 400, 500],
 | 
			
		||||
        max: 600,
 | 
			
		||||
        unit: "小时",
 | 
			
		||||
        xAxis: [0, 20, 40, 60, 80, 100],
 | 
			
		||||
        max: 100,
 | 
			
		||||
        targetUserKey: "avgTimeDiff",
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 42.55, type: "leader", highlight: false },
 | 
			
		||||
          { label: "所有用户", value: 582.23, type: "user" }
 | 
			
		||||
          { label: "关注用户", value: 18.22, type: "leader", highlight: false },
 | 
			
		||||
          { label: "所有用户", value: 127.63, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
| 
						 | 
				
			
			@ -503,7 +521,6 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
 | 
			
		|||
      this.communityDetailNodeList = res.data.userRelation
 | 
			
		||||
      this.curHighlightUserIdList = res.data.predictNodes
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    // 修改timeList
 | 
			
		||||
    setTimeList(timeList) {
 | 
			
		||||
      this.timeList = timeList
 | 
			
		||||
| 
						 | 
				
			
			@ -528,6 +545,18 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
 | 
			
		|||
      if (res.code == 200) {
 | 
			
		||||
        return res.data
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    //获取数值分析板块内容
 | 
			
		||||
    async initAnalyse(relationId) {
 | 
			
		||||
      const res = await getAnalyseStatistics(relationId)
 | 
			
		||||
      Object.keys(res.data).forEach((key) => {
 | 
			
		||||
        this.anlysisList.forEach((item) => {
 | 
			
		||||
          if (key == item.targetUserKey) {
 | 
			
		||||
            item.rows[0].value = res.data[key]
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
      console.log(this.anlysisList)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  persist: true // 开启持久化
 | 
			
		||||
| 
						 | 
				
			
			@ -558,10 +587,11 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
        id: 1,
 | 
			
		||||
        title: "平均评论数",
 | 
			
		||||
        unit: "数量",
 | 
			
		||||
        xAxis: [0, 20, 40, 60, 80, 100],
 | 
			
		||||
        max: 100,
 | 
			
		||||
        xAxis: [0, 30, 60, 90, 120, 150, 180],
 | 
			
		||||
        max: 180,
 | 
			
		||||
        targetUserKey: "commComments",
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 90.8, type: "leader" },
 | 
			
		||||
          { label: "关注用户", value: 53, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.01, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -569,21 +599,23 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
        id: 2,
 | 
			
		||||
        title: "平均转发次数",
 | 
			
		||||
        unit: "数量",
 | 
			
		||||
        xAxis: [0, 3, 6, 9, 12, 16, 18],
 | 
			
		||||
        max: 18,
 | 
			
		||||
        xAxis: [0, 3, 6, 9, 12, 16, 18, 21, 24, 26],
 | 
			
		||||
        targetUserKey: "commRetweet",
 | 
			
		||||
        max: 26,
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 17, type: "leader" },
 | 
			
		||||
          { label: "关注用户", value: 2, type: "leader" },
 | 
			
		||||
          { label: "所有用户", value: 0.01, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        title: "互动时间间隔",
 | 
			
		||||
        unit: "秒",
 | 
			
		||||
        xAxis: [0, 30, 60, 90, 120, 150],
 | 
			
		||||
        max: 150,
 | 
			
		||||
        unit: "小时",
 | 
			
		||||
        xAxis: [0, 20, 40, 60, 80, 100],
 | 
			
		||||
        max: 100,
 | 
			
		||||
        targetUserKey: "avgTimeDiff",
 | 
			
		||||
        rows: [
 | 
			
		||||
          { label: "目标用户", value: 3.63, type: "leader", highlight: false },
 | 
			
		||||
          { label: "关注用户", value: 2.11, type: "leader", highlight: false },
 | 
			
		||||
          { label: "所有用户", value: 127.63, type: "user" }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -673,7 +705,6 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
      if (res.code != 200) return
 | 
			
		||||
      this.userList = res.data.userList.sort((a, b) => a.rank - b.rank)
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    async initCharacterSocialHiddenPostList(relationId) {
 | 
			
		||||
      const res = await getInteractionPostList(relationId)
 | 
			
		||||
      if (res.code != 200) return
 | 
			
		||||
| 
						 | 
				
			
			@ -681,7 +712,6 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
        return a.interactionTime.localeCompare(b.interactionTime)
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    async initGraphCommunityNode() {
 | 
			
		||||
      const res = await getCharacterSocialCommunityNodes()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -718,7 +748,6 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
      this.timeList = Array.from(new Set(res.data.timeList))
 | 
			
		||||
      this.predictionUserIds = res.data.predictNodes
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    async initInteractionCount(source, target) {
 | 
			
		||||
      const res = await getInteractionCount(source, target)
 | 
			
		||||
      if (res.code != 200) return
 | 
			
		||||
| 
						 | 
				
			
			@ -730,6 +759,17 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
      if (res.code == 200) {
 | 
			
		||||
        return res.data
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    //获取数值分析板块内容
 | 
			
		||||
    async initAnalyse(relationId) {
 | 
			
		||||
      const res = await getAnalyseStatistics(relationId)
 | 
			
		||||
      Object.keys(res.data).forEach((key) => {
 | 
			
		||||
        this.anlysisList.forEach((item) => {
 | 
			
		||||
          if (key == item.targetUserKey) {
 | 
			
		||||
            item.rows[0].value = res.data[key]
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  persist: true // 开启持久化
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -148,11 +148,13 @@ const handleSelectedUserGroup = async (group) => {
 | 
			
		|||
  interactionStore.timeList = group.timeList //保存从用户列表选择的用户组,为了显示这两个用户交互的时间切片
 | 
			
		||||
  interactionStore.curRelationId = group.relationId //保存当前点击的relationid,为了区分到底是从哪点进二级界面的
 | 
			
		||||
  await interactionStore.initInteractionPostList(group.relationId)
 | 
			
		||||
  await interactionStore.initAnalyse(group.relationId)
 | 
			
		||||
  await interactionStore.initGraphCommunityDetailNode(
 | 
			
		||||
    group.list.map((item) => item.groupId),
 | 
			
		||||
    "2024-05-16 16:56:04",
 | 
			
		||||
    group.relationId
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
  interactionStore.curComponent = "detailNode"
 | 
			
		||||
}
 | 
			
		||||
const handleOpenUserInfoDialog = (params) => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -157,6 +157,7 @@ const handleSelectedUserGroup = (group) => {
 | 
			
		|||
  characterHiddenStore.timeList = group.timeList //保存从用户列表选择的用户组,为了显示这两个用户交互的时间切片
 | 
			
		||||
  characterHiddenStore.curRelationId = group.relationId //保存当前点击的relationid,为了区分到底是从哪点进二级界面的
 | 
			
		||||
  characterHiddenStore.initCharacterSocialHiddenPostList(group.relationId)
 | 
			
		||||
  characterHiddenStore.initAnalyse(group.relationId)
 | 
			
		||||
  characterHiddenStore.initGraphCommunityDetailNode(
 | 
			
		||||
    group.list.map((item) => item.groupId),
 | 
			
		||||
    "2024-05-16 16:56:04",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -641,7 +641,6 @@ const handleClickNodeOrLink = async () => {
 | 
			
		|||
      const linkIndex = params.dataIndex
 | 
			
		||||
      const option = chart.getOption()
 | 
			
		||||
      const currentInteractionCount = await socialGroupsStore.initInteractionCount(source, target)
 | 
			
		||||
      console.log("currentInteractionCount", currentInteractionCount)
 | 
			
		||||
      option.series[0].links[linkIndex].interactionTimes = currentInteractionCount
 | 
			
		||||
      chart.setOption(
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -713,7 +712,7 @@ onMounted(() => {
 | 
			
		|||
    background: linear-gradient(270deg, rgba(0, 82, 125, 0.48) 0%, rgba(0, 200, 255, 0.23) 100%);
 | 
			
		||||
    backdrop-filter: blur(3px);
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    bottom: vh(105);
 | 
			
		||||
    bottom: vh(115);
 | 
			
		||||
    left: vw(21);
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -174,15 +174,19 @@ const curSelectedUser = ref(null)
 | 
			
		|||
const currentPostPost = ref(null)
 | 
			
		||||
const currentPostContent = ref("")
 | 
			
		||||
// 列表项的点击事件
 | 
			
		||||
const handleSelectedUserGroup = (group) => {
 | 
			
		||||
  socialGroupsStore.curComponent = "detailkNode"
 | 
			
		||||
const handleSelectedUserGroup = async (group) => {
 | 
			
		||||
  socialGroupsStore.clickEvent = "list"
 | 
			
		||||
  console.log("点击列表group:", group)
 | 
			
		||||
  const groupIds = group.list.map((item) => item.groupId)
 | 
			
		||||
  socialGroupsStore.curRelationId = group.relationId //保存当前点击的relationid,为了区分到底是从哪点进二级界面的
 | 
			
		||||
  socialGroupsStore.initGraphCommunityDetailNode(groupIds, "2024-05-16 16:56:04", group.relationId)
 | 
			
		||||
  await socialGroupsStore.initGraphCommunityDetailNode(
 | 
			
		||||
    groupIds,
 | 
			
		||||
    "2024-05-16 16:56:04",
 | 
			
		||||
    group.relationId
 | 
			
		||||
  )
 | 
			
		||||
  socialGroupsStore.setTimeList(group.timeList)
 | 
			
		||||
  socialGroupsStore.getSocialGroupPostListByRelationId(group.relationId)
 | 
			
		||||
  await socialGroupsStore.getSocialGroupPostListByRelationId(group.relationId)
 | 
			
		||||
  await socialGroupsStore.initAnalyse(group.relationId)
 | 
			
		||||
  socialGroupsStore.curComponent = "detailkNode"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const handleOpenUserInfoDialog = (params) => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user