From fdfd5d0b943b5735adc2367996243591f0cf8e61 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Tue, 23 Apr 2024 15:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E4=BE=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/web/js/main.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pages/web/js/main.js b/pages/web/js/main.js index ba0f3d1..eed0ec6 100644 --- a/pages/web/js/main.js +++ b/pages/web/js/main.js @@ -1323,21 +1323,24 @@ function initResourceRate() { dataNum: 50, dataNumColor: 'rgba(251,221,45,0.8)', dashboardBgc: 'rgba(254,249,209,0.2)', - dashboardColor: 'rgba(251,221,45,0.8)' + dashboardColor: 'rgba(251,221,45,0.8)', + isRate:true }, { dataTitle: '设备使用率', dataNum: 25, dataNumColor: 'rgba(1,194,255,0.8)', dashboardBgc: 'rgba(45,153,139,0.2)', - dashboardColor: 'rgba(1,194,255,0.8)' + dashboardColor: 'rgba(1,194,255,0.8)', + isRate:true }, { dataTitle: '能源使用率', dataNum: 15, dataNumColor: 'rgba(1,255,193,0.8)', dashboardBgc: 'rgba(45,153,139,0.2)', - dashboardColor: 'rgba(1,255,193,0.8)' + dashboardColor: 'rgba(1,255,193,0.8)', + isRate:false }, ] loader.get(url, null, function (res) { @@ -1416,8 +1419,11 @@ function getResourceChartOption(config) { offsetCenter: [0, '-25%'], valueAnimation: true, formatter: function (value) { - // return '{value|' + value + '}{unit|%}'; - return '{value|' + value + '}'; + if(config.isRate){ + return '{value|' + value + '}{unit|%}'; + }else{ + return '{value|' + value + '}'; + } }, rich: { value: {