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 @@
-
+
{{ item.name }}: 
{{ item.count }}
-
+
+
{{ TansTimestamp(startTime, "YYYY.MM.DD HH:mm:ss") }}
+
+
+
+
+
+
+
+
{{ TansTimestamp(endTime, "YYYY.MM.DD HH:mm:ss") }}
+
+
+ 当前时间: {{ TansTimestamp(currentTime, "YYYY.MM.DD HH:mm:ss") }} +
@@ -246,7 +341,7 @@ onMounted(() => { height: 93%; } .statistic-container { - width: 400px; + width: 378px; height: 42px; flex-shrink: 0; border-radius: 4px; @@ -299,6 +394,95 @@ onMounted(() => { bottom: 50px; border-radius: 4px; z-index: 1; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0px 10px; + color: #fff; + touch-action: none; // 防止触摸设备上的默认行为 + .time { + font-family: "PingFang SC"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + } + .axis { + width: 426px; + height: 6px; + border-radius: 20px; + background-color: #3b7699; + cursor: pointer; + transform: translateZ(0); // 启用硬件加速 + position: relative; + .progress-bar { + position: absolute; + top: 0; + left: 0; + height: 6px; + background-color: #00ecf9; + border-radius: 20px; + z-index: 1; + } + .active-sign { + position: relative; + z-index: 2; + .active-needle { + width: 30px; + height: 34px; + background-image: url("@/assets/images/point.png"); + background-size: cover; + bottom: 1px; + left: -6px; + position: absolute; + } + .timeLine-point { + width: 18px; + height: 18px; + background-color: transparent; + border-radius: 50%; + border: 1.6px solid #ffe5a4; + position: absolute; + display: flex; + align-items: center; + justify-content: center; + top: -6px; + cursor: pointer; + user-select: none; + will-change: left; + transform: translate3d(0, 0, 0); // 强制启用硬件加速 + &:hover { + transform: translate3d(0, 0, 0) scale(1.1); + } + &:active { + transform: translate3d(0, 0, 0) scale(0.95); + } + &::after { + content: ""; + width: 10px; + height: 10px; + background-color: #f9bd25; + border-radius: 50%; + position: absolute; + } + } + } + } + .current-time-display { + position: absolute; + bottom: 20px; + left: 50%; + transform: translateX(-50%); + background: rgba(0, 67, 125, 0.8); + border: 1px solid #3aa1f8; + border-radius: 4px; + padding: 8px 16px; + color: #fff; + font-family: "PingFang SC"; + font-size: 14px; + font-weight: 400; + backdrop-filter: blur(3px); + } } } diff --git a/src/views/LinkPrediction/socialGroups/components/graph.vue b/src/views/LinkPrediction/socialGroups/components/graph.vue index 6576c38..35fd312 100644 --- a/src/views/LinkPrediction/socialGroups/components/graph.vue +++ b/src/views/LinkPrediction/socialGroups/components/graph.vue @@ -3,26 +3,23 @@ diff --git a/src/views/LinkPrediction/socialGroups/components/userPanel.vue b/src/views/LinkPrediction/socialGroups/components/userPanel.vue index 14c2cd9..d4b6578 100644 --- a/src/views/LinkPrediction/socialGroups/components/userPanel.vue +++ b/src/views/LinkPrediction/socialGroups/components/userPanel.vue @@ -59,6 +59,8 @@ const props = defineProps({ const handleUserItem = (index, group = {}) => { curUserGroupIndex.value = index; + // console.log("点击用户列表中的item",index); + // console.log("点击用户列表中的item",group); emit("click:selectedGroup", group); }; diff --git a/src/views/LinkPrediction/socialGroups/index.vue b/src/views/LinkPrediction/socialGroups/index.vue index b0463af..719b2f6 100644 --- a/src/views/LinkPrediction/socialGroups/index.vue +++ b/src/views/LinkPrediction/socialGroups/index.vue @@ -84,7 +84,10 @@ const postDialog = ref(false); const currentPostPost = ref(null); const handleSelectedUserGroup = (group) => { - console.log(group); + socialGroupsStore.curComponent = "detailkNode" + const groupIds = group?.list.map((item)=>item.groupId) + socialGroupsStore.initGraphCommunityDetailNode(groupIds) + socialGroupsStore.getSocialGroupPostListByRelationId(group?.relationId) }; const handleOpenPostDialog = (post) => { @@ -98,9 +101,9 @@ const handleTouchButtom = (outoIncrement) => { onMounted(() => { socialGroupsStore.initGroupList(); - socialGroupsStore.initPostList(0); + socialGroupsStore.initPostList(1); socialGroupsStore.initGraphCommunityNode(); - socialGroupsStore.initStatisticsList(); + socialGroupsStore.initGraphStatistics(); }); provide("communityNodeList", socialGroupsStore.communityNodeList);