|
|
@@ -5,6 +5,7 @@ import { useThemeStore } from '@/stores/modules/theme'
|
|
|
import { onMounted, ref, reactive, watch, computed } from 'vue'
|
|
|
import * as XLSX from 'xlsx'
|
|
|
import { formatNumber } from '@/utils/tools'
|
|
|
+import { on } from 'events'
|
|
|
|
|
|
const themeStore = useThemeStore()
|
|
|
const props = defineProps({
|
|
|
@@ -355,7 +356,7 @@ onMounted(() => {
|
|
|
|
|
|
const revenueChart = ref()
|
|
|
const initChart = () => {
|
|
|
- revenueChart.value = echarts.init(bar_ref.value)
|
|
|
+ revenueChart.value = markRaw(echarts.init(bar_ref.value))
|
|
|
//图表响应式
|
|
|
window.addEventListener('resize', () => {
|
|
|
revenueChart.value.resize()
|
|
|
@@ -408,6 +409,13 @@ const initChart = () => {
|
|
|
revenueChart.value.setOption(initOption)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ window.removeEventListener('resize', () => {
|
|
|
+ revenueChart.value.resize()
|
|
|
+ })
|
|
|
+ revenueChart.value?.dispose()
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<template>
|