用户组列表请求成功
This commit is contained in:
		
							parent
							
								
									5ff5c55ff2
								
							
						
					
					
						commit
						4c49321090
					
				
							
								
								
									
										16
									
								
								src/service/api/linkPrediction.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/service/api/linkPrediction.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
import http from "@/utils/http";
 | 
			
		||||
 | 
			
		||||
//人物互动隐关系预测的用户组列表
 | 
			
		||||
export function getGroupUserListFromInteraction() {
 | 
			
		||||
  return http.get("/linkPrediction/interaction/group_list");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//社交紧密团体识别的用户组列表
 | 
			
		||||
export function getGroupUserListFromTriangle() {
 | 
			
		||||
  return http.get("/linkPrediction/triangle/group_list");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//人物社交隐关系预测用户组列表
 | 
			
		||||
export function getGroupUserListFromSocial() {
 | 
			
		||||
  return http.get("/linkPrediction/social/group_list");
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,101 +1,19 @@
 | 
			
		|||
import { defineStore } from "pinia";
 | 
			
		||||
import {
 | 
			
		||||
  getGroupUserListFromInteraction,
 | 
			
		||||
  getGroupUserListFromTriangle,
 | 
			
		||||
  getGroupUserListFromSocial
 | 
			
		||||
} from "@/service/api/linkPrediction";
 | 
			
		||||
import testAvatar from "@/assets/anchorAvatar/aichuidunhaitao-tingenqifu.png";
 | 
			
		||||
import test1Avatar from "@/assets/anchorAvatar/fei_die_gg.png";
 | 
			
		||||
import test2Avatar from "@/assets/anchorAvatar/qianjuzhangbenren.png";
 | 
			
		||||
import { ElMessage } from "element-plus";
 | 
			
		||||
 | 
			
		||||
export const useCharacterInteractionStore = defineStore("characterInteraction", {
 | 
			
		||||
  state: () => ({
 | 
			
		||||
    userList: [
 | 
			
		||||
      {
 | 
			
		||||
        id: 1,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: testAvatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: testAvatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 2,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: testAvatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: testAvatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: testAvatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: testAvatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 4,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: testAvatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: testAvatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 5,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: testAvatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: testAvatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    userList: [], //用户组列表
 | 
			
		||||
 | 
			
		||||
    userChartList: [
 | 
			
		||||
      {
 | 
			
		||||
        id: 1,
 | 
			
		||||
        group: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: testAvatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: testAvatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ],
 | 
			
		||||
        number: "0.60"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 2,
 | 
			
		||||
        group: [
 | 
			
		||||
          {
 | 
			
		||||
            id: 7,
 | 
			
		||||
            name: "一人一讚 馬總統感恩有您 永遠支...",
 | 
			
		||||
            avatar: testAvatar,
 | 
			
		||||
            fancy: 0,
 | 
			
		||||
            post: 0
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            id: 8,
 | 
			
		||||
            name: "一人一讚 馬總統感恩有您 永遠支...",
 | 
			
		||||
            avatar: testAvatar,
 | 
			
		||||
            fancy: 564,
 | 
			
		||||
            post: 13
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        number: 0.45
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        group: [
 | 
			
		||||
          {
 | 
			
		||||
            id: 9,
 | 
			
		||||
            name: "一人一讚 馬總統感恩有您 永遠支...",
 | 
			
		||||
            avatar: testAvatar,
 | 
			
		||||
            fancy: 0,
 | 
			
		||||
            post: 0
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            id: 10,
 | 
			
		||||
            name: "一人一讚 馬總統感恩有您 永遠支...",
 | 
			
		||||
            avatar: testAvatar,
 | 
			
		||||
            fancy: 564,
 | 
			
		||||
            post: 13
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        number: 0.32
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    userChartList: [], //组相关性
 | 
			
		||||
 | 
			
		||||
    posts: [
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -323,41 +241,27 @@ export const useCharacterInteractionStore = defineStore("characterInteraction",
 | 
			
		|||
      { text: "台湾", top: 195.5, left: 287.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }
 | 
			
		||||
    ]
 | 
			
		||||
  }),
 | 
			
		||||
  actions: {},
 | 
			
		||||
  actions: {
 | 
			
		||||
    async initGroupList() {
 | 
			
		||||
      const res = await getGroupUserListFromInteraction();
 | 
			
		||||
      if (res.code != 200) {
 | 
			
		||||
        ElMessage.error(res.message);
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      this.userList = res.data.userList;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    initGroupCorrelationForChart() {
 | 
			
		||||
      this.userChartList = this.userList;
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  persist: true // 开启持久化
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export const useSocialGroupsStore = defineStore("socialGroups", {
 | 
			
		||||
  state: () => ({
 | 
			
		||||
    userList: [
 | 
			
		||||
      {
 | 
			
		||||
        id: 1,
 | 
			
		||||
        type: "时政兴趣团体",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test1Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test1Avatar, fancy: 5556, post: 23 },
 | 
			
		||||
          { id: 3, name: "邱盆琇", avatar: test1Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 2,
 | 
			
		||||
        type: "时政兴趣团体",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test1Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test1Avatar, fancy: 5556, post: 23 },
 | 
			
		||||
          { id: 3, name: "邱盆琇", avatar: test1Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        type: "时政兴趣团体",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test1Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test1Avatar, fancy: 5556, post: 23 },
 | 
			
		||||
          { id: 3, name: "邱盆琇", avatar: test1Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    userList: [],
 | 
			
		||||
 | 
			
		||||
    userChartList: [
 | 
			
		||||
      {
 | 
			
		||||
        id: 1,
 | 
			
		||||
| 
						 | 
				
			
			@ -647,52 +551,23 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
 | 
			
		|||
      { text: "原则", top: 77.5, left: 264.5, width: 49, height: 19, fontSize: 12, opacity: 0.7 },
 | 
			
		||||
      { text: "台湾", top: 195.5, left: 287.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }
 | 
			
		||||
    ]
 | 
			
		||||
  })
 | 
			
		||||
  }),
 | 
			
		||||
  actions: {
 | 
			
		||||
    async initGroupList() {
 | 
			
		||||
      const res = await getGroupUserListFromTriangle();
 | 
			
		||||
      if (res.code != 200) {
 | 
			
		||||
        ElMessage.error(res.message);
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      this.userList = res.data.userList;
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  persist: true // 开启持久化
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		||||
  state: () => ({
 | 
			
		||||
    userList: [
 | 
			
		||||
      {
 | 
			
		||||
        id: 1,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test2Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test2Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 2,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test2Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test2Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 3,
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test2Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test2Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 4,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test2Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test2Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: 5,
 | 
			
		||||
        type: "",
 | 
			
		||||
        list: [
 | 
			
		||||
          { id: 1, name: "Polo Hun", avatar: test2Avatar, fancy: 634, post: 32 },
 | 
			
		||||
          { id: 2, name: "楊政子", avatar: test2Avatar, fancy: 5556, post: 23 }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    userList: [],
 | 
			
		||||
 | 
			
		||||
    userChartList: [
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -970,5 +845,16 @@ export const useCharacterHiddenStore = defineStore("characterHidden", {
 | 
			
		|||
      { text: "原则", top: 77.5, left: 264.5, width: 49, height: 19, fontSize: 12, opacity: 0.7 },
 | 
			
		||||
      { text: "台湾", top: 195.5, left: 287.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }
 | 
			
		||||
    ]
 | 
			
		||||
  })
 | 
			
		||||
  }),
 | 
			
		||||
  actions: {
 | 
			
		||||
    async initGroupList() {
 | 
			
		||||
      const res = await getGroupUserListFromSocial();
 | 
			
		||||
      if (res.code != 200) {
 | 
			
		||||
        ElMessage.error(res.message);
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      this.userList = res.data.userList;
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  persist: true // 开启持久化
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,7 +66,7 @@
 | 
			
		|||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import { ref } from "vue";
 | 
			
		||||
import { onMounted, ref } from "vue";
 | 
			
		||||
import UserPanel from "../components/userPanel.vue";
 | 
			
		||||
import UserChart from "../components/userChart.vue";
 | 
			
		||||
import PostList from "../components/postList.vue";
 | 
			
		||||
| 
						 | 
				
			
			@ -95,6 +95,10 @@ const handleOpenPostDialog = (post) => {
 | 
			
		|||
  postDialog.value = true;
 | 
			
		||||
  currentPostPost.value = post;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  interactionStore.initGroupList();
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="less">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,7 +66,7 @@
 | 
			
		|||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import { ref } from "vue";
 | 
			
		||||
import { onMounted, ref } from "vue";
 | 
			
		||||
import UserPanel from "../components/userPanel.vue";
 | 
			
		||||
import UserChart from "../components/userChart.vue";
 | 
			
		||||
import PostList from "../components/postList.vue";
 | 
			
		||||
| 
						 | 
				
			
			@ -95,6 +95,10 @@ const handleOpenPostDialog = (post) => {
 | 
			
		|||
  postDialog.value = true;
 | 
			
		||||
  currentPostPost.value = post;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  characterHiddenStore.initGroupList();
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="less">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,19 +8,19 @@
 | 
			
		|||
          @click="handleUserItem(index, group)"
 | 
			
		||||
          :class="{ active: curUserGroupIndex == index }"
 | 
			
		||||
        >
 | 
			
		||||
          <div class="group-type">{{ group.type }}</div>
 | 
			
		||||
          <div class="group-type">{{ group.title }}</div>
 | 
			
		||||
          <div class="user-list-item" v-for="child in group.list" :key="child.id">
 | 
			
		||||
            <img :src="child.avatar" alt="" class="avatar" />
 | 
			
		||||
            <img :src="child.avatarPath" alt="" class="avatar" />
 | 
			
		||||
            <div class="user-info">
 | 
			
		||||
              <div class="username">{{ child.name }}</div>
 | 
			
		||||
              <div class="username">{{ child.userName }}</div>
 | 
			
		||||
              <div class="userState">
 | 
			
		||||
                <div class="userState-fancy">
 | 
			
		||||
                  粉丝数:
 | 
			
		||||
                  <p>{{ child.fancy }}</p>
 | 
			
		||||
                  <p>{{ child.fans }}</p>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="userState-monitor-count">
 | 
			
		||||
                  发帖数:
 | 
			
		||||
                  <p>{{ child.post }}</p>
 | 
			
		||||
                  <p>{{ child.postNum }}</p>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,7 +66,7 @@
 | 
			
		|||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import { ref } from "vue";
 | 
			
		||||
import { onMounted, ref } from "vue";
 | 
			
		||||
import UserPanel from "../components/userPanel.vue";
 | 
			
		||||
import UserChart from "../components/userChart.vue";
 | 
			
		||||
import PostList from "../components/postList.vue";
 | 
			
		||||
| 
						 | 
				
			
			@ -94,8 +94,11 @@ const handleSelectedUserGroup = (group) => {
 | 
			
		|||
const handleOpenPostDialog = (post) => {
 | 
			
		||||
  postDialog.value = true;
 | 
			
		||||
  currentPostPost.value = post;
 | 
			
		||||
  console.log(post);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  socialGroupsStore.initGroupList();
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="less">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,8 +13,13 @@ export default defineConfig({
 | 
			
		|||
    }
 | 
			
		||||
  },
 | 
			
		||||
  server: {
 | 
			
		||||
    watch: {
 | 
			
		||||
      usePolling: true // 解决部分环境下热更新失效
 | 
			
		||||
    open: true,
 | 
			
		||||
    proxy: {
 | 
			
		||||
      "/api": {
 | 
			
		||||
        target: "http://10.7.1.183:8080",
 | 
			
		||||
        changeOrigin: true
 | 
			
		||||
        // rewrite: (path) => path.replace(/^\/api/, "") //后端带了api/前缀的话就注释
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user