From 9d0e7bb4aa336b17cf5d58eaadc67d4d9600d3e2 Mon Sep 17 00:00:00 2001 From: guoyue Date: Mon, 18 Jul 2022 14:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=EF=BC=9Aecharts?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/workBench/components/dept-chart-view.vue | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/back/src/views/modules/workBench/components/dept-chart-view.vue b/back/src/views/modules/workBench/components/dept-chart-view.vue index 79291918..e7a95a2e 100644 --- a/back/src/views/modules/workBench/components/dept-chart-view.vue +++ b/back/src/views/modules/workBench/components/dept-chart-view.vue @@ -42,12 +42,7 @@ export default { handler(newVal, oldVal) { if (newVal) { this.dataListCopy = newVal; - if (document.getElementById(this.id)) { - // 解决数据初始渲染不出来的问题 - setTimeout(() => { - this.initChart() - }, 2000) - } + this.initChart() } }, deep: true, @@ -55,9 +50,6 @@ export default { }, }, mounted() { - setTimeout(() => { - this.initChart() - }, 2000) }, methods: { initChart() { @@ -68,7 +60,6 @@ export default { this.myChart = chartDom && echarts.init(chartDom); let lengendArr = this.dataListCopy.filter(v => v.name); - let total = 0; this.dataListCopy.map(v => { if (v.value || v.value === 0) {