From 1e0e3a89cf97567d152e859842b73f74c21f9b67 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 1 Apr 2024 16:41:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9C=8B=E6=9D=BF=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=B8=BAnull=E7=BC=96=E8=AF=91=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E4=B8=8D=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/overview/components/NeResources/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/dashboard/overview/components/NeResources/index.vue b/src/views/dashboard/overview/components/NeResources/index.vue index 03fca534..07b2f34c 100644 --- a/src/views/dashboard/overview/components/NeResources/index.vue +++ b/src/views/dashboard/overview/components/NeResources/index.vue @@ -98,7 +98,7 @@ const optionData: EChartsOption = { itemStyle: { color: function (params) { // 红色 - if (+params.value >= 70) { + if (params.value && +params.value >= 70) { return new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0, color: '#fff1f0' }, { offset: 0.5, color: '#ffa39e' }, @@ -106,7 +106,7 @@ const optionData: EChartsOption = { ]); } // 蓝色 - if (+params.value >= 30) { + if (params.value && +params.value >= 30) { return new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0, color: '#f0f5ff' }, { offset: 0.5, color: '#adc6ff' }, @@ -161,9 +161,9 @@ const optionData: EChartsOption = { label: { formatter: params => { var text = `{a| ${params.value}%} `; - if (+params.value >= 70) { + if (params.value && +params.value >= 70) { text = `{c| ${params.value}%} `; - } else if (+params.value >= 30) { + } else if (params.value && +params.value >= 30) { text = `{b| ${params.value}%} `; } return text;