diff --git a/src/assets/images/linkPrediction/icon/timestamp-button-icon.png b/src/assets/images/linkPrediction/icon/timestamp-button-icon.png
new file mode 100644
index 0000000..f5e3eca
Binary files /dev/null and b/src/assets/images/linkPrediction/icon/timestamp-button-icon.png differ
diff --git a/src/service/api/linkPrediction.js b/src/service/api/linkPrediction.js
index 8bd7662..73fa729 100644
--- a/src/service/api/linkPrediction.js
+++ b/src/service/api/linkPrediction.js
@@ -39,9 +39,9 @@ export function getInteractionPostList(userGroupId) {
}
//社交紧密团体识别的贴文列表
-export function getSocialPostList(outoIncrement) {
+/* export function getSocialPostList(outoIncrement) {
return http.get(`/linkPrediction/triangle/post_list?page=${outoIncrement}`)
-}
+} */
// 社交紧密团体的对应紧密关系的帖文--根据relationId来查找
export function getSocialPostListByRelationId(relationId){
@@ -57,6 +57,8 @@ export function getSocialCommunityList() {
return http.get(`/linkPrediction/triangle/community`)
}
+// 社交紧密团体中社团内的
+
// 社交紧密团体的社团内部节点
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 444b0ec..5989586 100644
--- a/src/store/llinkPrediction/index.js
+++ b/src/store/llinkPrediction/index.js
@@ -4,7 +4,6 @@ import {
getGroupUserListFromTriangle,
getGroupUserListFromSocial,
getInteractionPostList,
- getSocialPostList,
getInteractionHiddenPostList,
getInteractionCommunityNodes,
getInteractionCommunityDetailNodes,
@@ -202,6 +201,7 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
curComponent: "CommunityNode",
curSelecedGroupIds: [],
communityDetailNodeList: [],
+ timeList: [],
statisticsList: [
{ id: 1, icon: nodePrefix, name: "节点数", key: "nodesCount" },
{ id: 2, icon: communityPrefix, name: "社团数", key: "groupCount" },
@@ -397,8 +397,8 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
this.userList = res.data.userList
},
// 事件脉络分析中的帖文数据
- async initPostList(outoIncrement) {
- const res = await getSocialPostList(outoIncrement)
+ async initPostList(relationId) {
+ const res = await getSocialPostListByRelationId(relationId)
if (res.code != 200) return
if (this.posts.length != 0) {
this.posts.push(...res.data)
@@ -445,6 +445,7 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
}))
console.log("打印社交团体详情:");
console.log(res.data);
+ this.timeList = res.data.timeList
this.communityDetailNodeList = res.data.userRelation
}
diff --git a/src/views/LinkPrediction/socialGroups/components/detailNode.vue b/src/views/LinkPrediction/socialGroups/components/detailNode.vue
index 530286b..bda0c5d 100644
--- a/src/views/LinkPrediction/socialGroups/components/detailNode.vue
+++ b/src/views/LinkPrediction/socialGroups/components/detailNode.vue
@@ -19,7 +19,13 @@
{{ TansTimestamp(endTime, "YYYY.MM.DD HH:mm:ss") }}
@@ -110,8 +116,8 @@ const handlePointPointerDown = (e) => {
const handlePointerUp = () => {
isDragging.value = false
// 拖动结束时输出当前时间
- const currentTimes = TansTimestamp(currentTime.value, "YYYY.MM.DD HH:mm:ss")
- console.log("拖动结束,当前时间:", currentTimes)
+ const currentTimes = TansTimestamp(currentTime.value, "YYYY-MM-DD HH:mm:ss")
+ socialGroupsStore.initGraphCommunityDetailNode(socialGroupsStore.curSelecedGroupIds, currentTimes)
document.removeEventListener("pointermove", handlePointerMove)
document.removeEventListener("pointerup", handlePointerUp)
@@ -136,6 +142,7 @@ onUnmounted(() => {
})
let chart = null
+
const initChart = async () => {
chart = echarts.init(document.getElementById("container"))
@@ -174,9 +181,17 @@ const initChart = async () => {
const data = { links, nodes }
const categories = [
- { name: "信息发布者", category: 0, icon: `image://${new URL('@/assets/images/linkPrediction/icon/information-publisher-legend-icon.png', import.meta.url)}` },
- { name: "互动关系", category: 1, icon: `image://${new URL('@/assets/images/linkPrediction/icon/interactive-relationship-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)}` }
+ { name: "事件活跃者", category: 0, icon: "circle" },
+ {
+ name: "互动关系",
+ category: 1,
+ icon: `image://${new URL("@/assets/images/linkPrediction/icon/interaction-icon2.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 = {
//图例配置
@@ -207,8 +222,8 @@ const initChart = async () => {
icon: c.icon
})),
right: 21,
+ symbolKeepAspect: false,
bottom: 70,
- icon: "circle",
orient: "vertical",
itemWidth: 16,
itemHeight: 16,
@@ -260,7 +275,7 @@ const initChart = async () => {
show: false,
position: "middle",
formatter: function (params) {
- return params.data.edge
+ return params.data.interactionTimes
},
fontSize: 14
},
@@ -282,7 +297,7 @@ const initChart = async () => {
animation: false,
draggable: true,
roam: true,
- zoom: 0.3,
+ zoom: 0.15,
categories: categories,
force: {
edgeLength: 2500,
@@ -332,8 +347,13 @@ const initChart = async () => {
}
onMounted(() => {
- console.log("statisticsDetailList", socialGroupsStore.statisticsDetailList)
initChart()
+ chart.on("legendselectchanged", function (params) {
+ // 解决变形问题
+ setTimeout(() => {
+ chart.resize()
+ }, 0)
+ })
})
@@ -445,7 +465,7 @@ onMounted(() => {
background-image: url("@/assets/images/point.png");
background-size: cover;
bottom: 1px;
- left: -6px;
+ left: -11px;
position: absolute;
}
.timeLine-point {
@@ -459,6 +479,7 @@ onMounted(() => {
align-items: center;
justify-content: center;
top: -6px;
+ left: -5px;
cursor: pointer;
user-select: none;
will-change: left;
diff --git a/src/views/LinkPrediction/socialGroups/components/postList.vue b/src/views/LinkPrediction/socialGroups/components/postList.vue
index e6ffb02..8ee330f 100644
--- a/src/views/LinkPrediction/socialGroups/components/postList.vue
+++ b/src/views/LinkPrediction/socialGroups/components/postList.vue
@@ -15,7 +15,7 @@
@click="handleLeaderPost(post)"
>
- {{ TansTimestamp(post.time) }}
+ {{ TansTimestamp(post.interactionTime) }}
【{{ post.userName }}】{{ post.behavior }} 【{{ post.neighborName }}】的贴文
@@ -36,7 +36,7 @@ const props = defineProps({
}
});
-const emit = defineEmits(["click:openDialog", "scroll:touchButtom"]);
+// const emit = defineEmits(["click:openDialog", "scroll:touchButtom"]);
const page = ref(0);
const listRef = ref(null);
@@ -44,12 +44,12 @@ const handleScroll = () => {
const el = listRef.value;
if (!el) return;
if (el.scrollTop + el.clientHeight >= el.scrollHeight - 1) {
- emit("scroll:touchButtom", page.value++);
+ // emit("scroll:touchButtom", page.value++);
}
};
const handleLeaderPost = (item) => {
- emit("click:openDialog", item);
+ // emit("click:openDialog", item);
console.log(item);
};
diff --git a/src/views/LinkPrediction/socialGroups/components/userPanel.vue b/src/views/LinkPrediction/socialGroups/components/userPanel.vue
index 57b3a28..85d4afb 100644
--- a/src/views/LinkPrediction/socialGroups/components/userPanel.vue
+++ b/src/views/LinkPrediction/socialGroups/components/userPanel.vue
@@ -13,7 +13,7 @@
src="@/assets/images/linkPrediction/title/group-item-title.png"
class="group-type-back"
/>
- Top{{ index+1 }}
+ TOP{{ index+1 }}
![]()
@@ -60,7 +60,7 @@ const props = defineProps({
const handleUserItem = (index, group = {}) => {
curUserGroupIndex.value = index;
// console.log("点击用户列表中的item",index);
- // console.log("点击用户列表中的item",group);
+ 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 719b2f6..1a9c8e1 100644
--- a/src/views/LinkPrediction/socialGroups/index.vue
+++ b/src/views/LinkPrediction/socialGroups/index.vue
@@ -19,8 +19,6 @@
@@ -37,7 +35,7 @@
-
+
{{ currentPostPost.content }}
@@ -86,22 +84,16 @@ const currentPostPost = ref(null);
const handleSelectedUserGroup = (group) => {
socialGroupsStore.curComponent = "detailkNode"
const groupIds = group?.list.map((item)=>item.groupId)
- socialGroupsStore.initGraphCommunityDetailNode(groupIds)
+ socialGroupsStore.timeList = group?.timeList
+ const length = socialGroupsStore.timeList.length
+ const lastTime = socialGroupsStore.timeList[length - 1]
+ socialGroupsStore.initGraphCommunityDetailNode(groupIds, lastTime)
socialGroupsStore.getSocialGroupPostListByRelationId(group?.relationId)
};
-const handleOpenPostDialog = (post) => {
- postDialog.value = true;
- currentPostPost.value = post;
-};
-
-const handleTouchButtom = (outoIncrement) => {
- socialGroupsStore.initPostList(outoIncrement);
-};
-
onMounted(() => {
socialGroupsStore.initGroupList();
- socialGroupsStore.initPostList(1);
+ socialGroupsStore.initPostList("212431");
socialGroupsStore.initGraphCommunityNode();
socialGroupsStore.initGraphStatistics();
});