diff --git a/src/views/charts2/charts/dnsInsight/DnsEventChartByBar.vue b/src/views/charts2/charts/dnsInsight/DnsEventChartByBar.vue index d92efcc5..d03d0913 100644 --- a/src/views/charts2/charts/dnsInsight/DnsEventChartByBar.vue +++ b/src/views/charts2/charts/dnsInsight/DnsEventChartByBar.vue @@ -95,6 +95,9 @@ export default { }, beforeUnmount () { window.removeEventListener('resize', this.resize) + if (this.myChart) { + echarts.dispose(this.myChart) + } } } diff --git a/src/views/charts2/charts/dnsInsight/DnsEventChartByPie.vue b/src/views/charts2/charts/dnsInsight/DnsEventChartByPie.vue index 4aca060b..da46039c 100644 --- a/src/views/charts2/charts/dnsInsight/DnsEventChartByPie.vue +++ b/src/views/charts2/charts/dnsInsight/DnsEventChartByPie.vue @@ -147,6 +147,9 @@ export default { }, beforeUnmount () { window.removeEventListener('resize', this.resize) + if (this.myChart) { + echarts.dispose(this.myChart) + } } } diff --git a/src/views/charts2/charts/dnsInsight/DnsTrafficLine.vue b/src/views/charts2/charts/dnsInsight/DnsTrafficLine.vue index d3170d55..cd1319f4 100644 --- a/src/views/charts2/charts/dnsInsight/DnsTrafficLine.vue +++ b/src/views/charts2/charts/dnsInsight/DnsTrafficLine.vue @@ -567,7 +567,9 @@ export default { beforeUnmount () { clearTimeout(this.timer) window.removeEventListener('resize', this.resize) - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } this.chartOption = null this.unitConvert = null } diff --git a/src/views/charts2/charts/linkMonitor/LinkTrafficLine.vue b/src/views/charts2/charts/linkMonitor/LinkTrafficLine.vue index 67d9314c..69a930d0 100644 --- a/src/views/charts2/charts/linkMonitor/LinkTrafficLine.vue +++ b/src/views/charts2/charts/linkMonitor/LinkTrafficLine.vue @@ -456,7 +456,9 @@ export default { beforeUnmount () { clearTimeout(this.timer) window.removeEventListener('resize', this.resize) - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } this.chartOption = null this.unitConvert = null } diff --git a/src/views/charts2/charts/networkOverview/NetworkOverviewApps.vue b/src/views/charts2/charts/networkOverview/NetworkOverviewApps.vue index 0a5b468b..3b84f484 100644 --- a/src/views/charts2/charts/networkOverview/NetworkOverviewApps.vue +++ b/src/views/charts2/charts/networkOverview/NetworkOverviewApps.vue @@ -734,7 +734,9 @@ export default { window.removeEventListener('resize', this.resize) clearTimeout(this.timerScroll) clearTimeout(this.timerSearch) - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } this.unitConvert = null } } diff --git a/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue b/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue index 28971666..63b2dac9 100644 --- a/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue +++ b/src/views/charts2/charts/networkOverview/NetworkOverviewLine.vue @@ -703,7 +703,9 @@ export default { if (myChart) { echarts.dispose(myChart) } - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } // 检测时发现该方法占用较大内存,且未被释放 this.unitConvert = null myChart = null diff --git a/src/views/charts2/charts/networkOverview/NetworkOverviewPerformanceEvent.vue b/src/views/charts2/charts/networkOverview/NetworkOverviewPerformanceEvent.vue index 378dd35b..ac901a39 100644 --- a/src/views/charts2/charts/networkOverview/NetworkOverviewPerformanceEvent.vue +++ b/src/views/charts2/charts/networkOverview/NetworkOverviewPerformanceEvent.vue @@ -193,6 +193,14 @@ export default { beforeUnmount () { clearTimeout(this.timer) window.removeEventListener('resize', this.resize) + const dom = document.getElementById('chart1') + const dom2 = document.getElementById('chart2') + if (dom) { + echarts.dispose(dom) + } + if (dom2) { + echarts.dispose(dom2) + } this.myChart = null this.myChart2 = null } diff --git a/src/views/charts2/charts/npm/NpmEventsByType.vue b/src/views/charts2/charts/npm/NpmEventsByType.vue index 8c9b04d4..5b9a62e6 100644 --- a/src/views/charts2/charts/npm/NpmEventsByType.vue +++ b/src/views/charts2/charts/npm/NpmEventsByType.vue @@ -152,7 +152,9 @@ export default { }, beforeUnmount () { window.removeEventListener('resize', this.resize) - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } this.chartOption = null } } diff --git a/src/views/charts2/charts/npm/NpmLine.vue b/src/views/charts2/charts/npm/NpmLine.vue index d06028dd..f29999ea 100644 --- a/src/views/charts2/charts/npm/NpmLine.vue +++ b/src/views/charts2/charts/npm/NpmLine.vue @@ -336,7 +336,9 @@ export default { beforeUnmount () { clearTimeout(this.timer) window.removeEventListener('resize', this.resize) - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } this.chartOption = null } } diff --git a/src/views/charts2/charts/npm/NpmTrafficLine.vue b/src/views/charts2/charts/npm/NpmTrafficLine.vue index 2f035943..fe799e40 100644 --- a/src/views/charts2/charts/npm/NpmTrafficLine.vue +++ b/src/views/charts2/charts/npm/NpmTrafficLine.vue @@ -633,8 +633,9 @@ export default { beforeUnmount () { clearTimeout(this.timer) window.removeEventListener('resize', this.resize) - this.myChart = null - this.myChart = null + if (this.myChart) { + echarts.dispose(this.myChart) + } this.unitConvert = null } }