From a39689ed42ac6ec6b52d4a9f14a1cbaac5afc0c5 Mon Sep 17 00:00:00 2001 From: anghunk Date: Mon, 9 Feb 2026 17:48:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(StatsView):=20=E4=BF=AE=E5=A4=8D=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E9=A5=BC=E5=9B=BE=E5=AE=B9=E5=99=A8=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E6=9C=AA=E9=87=8D=E6=96=B0=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当域名统计饼图的DOM容器发生变化时,原先的图表实例会继续使用旧的容器导致渲染异常。现在检测到容器变化时,先销毁旧实例再重新初始化,确保图表正确渲染。 --- cwd-admin/src/views/StatsView/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cwd-admin/src/views/StatsView/index.vue b/cwd-admin/src/views/StatsView/index.vue index 77db3d9..a8b43ca 100644 --- a/cwd-admin/src/views/StatsView/index.vue +++ b/cwd-admin/src/views/StatsView/index.vue @@ -273,6 +273,9 @@ function renderDomainPieChart() { } if (!domainPieChartInstance) { domainPieChartInstance = echarts.init(el); + } else if (domainPieChartInstance.getDom() !== el) { + domainPieChartInstance.dispose(); + domainPieChartInstance = echarts.init(el); } if (!domainStats.value.length) { domainPieChartInstance.clear();