2025-07-17 10:28:56 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div v-if="store.isDetailsModalVisible" class="modal-overlay" @click="store.closeDetailsModal">
|
|
|
|
|
|
<div class="modal-content" @click.stop>
|
2025-07-22 17:40:11 +08:00
|
|
|
|
<img class="model-title" src="@/assets/images/head/event_leiji_hotmap_title.png" alt="">
|
2025-07-17 10:28:56 +08:00
|
|
|
|
<button class="close-btn" @click="store.closeDetailsModal">×</button>
|
|
|
|
|
|
<div ref="detailsChartRef" class="details-chart-container"></div>
|
2025-07-22 17:40:11 +08:00
|
|
|
|
<img class="model-bottom-icon" src="@/assets/images/icon/dialog_bottom_icon.png" alt="">
|
2025-07-17 10:28:56 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { ref, watch, onUnmounted, nextTick } from 'vue';
|
|
|
|
|
|
import { useKeyNodeStore2 } from '@/store/keyNodeStore2';
|
|
|
|
|
|
import * as echarts from 'echarts/core';
|
|
|
|
|
|
import { SVGRenderer } from 'echarts/renderers';
|
|
|
|
|
|
import { LineChart } from 'echarts/charts';
|
|
|
|
|
|
import { GridComponent, TooltipComponent } from 'echarts/components';
|
|
|
|
|
|
|
|
|
|
|
|
echarts.use([SVGRenderer, LineChart, GridComponent, TooltipComponent]);
|
|
|
|
|
|
|
|
|
|
|
|
const store = useKeyNodeStore2();
|
|
|
|
|
|
const detailsChartRef = ref(null);
|
|
|
|
|
|
let myChart = null;
|
|
|
|
|
|
|
|
|
|
|
|
watch(() => store.isDetailsModalVisible, async (isVisible) => {
|
|
|
|
|
|
if (isVisible && store.detailsModalChartConfig) {
|
|
|
|
|
|
await nextTick();
|
|
|
|
|
|
if (detailsChartRef.value) {
|
|
|
|
|
|
myChart = echarts.init(detailsChartRef.value);
|
2025-07-22 17:40:11 +08:00
|
|
|
|
const option = {
|
|
|
|
|
|
...store.detailsModalChartConfig.option
|
|
|
|
|
|
}
|
|
|
|
|
|
if(option.yAxis) {
|
|
|
|
|
|
const yAxis = Array.isArray(option.yAxis) ? option.yAxis[0] : option.yAxis;
|
|
|
|
|
|
yAxis.name = '数量';
|
|
|
|
|
|
yAxis.nameLocation = 'end'; // 显示在y轴最上方
|
|
|
|
|
|
yAxis.nameTextStyle = {
|
|
|
|
|
|
color: '#a7c5d4',
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
padding: [0, 0, 0, -68] // 调整位置,避免与坐标轴重叠
|
|
|
|
|
|
};
|
|
|
|
|
|
if(Array.isArray(option.yAxis)) {
|
|
|
|
|
|
option.yAxis[0] = yAxis;
|
|
|
|
|
|
}else {
|
|
|
|
|
|
option.yAxis = yAxis;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 添加以下代码将实心圆点改为空心圆点
|
|
|
|
|
|
/* if(option.series && Array.isArray(option.series)) {
|
|
|
|
|
|
option.series.forEach(series => {
|
|
|
|
|
|
if(series.itemStyle) {
|
|
|
|
|
|
series.itemStyle.color = 'transparent'; // 设置内部透明
|
|
|
|
|
|
// 确保边框颜色和宽度
|
|
|
|
|
|
if(!series.itemStyle.borderColor) series.itemStyle.borderColor = '#45B8FD';
|
|
|
|
|
|
if(!series.itemStyle.borderWidth) series.itemStyle.borderWidth = 2;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
series.itemStyle = {
|
|
|
|
|
|
color: 'transparent',
|
|
|
|
|
|
borderColor: '#00baff',
|
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} */
|
|
|
|
|
|
myChart.setOption(option);
|
|
|
|
|
|
// myChart.setOption(store.detailsModalChartConfig.option);
|
2025-07-17 10:28:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else if (!isVisible && myChart) {
|
|
|
|
|
|
myChart.dispose();
|
|
|
|
|
|
myChart = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
|
if (myChart) {
|
|
|
|
|
|
myChart.dispose();
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.modal-overlay {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
2025-07-22 17:40:11 +08:00
|
|
|
|
border-radius: 2px;
|
2025-07-17 10:28:56 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
|
}
|
|
|
|
|
|
.modal-content {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
background-color: #0d1b38;
|
|
|
|
|
|
padding: 20px;
|
2025-07-22 17:40:11 +08:00
|
|
|
|
border-radius: 2px;
|
2025-07-17 10:28:56 +08:00
|
|
|
|
border: 1px solid #3a95ff;
|
|
|
|
|
|
box-shadow: 0 0 25px rgba(58, 149, 255, 0.5);
|
|
|
|
|
|
width: 50vw;
|
|
|
|
|
|
height: 45vh;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
2025-07-22 17:40:11 +08:00
|
|
|
|
.modal-content .model-title {
|
|
|
|
|
|
margin-top: -28px;
|
|
|
|
|
|
margin-left: -21px;
|
|
|
|
|
|
width: 30%;
|
|
|
|
|
|
height: 15%;
|
|
|
|
|
|
}
|
2025-07-17 10:28:56 +08:00
|
|
|
|
.close-btn {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
height: 20px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
top: 10px;
|
|
|
|
|
|
right: 15px;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
color: #a7c5d4;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.details-chart-container {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
|
}
|
2025-07-22 17:40:11 +08:00
|
|
|
|
.modal-content .model-bottom-icon {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: -12px;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
width: 6%;
|
|
|
|
|
|
height: 6%;
|
|
|
|
|
|
}
|
2025-07-17 10:28:56 +08:00
|
|
|
|
</style>
|