diff --git a/src/assets/anchorAvatar/boss.png b/src/assets/anchorAvatar/boss.png new file mode 100644 index 0000000..263ba2f Binary files /dev/null and b/src/assets/anchorAvatar/boss.png differ diff --git a/src/store/groupEvolution/index.js b/src/store/groupEvolution/index.js index 6338036..b74034c 100644 --- a/src/store/groupEvolution/index.js +++ b/src/store/groupEvolution/index.js @@ -200,16 +200,20 @@ export const useGroupDiscoveryStore = defineStore("groupDiscovery", { if (res.code != 200) return let resultObj = {} const themeMap = { - 群体一: "#32b6fb", - 群体二: "#00d6da", - 群体三: "#fddc33" + 群体一: "#00d6da", + 群体二: "#fddc33", + 群体三: "#32b6fb" } resultObj["xAxisData"] = res.data.timeList.map((item) => TansTimestamp(item, "HH:mm:ss")) resultObj["yAxisRange"] = res.data.scale resultObj["seriesList"] = [] - Object.entries(res.data.data).forEach(([key, list]) => { - resultObj["seriesList"].push({ name: key, themeColor: themeMap[key], data: list }) + // 定义明确的群体顺序 + const groupOrder = ["群体一", "群体二", "群体三"] + groupOrder.forEach(key => { + if (res.data.data[key]) { + resultObj["seriesList"].push({ name: key, themeColor: themeMap[key], data: res.data.data[key] }) + } }) this.chartData = resultObj }, @@ -275,45 +279,52 @@ export const useGroupStructureStore = defineStore("groupStructure", { chartsData: {}, wordCloudData: [ { - text: "佩洛西", + text: "主权权益", top: 115.5, left: 215.5, - width: 109, - height: 40, - fontSize: 28, + width: 80, + height: 22, + fontSize: 13, opacity: 1 }, - { text: "中国", top: 183.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, { - text: "中国人民解放军", + text: "局座预言", + top: 80, + left: 69.5, + width: 73, + height: 22, + fontSize: 12, + opacity: 0.7 + }, + { + text: "吃瓜", top: 72.5, left: 132.5, - width: 123, + width: 50, height: 22, fontSize: 12, opacity: 1 }, { - text: "中美关系", - top: 171.5, + text: "中国海警", + top: 140, left: 212.5, - width: 81, - height: 22, - fontSize: 14, + width: 130, + height: 40, + fontSize: 22, opacity: 0.8 }, - { text: "台独", top: 135.5, left: 42.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, { - text: "台海和平", - top: 228.5, - left: 230.5, + text: "菲律宾", + top: 150, + left: 50, width: 81, height: 22, fontSize: 14, opacity: 0.8 }, { - text: "坚决反对", + text: "手指", top: 200.5, left: 38.5, width: 73, @@ -322,29 +333,38 @@ export const useGroupStructureStore = defineStore("groupStructure", { opacity: 0.7 }, { - text: "联合公报", - top: 241.5, - left: 130.5, + text: "装甲船", + top: 50, + left: 160.5, width: 73, height: 19, fontSize: 12, opacity: 0.7 }, { - text: "有力反制", + text: "登检", top: 211.5, left: 143.5, - width: 73, + width: 50, height: 19, fontSize: 12, opacity: 1 }, - { text: "白宫", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "内政", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, - { text: "访台", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "领土", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, - { 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 } + { text: "执法", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "现场画面", top: 110, left: 26, width: 90, height: 22, fontSize: 14, opacity: 1 }, + { text: "渔民", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "包夹", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, + { 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 }, + { + text: "大刀长矛", + top: 186, + left: 200.5, + width: 70, + height: 19, + fontSize: 12, + opacity: 0.8 + } ], posts: [ { @@ -584,7 +604,96 @@ export const useGroupMemberStore = defineStore("groupMember", { graph: {}, chartData: {}, chartsData: {}, - posts: [] + posts: [], + wordCloudData: [ + { + text: "主权权益", + top: 115.5, + left: 215.5, + width: 80, + height: 22, + fontSize: 13, + opacity: 1 + }, + { + text: "局座预言", + top: 80, + left: 69.5, + width: 73, + height: 22, + fontSize: 12, + opacity: 0.7 + }, + { + text: "吃瓜", + top: 72.5, + left: 132.5, + width: 50, + height: 22, + fontSize: 12, + opacity: 1 + }, + { + text: "中国海警", + top: 140, + left: 212.5, + width: 130, + height: 40, + fontSize: 22, + opacity: 0.8 + }, + { + text: "菲律宾", + top: 150, + left: 50, + width: 81, + height: 22, + fontSize: 14, + opacity: 0.8 + }, + { + text: "手指", + top: 200.5, + left: 38.5, + width: 73, + height: 19, + fontSize: 12, + opacity: 0.7 + }, + { + text: "装甲船", + top: 50, + left: 160.5, + width: 73, + height: 19, + fontSize: 12, + opacity: 0.7 + }, + { + text: "登检", + top: 211.5, + left: 143.5, + width: 50, + height: 19, + fontSize: 12, + opacity: 1 + }, + { text: "执法", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "现场画面", top: 110, left: 26, width: 90, height: 22, fontSize: 14, opacity: 1 }, + { text: "渔民", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "包夹", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, + { 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 }, + { + text: "大刀长矛", + top: 186, + left: 200.5, + width: 70, + height: 19, + fontSize: 12, + opacity: 0.8 + } + ], }), actions: { // 获取时间轴 diff --git a/src/store/keyNodeRecognition/index.js b/src/store/keyNodeRecognition/index.js index dbc616e..e6ae4ab 100644 --- a/src/store/keyNodeRecognition/index.js +++ b/src/store/keyNodeRecognition/index.js @@ -57,6 +57,7 @@ import xinglangjunshi from "@/assets/anchorAvatar/xinlangjunshi.png" import huanqiushibao from "@/assets/anchorAvatar/huanqiushibao.png" import jiangxiayunfei from "@/assets/anchorAvatar/jiangxiayunfei.png" import tangning from "@/assets/anchorAvatar/tangning20150903.png" +import boss from "@/assets/anchorAvatar/boss.png" import lezhi from "@/assets/anchorAvatar/lezhi567.png" import daxiaaaa from "@/assets/anchorAvatar/daxiaaaaa.png" import jizhetuan from "@/assets/anchorAvatar/jiangxiayunfei.png" @@ -337,7 +338,7 @@ export const useKeyNodeRecognitionStore = defineStore("keyNodeRecognition", { anchorChartInfoList: [ { id: 1, name: "锚点数量", icon: anchorNumber, number: 20 }, { id: 2, name: "平均粉丝数量", icon: fancyNumber, number: "812.8w" }, - { id: 3, name: "平均发帖频率", icon: frequencyNumber, number: "20h/1次" }, + { id: 3, name: "平均发帖频率", icon: frequencyNumber, number: "20h/次" }, { id: 4, name: "平均参与互动次数", icon: interactionNumber, number: 157 } ], @@ -1082,14 +1083,14 @@ export const useKeyNodeRecognitionStore = defineStore("keyNodeRecognition", { commenter: " 外贸发布BBS", comment: "#菲自曝被中国海警缴枪的是顶级特种部队# 菲律宾特种部队就这?怪不得现在菲律宾网友各种找补洗白 ", - time: "盖世英雄玉椒龙" + time: "2024-06-23 15:20:55" }, { avatar: xinlangImg, commenter: " 新浪军事", comment: " #菲总统最新言论话里有话#【警惕!菲总统最新言论,话里有话】什么叫做一意孤行地碰瓷?菲律宾方...", - time: "2024-06-23 18:47:55 " + time: "2024-06-23 18:47:55" }, { avatar: xinlangImg, @@ -1608,7 +1609,7 @@ export const useKeyNodeRecognitionStore = defineStore("keyNodeRecognition", { ] }, 钻石狗Boss: { - avatar: tangning, + avatar: boss, earlistTime: "2024-03-16 17:10:41", postTotal: 0, postTransmitedTotal: 0, diff --git a/src/store/linkPrediction/index.js b/src/store/linkPrediction/index.js index 94cfac4..aef57a1 100644 --- a/src/store/linkPrediction/index.js +++ b/src/store/linkPrediction/index.js @@ -74,45 +74,45 @@ export const useCharacterInteractionStore = defineStore("characterInteraction", ], wordCloudData: [ { - text: "佩洛西", - top: 115.5, + text: "賴清德", + top: 100.5, left: 215.5, - width: 109, + width: 120, height: 40, fontSize: 28, opacity: 1 }, - { text: "中国", top: 183.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, + { text: "總統", top: 150.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, { - text: "中国人民解放军", + text: "民進", top: 72.5, left: 132.5, - width: 123, + width: 55, height: 22, fontSize: 12, opacity: 1 }, { - text: "中美关系", - top: 171.5, + text: "中华民國", + top: 150.5, left: 212.5, width: 81, height: 22, fontSize: 14, opacity: 0.8 }, - { text: "台独", top: 135.5, left: 42.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, + { text: "台灣", top: 120.5, left: 30.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, { - text: "台海和平", - top: 228.5, - left: 230.5, - width: 81, + text: "英文", + top: 200.5, + left: 250.5, + width: 55, height: 22, fontSize: 14, opacity: 0.8 }, { - text: "坚决反对", + text: "就職典禮", top: 200.5, left: 38.5, width: 73, @@ -121,29 +121,29 @@ export const useCharacterInteractionStore = defineStore("characterInteraction", opacity: 0.7 }, { - text: "联合公报", - top: 241.5, - left: 130.5, + text: "中國", + top: 220.5, + left: 120.5, width: 73, height: 19, fontSize: 12, opacity: 0.7 }, { - text: "有力反制", - top: 211.5, - left: 143.5, - width: 73, + text: "萧美琴", + top: 190.5, + left: 160.5, + width: 70, height: 19, fontSize: 12, opacity: 1 }, - { text: "白宫", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "内政", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, - { text: "访台", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "领土", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, - { 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 } + { text: "民主", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "職演", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, + { text: "人民", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "立委", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, + { text: "國會", top: 60.5, left: 265.5, width: 49, height: 19, fontSize: 12, opacity: 0.7 }, + { text: "两岸", top: 170.5, left: 287.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 } ], statisticsList: [ @@ -345,45 +345,45 @@ export const useSocialGroupsStore = defineStore("socialGroups", { ], wordCloudData: [ { - text: "佩洛西", - top: 115.5, + text: "賴清德", + top: 100.5, left: 215.5, - width: 109, + width: 120, height: 40, fontSize: 28, opacity: 1 }, - { text: "中国", top: 183.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, + { text: "總統", top: 150.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, { - text: "中国人民解放军", + text: "民進", top: 72.5, left: 132.5, - width: 123, + width: 55, height: 22, fontSize: 12, opacity: 1 }, { - text: "中美关系", - top: 171.5, + text: "中华民國", + top: 150.5, left: 212.5, width: 81, height: 22, fontSize: 14, opacity: 0.8 }, - { text: "台独", top: 135.5, left: 42.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, + { text: "台灣", top: 120.5, left: 30.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, { - text: "台海和平", - top: 228.5, - left: 230.5, - width: 81, + text: "英文", + top: 200.5, + left: 250.5, + width: 55, height: 22, fontSize: 14, opacity: 0.8 }, { - text: "坚决反对", + text: "就職典禮", top: 200.5, left: 38.5, width: 73, @@ -392,30 +392,30 @@ export const useSocialGroupsStore = defineStore("socialGroups", { opacity: 0.7 }, { - text: "联合公报", - top: 241.5, - left: 130.5, + text: "中國", + top: 220.5, + left: 120.5, width: 73, height: 19, fontSize: 12, opacity: 0.7 }, { - text: "有力反制", - top: 211.5, - left: 143.5, - width: 73, + text: "萧美琴", + top: 190.5, + left: 160.5, + width: 70, height: 19, fontSize: 12, opacity: 1 }, - { text: "白宫", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "内政", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, - { text: "访台", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "领土", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, - { 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 } - ] + { text: "民主", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "職演", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, + { text: "人民", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "立委", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, + { text: "國會", top: 60.5, left: 265.5, width: 49, height: 19, fontSize: 12, opacity: 0.7 }, + { text: "两岸", top: 170.5, left: 287.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 } + ], }), actions: { // 互动行为相似列表数据 @@ -557,45 +557,45 @@ export const useCharacterHiddenStore = defineStore("characterHidden", { ], wordCloudData: [ { - text: "佩洛西", - top: 115.5, + text: "賴清德", + top: 100.5, left: 215.5, - width: 109, + width: 120, height: 40, fontSize: 28, opacity: 1 }, - { text: "中国", top: 183.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, + { text: "總統", top: 150.5, left: 69.5, width: 73, height: 35, fontSize: 22, opacity: 1 }, { - text: "中国人民解放军", + text: "民進", top: 72.5, left: 132.5, - width: 123, + width: 55, height: 22, fontSize: 12, opacity: 1 }, { - text: "中美关系", - top: 171.5, + text: "中华民國", + top: 150.5, left: 212.5, width: 81, height: 22, fontSize: 14, opacity: 0.8 }, - { text: "台独", top: 135.5, left: 42.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, + { text: "台灣", top: 120.5, left: 30.5, width: 57, height: 24, fontSize: 16, opacity: 1 }, { - text: "台海和平", - top: 228.5, - left: 230.5, - width: 81, + text: "英文", + top: 200.5, + left: 250.5, + width: 55, height: 22, fontSize: 14, opacity: 0.8 }, { - text: "坚决反对", + text: "就職典禮", top: 200.5, left: 38.5, width: 73, @@ -604,29 +604,29 @@ export const useCharacterHiddenStore = defineStore("characterHidden", { opacity: 0.7 }, { - text: "联合公报", - top: 241.5, - left: 130.5, + text: "中國", + top: 220.5, + left: 120.5, width: 73, height: 19, fontSize: 12, opacity: 0.7 }, { - text: "有力反制", - top: 211.5, - left: 143.5, - width: 73, + text: "萧美琴", + top: 190.5, + left: 160.5, + width: 70, height: 19, fontSize: 12, opacity: 1 }, - { text: "白宫", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "内政", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, - { text: "访台", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, - { text: "领土", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, - { 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 } + { text: "民主", top: 176.5, left: 15.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "職演", top: 87.5, left: 36.5, width: 53, height: 22, fontSize: 14, opacity: 1 }, + { text: "人民", top: 103.5, left: 95.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 }, + { text: "立委", top: 57.5, left: 72.5, width: 49, height: 19, fontSize: 12, opacity: 0.6 }, + { text: "國會", top: 60.5, left: 265.5, width: 49, height: 19, fontSize: 12, opacity: 0.7 }, + { text: "两岸", top: 170.5, left: 287.5, width: 49, height: 19, fontSize: 12, opacity: 0.8 } ], statisticsDetailList: [ { id: 1, icon: nodePrefix, name: "节点数", key: "nodesCount" }, diff --git a/src/views/GroupEvolution/components/groupChart.vue b/src/views/GroupEvolution/components/groupChart.vue index 30f9d49..66de29f 100644 --- a/src/views/GroupEvolution/components/groupChart.vue +++ b/src/views/GroupEvolution/components/groupChart.vue @@ -135,9 +135,9 @@ const initChart = () => { extraCssText: "box-shadow:none;padding:0;", formatter: function (params) { let color = { - 群体一: "#33b6fb", - 群体二: "#00d6da", - 群体三: "#fddc33" + 群体一: "#00d6da", + 群体二: "#fddc33", + 群体三: "#32b6fb" } if (props.moduleName == "群体成员演化分析") { color = { diff --git a/src/views/GroupEvolution/components/groupShow.vue b/src/views/GroupEvolution/components/groupShow.vue index c0504ef..073a06e 100644 --- a/src/views/GroupEvolution/components/groupShow.vue +++ b/src/views/GroupEvolution/components/groupShow.vue @@ -19,9 +19,9 @@ import { onMounted } from "vue" import * as echarts from "echarts" const chartTitleList = [ - { id: 1, name: "头部自媒体 增量速率" }, - { id: 2, name: "官方媒体 增量速率" }, - { id: 3, name: "普通自媒体 增量速率" } + { id: 1, name: "群体一 增量速率" }, + { id: 2, name: "群体二 增量速率" }, + { id: 3, name: "群体三 增量速率" } ] let chartInstance1 = null let chartInstance2 = null @@ -39,9 +39,9 @@ const props = defineProps({ const optionHandle = ({ xAxis, yAxis, data }, flag) => { const lineColors = { - "头部自媒体 增量速率": "#2AB8FD", - "官方媒体 增量速率": "#01D7DA", - "普通自媒体 增量速率": "#FFDA09" + "群体一 增量速率": "#01D7DA", + "群体二 增量速率": "#FFDA09", + "群体三 增量速率": "#2AB8FD" } return { tooltip: { @@ -116,9 +116,9 @@ const initCharts = () => { chartInstance1 = echarts.init(document.getElementById("container1")) chartInstance2 = echarts.init(document.getElementById("container2")) chartInstance3 = echarts.init(document.getElementById("container3")) - chartInstance1.setOption(optionHandle(props.chartsData.topSelfMedia, "头部自媒体 增量速率")) - chartInstance2.setOption(optionHandle(props.chartsData.officialMedia, "官方媒体 增量速率")) - chartInstance3.setOption(optionHandle(props.chartsData.ordinaryMedia, "普通自媒体 增量速率")) + chartInstance1.setOption(optionHandle(props.chartsData.topSelfMedia, "群体一 增量速率")) + chartInstance2.setOption(optionHandle(props.chartsData.officialMedia, "群体二 增量速率")) + chartInstance3.setOption(optionHandle(props.chartsData.ordinaryMedia, "群体三 增量速率")) } onMounted(() => { diff --git a/src/views/KeyNodeDiscern/anchorRecommendation/components/attentionTopic.vue b/src/views/KeyNodeDiscern/anchorRecommendation/components/attentionTopic.vue index 2c02453..d2675e5 100644 --- a/src/views/KeyNodeDiscern/anchorRecommendation/components/attentionTopic.vue +++ b/src/views/KeyNodeDiscern/anchorRecommendation/components/attentionTopic.vue @@ -76,16 +76,18 @@ const initTopicChart = () => { bottom: "1%", containLabel: true }, - toolbox: { - feature: { - saveAsImage: {} - } - }, + // toolbox: { + // feature: { + // saveAsImage: {} + // } + // }, xAxis: { type: "category", boundaryGap: true, //坐标轴两边留白 data: ["6.25", "6.26", "6.27", "6.28", "6.29", "6.30", "7.1", "7.2"], name: "日期", + nameLocation: "end", + nameGap: 10, nameTextStyle: { color: "#606266", fontSize: 12 diff --git a/src/views/KeyNodeDiscern/anchorRecommendation/components/detailNode.vue b/src/views/KeyNodeDiscern/anchorRecommendation/components/detailNode.vue index d3e3b29..50c9782 100644 --- a/src/views/KeyNodeDiscern/anchorRecommendation/components/detailNode.vue +++ b/src/views/KeyNodeDiscern/anchorRecommendation/components/detailNode.vue @@ -23,6 +23,17 @@ const emit = defineEmits(["click:openDialog", "click:goback"]) const detailContainer = ref(null) const currentSelectedCommunity = ref({}) let chart = null +// 政府官号 +const officeList = ["峨眉公安","平安马边","东坡公安","淮安清江浦法院","抚州消防","游仙公安", + "甘泉检察","平安会东","淮安市公安局淮阴分局","南铁福州车务段","太白检察", + "任丘司法行政","万源警事","澄城检察","国台办发布","海洋装备与公务船资讯", + "团陵水县委","滕州司法行政在线","陇南徽县总工会","南部战区","中国海警","奉贤反邪"] +// 新闻媒体列表 +const newList = ["大象观点","大象新闻","湖北日报","热点锐评","合肥晚报","北京广播电视台","环球收视", + "沧州微播报","中华文化传媒","玉渊谭天","人民网","空警世界","海峡之声","中国军号", + "新浪军事","解放军报","人民日报","中国妇女报","央视新闻","成都新事儿","中国警方在线", + "环视频","四川观察","齐鲁晚报","生命时报","中国新闻网","南海之声","每日信报","环球网", + "大国外交最前线","环球时报"] // 根据节点数量计算缩放比例 const calculateInitialZoom = (nodes) => { @@ -38,6 +49,17 @@ const initChart = async () => { currentSelectedCommunity.value = props.communityNode chart = echarts.init(document.getElementById("container")) + + // + const nodeLabel = (node) => { + if (officeList.includes(node.nodeName)) { + return "政府官号" + } + if (newList.includes(node.nodeName)) { + return "新闻媒体" + } + return "普通自媒体" + } //处理节点 //从锚点邻居数据集中查找出该锚点所有的邻居节点 let nodes = [] @@ -56,36 +78,37 @@ const initChart = async () => { .map((filteredList) => ({ ...extraInfo[filteredList[0]], anchor: filteredList[0], - neighbors: filteredList[1].map((neighNode) => ({ name: neighNode, avatar: "" })) + neighbors: filteredList[1].map((neighNode) => ({ id: neighNode ,nodeName: neighNode, avatar: "" })) + })) //处理连线 let links = [] filterResult.forEach(({ anchor, neighbors }) => { ;(neighbors ?? []).forEach((neigh) => { - links.push({ source: anchor, target: neigh.name }) + links.push({ source: anchor, target: neigh.id }) }) }) + // 合并所有锚点和邻居节点到一个数组并去重 let nodeSet = new Set() filterResult.forEach((item) => { //添加锚点自己 if (!nodeSet.has(item.anchor)) { - nodes.push({ name: item?.anchor, value: item?.anchor, category: 1, ...item }) + nodes.push({ id: item?.anchor, nodeName: item?.anchor, value: item?.anchor, category: 1, ...item }) nodeSet.add(item?.anchor) } //添加该锚点的邻居 ;(item.neighbors || []).forEach((n) => { - if (!nodeSet.has(n?.name)) { - nodes.push({ name: n.name, value: n.name, category: 0, avatar: n.avatar ?? "" }) - nodeSet.add(n.name) + if (!nodeSet.has(n?.nodeName)) { + nodes.push({ id: n.id, nodeName: n.nodeName, value: n.nodeName, category: 0, avatar: n.avatar ?? "", label: nodeLabel(n) }) + nodeSet.add(n.nodeName) } }) }) const data = { nodes, links } - console.log(data) const categories = [ { name: "邻居账号", category: 0 }, @@ -160,7 +183,7 @@ const initChart = async () => { >
+
+