This commit is contained in:
duanhao 2025-08-26 18:01:19 +08:00
commit f756ffc157
5 changed files with 54 additions and 20 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -38,7 +38,12 @@ const props = defineProps({
} }
}) })
const emit = defineEmits(["click:hotTopic", "auto:currentTopList", "over:hotTopic"]) const emit = defineEmits([
"click:hotTopic",
"auto:currentTopList",
"over:hotTopic",
"click:refresh"
])
const currentTopicList = ref([]) const currentTopicList = ref([])
let myChart = null let myChart = null
let timer = null let timer = null
@ -265,6 +270,8 @@ const handleRefresh = () => {
initTopicChart() initTopicChart()
// //
dynamicShowEventList() dynamicShowEventList()
emit("click:refresh", true)
} }
} }
const handleResize = () => { const handleResize = () => {

View File

@ -38,11 +38,33 @@ const currentTopicList = inject("currentTopicList")
//hoveritem //hoveritem
const currentTopic = inject("currentTopic") const currentTopic = inject("currentTopic")
//topic
const isRefresh = inject("refresh")
const riskNodeColorMap = { const riskNodeColorMap = {
低风险: `image://${new URL(lowRiskNode, import.meta.url)}`, 低风险: `image://${new URL(lowRiskNode, import.meta.url)}`,
中风险: `image://${new URL(middleRiskNode, import.meta.url)}`, 中风险: `image://${new URL(middleRiskNode, import.meta.url)}`,
高风险: `image://${new URL(highRiskNode, import.meta.url)}` 高风险: `image://${new URL(highRiskNode, import.meta.url)}`
} }
const initNodeState = () => {
const option = chart.getOption()
const anchorCommunityList = option.series[0].data //
//
anchorCommunityList.forEach((node) => {
if (node.category === 1) {
node.symbol = `image://${new URL(predictionNodeImg, import.meta.url)}`
}
})
chart.setOption({
series: [
{
data: anchorCommunityList
}
]
})
return anchorCommunityList
}
//() //()
watch(currentTopicList, (newList) => { watch(currentTopicList, (newList) => {
const set = new Set() // const set = new Set() //
@ -83,21 +105,7 @@ watch(currentTopicList, (newList) => {
//(hover) //(hover)
watch(currentTopic, (newValue) => { watch(currentTopic, (newValue) => {
const option = chart.getOption() const anchorCommunityList = initNodeState()
const anchorCommunityList = option.series[0].data //
//
anchorCommunityList.forEach((node) => {
if (node.category === 1) {
node.symbol = `image://${new URL(predictionNodeImg, import.meta.url)}`
}
})
chart.setOption({
series: [
{
data: anchorCommunityList
}
]
})
// //
const currentTopicEvent = { const currentTopicEvent = {
@ -124,6 +132,15 @@ watch(currentTopic, (newValue) => {
] ]
}) })
}) })
//()
watch(isRefresh, (newFlag) => {
if (newFlag) {
initNodeState(newFlag)
isRefresh.value = false
}
})
//userPanel //userPanel
watch(currentUser, (val) => { watch(currentUser, (val) => {
if (val && chart) { if (val && chart) {
@ -158,11 +175,9 @@ const initChart = async () => {
// //
chart.on("mouseover", function (params) { chart.on("mouseover", function (params) {
if (!params.data) return if (!params.data) return
// //
if (userSelectedNodeIndex.value !== null && params.dataIndex === userSelectedNodeIndex.value) { if (userSelectedNodeIndex.value !== null && params.dataIndex === userSelectedNodeIndex.value)
return return
}
if (params.dataType === "node") { if (params.dataType === "node") {
// //

View File

@ -35,13 +35,17 @@ const props = defineProps({
} }
}) })
const anchorMonitorList = ref(props.anchorMonitorList)
const sortAnchorMonitorListByTime = (anchorMonitorList) => { const sortAnchorMonitorListByTime = (anchorMonitorList) => {
return anchorMonitorList.sort((a, b) => { return anchorMonitorList.sort((a, b) => {
// //
return new Date(a.time.trim()) - new Date(b.time.trim()) return new Date(a.time.trim()) - new Date(b.time.trim())
}) })
} }
props.anchorMonitorList = sortAnchorMonitorListByTime(props.anchorMonitorList)
anchorMonitorList.value = sortAnchorMonitorListByTime(anchorMonitorList.value)
const startAutoScroll = () => { const startAutoScroll = () => {
if (!monitorListRef.value) return if (!monitorListRef.value) return
scrollTimer = setInterval(() => { scrollTimer = setInterval(() => {

View File

@ -38,6 +38,7 @@
:topicList="KeyNodeOneStore.tooltipList" :topicList="KeyNodeOneStore.tooltipList"
@click:hotTopic="handleGotTopicDialog" @click:hotTopic="handleGotTopicDialog"
@over:hotTopic="handleMouseOver" @over:hotTopic="handleMouseOver"
@click:refresh="handleRefreshTopic"
@auto:currentTopList="handleCurrentTopList" @auto:currentTopList="handleCurrentTopList"
></AttentionTopic> ></AttentionTopic>
</div> </div>
@ -246,6 +247,9 @@ const currentSelectedAnchorItem = ref(null)
// //
const currentTopicList = ref([]) const currentTopicList = ref([])
//
const isRefresh = ref(false)
//tabs //tabs
const filterShowUserList = computed(() => { const filterShowUserList = computed(() => {
if (KeyNodeOneStore.currentTabType == "全部") { if (KeyNodeOneStore.currentTabType == "全部") {
@ -325,8 +329,12 @@ const handleCurrentTopList = (list) => {
const handleMouseOver = (topic) => { const handleMouseOver = (topic) => {
currentTopic.value = topic currentTopic.value = topic
} }
const handleRefreshTopic = (flag) => {
isRefresh.value = flag
}
provide("currentTopicList", currentTopicList) provide("currentTopicList", currentTopicList)
provide("currentTopic", currentTopic) provide("currentTopic", currentTopic)
provide("refresh", isRefresh)
let hotChartInstance = null let hotChartInstance = null
const renderHotChart = () => { const renderHotChart = () => {