From 1990da924ba45aba7057fb7efc0ca76e00bf4752 Mon Sep 17 00:00:00 2001 From: huangchengfa <171504222@qq.com> Date: Thu, 11 Dec 2025 15:00:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=81=BF=E5=85=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../centerHome/components/WarningCount.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/views/backOfficeSystem/fourColorManage/warningControl/centerHome/components/WarningCount.vue b/src/views/backOfficeSystem/fourColorManage/warningControl/centerHome/components/WarningCount.vue index 51c4527..6872e01 100644 --- a/src/views/backOfficeSystem/fourColorManage/warningControl/centerHome/components/WarningCount.vue +++ b/src/views/backOfficeSystem/fourColorManage/warningControl/centerHome/components/WarningCount.vue @@ -45,6 +45,7 @@ const initCharts = (data) => { }, ]; data.forEach(item => { + item.count = isNaN(Number(item?.count) || 0) ? 0 : item.count; if (item.yj_jb == '10') countData[0].value = item.count; if (item.yj_jb == '20') countData[1].value = item.count; if (item.yj_jb == '30') countData[2].value = item.count; @@ -94,12 +95,12 @@ const createChartOption = (data, colors) => { }, } }, - formatter: (name) => { -const item = data.find(d => d.name === name); -let percentage = ((item.value / total) * 100).toFixed(2); -return `${name} ${item.value} {${item.colorType}|(${percentage}%)}` + formatter: (name) => { + const item = data.find(d => d.name === name); + let percentage = ((item.value / total) * 100).toFixed(2); + return `${name} ${item.value} {${item.colorType}|(${percentage}%)}` -} + } }, series: [ {