diff --git a/src/assets/images/linkPrediction/icon/event-activist-legend-icon.png b/src/assets/images/linkPrediction/icon/event-activist-legend-icon.png
new file mode 100644
index 0000000..e709b1b
Binary files /dev/null and b/src/assets/images/linkPrediction/icon/event-activist-legend-icon.png differ
diff --git a/src/assets/images/linkPrediction/icon/information-publisher-legend-icon.png b/src/assets/images/linkPrediction/icon/information-publisher-legend-icon.png
new file mode 100644
index 0000000..c7cc602
Binary files /dev/null and b/src/assets/images/linkPrediction/icon/information-publisher-legend-icon.png differ
diff --git a/src/assets/images/linkPrediction/icon/interactive-relationship-legend-icon.png b/src/assets/images/linkPrediction/icon/interactive-relationship-legend-icon.png
new file mode 100644
index 0000000..2b107cc
Binary files /dev/null and b/src/assets/images/linkPrediction/icon/interactive-relationship-legend-icon.png differ
diff --git a/src/assets/images/linkPrediction/icon/tight-community-legend-icon.png b/src/assets/images/linkPrediction/icon/tight-community-legend-icon.png
index 8b669ba..ade5e4c 100644
Binary files a/src/assets/images/linkPrediction/icon/tight-community-legend-icon.png and b/src/assets/images/linkPrediction/icon/tight-community-legend-icon.png differ
diff --git a/src/service/api/linkPrediction.js b/src/service/api/linkPrediction.js
index b26d911..8bd7662 100644
--- a/src/service/api/linkPrediction.js
+++ b/src/service/api/linkPrediction.js
@@ -40,7 +40,16 @@ export function getInteractionPostList(userGroupId) {
//社交紧密团体识别的贴文列表
export function getSocialPostList(outoIncrement) {
- return http.get(`/linkPrediction/social/post_list?page=${outoIncrement}`)
+ return http.get(`/linkPrediction/triangle/post_list?page=${outoIncrement}`)
+}
+// 社交紧密团体的对应紧密关系的帖文--根据relationId来查找
+export function getSocialPostListByRelationId(relationId){
+
+ return http.get(`/linkPrediction/user_posts_list?relationId=${relationId}`)
+}
+// 社交紧密团体识别的社团统计
+export function getSocialCommunityStatistics() {
+ return http.get(`linkPrediction/triangle/community_statistics`)
}
// 社交紧密团体的社团列表数据
@@ -49,8 +58,8 @@ export function getSocialCommunityList() {
}
// 社交紧密团体的社团内部节点
-export function getSocialCommunityDetailNodes(ids) {
- return http.get(`/linkPrediction/triangle/community_detail?groupIds=${ids}`)
+export function getSocialCommunityDetailNodes(ids, time = "2024-05-16 16:56:04") {
+ return http.get(`/linkPrediction/triangle/community_detail?groupIds=${ids}&dateTime=${time}`)
}
//人物社交隐关系预测用户组列表
diff --git a/src/store/llinkPrediction/index.js b/src/store/llinkPrediction/index.js
index 3b79f66..2fd4f52 100644
--- a/src/store/llinkPrediction/index.js
+++ b/src/store/llinkPrediction/index.js
@@ -10,7 +10,9 @@ import {
getInteractionCommunityDetailNodes,
getInteractionCommunityStatistics,
getSocialCommunityList,
- getSocialCommunityDetailNodes
+ getSocialCommunityStatistics,
+ getSocialCommunityDetailNodes,
+ getSocialPostListByRelationId
} from "@/service/api/linkPrediction"
import defaultAvatar from "@/assets/images/avatar/default.png"
@@ -197,10 +199,18 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
state: () => ({
userList: [],
communityNodeList: [],
+ curComponent: "CommunityNode",
+ curSelecedGroupIds: [],
+ communityDetailNodeList: [],
statisticsList: [
{ id: 1, icon: nodePrefix, name: "节点数", key: "nodesCount" },
{ id: 2, icon: communityPrefix, name: "社团数", key: "groupCount" },
- { id: 3, icon: tightCommunityPrefix, name: "紧密团体数", key: "tightCommunityCount" }
+ { id: 3, icon: tightCommunityPrefix, name: "紧密团体数", key: "hiddenInteractionCount" }
+ ],
+ statisticsDetailList: [
+ { id: 1, icon: nodePrefix, name: "节点数", key: "nodesCount" },
+ { id: 2, icon: communityPrefix, name: "社团数", key: "groupCount" },
+ { id: 3, icon: tightCommunityPrefix, name: "紧密团体数", key: "hiddenInteractionCount" }
],
userChartList: [
{
@@ -394,24 +404,47 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
this.posts = res.data
}
},
+ // 获取对应用户组的postList
+ async getSocialGroupPostListByRelationId(relationId){
+ const res = await getSocialPostListByRelationId(relationId)
+ if (res.code != 200) return
+ // console.log("打印对应relationId的帖文列表:", res.data)
+ this.posts = res.data
+ },
async initGraphCommunityNode() {
const res = await getSocialCommunityList()
if (res.code != 200) return
this.communityNodeList = res.data
},
// 初始化statisticsList
- initStatisticsList() {
+ /* initStatisticsList() {
this.statisticsList = [
- { id: 1, icon: nodePrefix, name: "用户数", key: "userCount", count: 1000 },
+ { id: 1, icon: nodePrefix, name: "节点数", key: "nodesCount", count: 1000 },
{ id: 2, icon: communityPrefix, name: "社团数", key: "groupCount", count: 1000 },
- { id: 3, icon: tightCommunityPrefix, name: "紧密团体数", key: "tightCommunityCount", count: 1000 }
+ { id: 3, icon: tightCommunityPrefix, name: "紧密团体数", key: "hiddenInteractionCount", count: 1000 }
]
+ }, */
+ // 社交紧密团体识别的社团统计
+ async initGraphStatistics() {
+ const res = await getSocialCommunityStatistics()
+ this.statisticsList = this.statisticsList.map((item) => ({
+ ...item,
+ count: res.data[item.key]
+ }))
},
// 传递社交团体的数组,获取其详情
- async initGraphCommunityDetailNode(ids) {
- const res = await getSocialCommunityDetailNodes(ids)
+ async initGraphCommunityDetailNode(ids, time = "2024-05-16 16:56:04") {
+ this.curSelecedGroupIds = ids
+ const res = await getSocialCommunityDetailNodes(ids, time)
if (res.code != 200) return
- return res.data
+ this.statisticsDetailList = this.statisticsDetailList.map((item) => ({
+ ...item,
+ count: res.data.communityStatistics[item.key]
+ }))
+ console.log("打印社交团体详情:");
+ console.log(res.data);
+ this.communityDetailNodeList = res.data.userRelation
+
}
},
persist: true // 开启持久化
diff --git a/src/views/LinkPrediction/socialGroups/components/communityNode.vue b/src/views/LinkPrediction/socialGroups/components/communityNode.vue
index 192f96b..490ba26 100644
--- a/src/views/LinkPrediction/socialGroups/components/communityNode.vue
+++ b/src/views/LinkPrediction/socialGroups/components/communityNode.vue
@@ -62,9 +62,9 @@ const initChart = async () => {
const data = { nodes, links }
const categories = [
- { name: "普通社团", category: 0 },
- { name: "含预测节点社团", category: 1 },
- { name: "紧密团体关系", category: 2 }
+ { name: "普通社团", category: 0, icon: `image://${new URL('@/assets/images/linkPrediction/icon/node-legend-icon.png', import.meta.url)}`},
+ { name: "含预测节点社团", category: 1, icon: `image://${new URL('@/assets/images/linkPrediction/icon/community-legend-icon.png', import.meta.url)}`},
+ { name: "紧密团体关系", category: 2, icon: `image://${new URL('@/assets/images/linkPrediction/icon/tight-community-legend-icon.png', import.meta.url)}`}
]
const option = {
//图例配置
@@ -92,11 +92,7 @@ const initChart = async () => {
{ offset: 1, color: "#fbc2eb" }
])
},
- icon: c.category === 2
- ? `image://${new URL('@/assets/images/linkPrediction/icon/tight-community-legend-icon.png', import.meta.url)}`
- : c.category === 0
- ? `image://${new URL('@/assets/images/linkPrediction/icon/node-legend-icon.png', import.meta.url)}`
- : `image://${new URL('@/assets/images/linkPrediction/icon/community-legend-icon.png', import.meta.url)}`,
+ icon: c.icon
})),
right: 15,
bottom: 10,
diff --git a/src/views/LinkPrediction/socialGroups/components/detailNode.vue b/src/views/LinkPrediction/socialGroups/components/detailNode.vue
index f170080..ae226fb 100644
--- a/src/views/LinkPrediction/socialGroups/components/detailNode.vue
+++ b/src/views/LinkPrediction/socialGroups/components/detailNode.vue
@@ -3,51 +3,146 @@