From ad0c3917c62148845d4138ebd031afe7f07796f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 29 Jul 2022 10:45:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/js/board/month.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/js/board/month.js b/ruoyi-admin/src/main/resources/static/js/board/month.js index 0a3831f..a706499 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/month.js +++ b/ruoyi-admin/src/main/resources/static/js/board/month.js @@ -73,7 +73,7 @@ $(() => { $('#HighlightFour').attr("src" , `http://10.100.70.5:9090/${url[3]}`) let options = { navButton:false, - sideButtonL:false, + sideButton:false, effects: ['fade', 'slideX', 'slideY', 'page', 'circle', 'rollingX', 'rollingY', 'blindsX', 'blindsY'], data: [ { @@ -97,8 +97,18 @@ $(() => { lineChart(null, document.getElementById("quality")) }) autoUpdate(url + "/selectDtNenglist", INTERVAL, data => { - console.log(data) - lineChart(null, document.getElementById("energyConsumption"), '') + let month = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"] + let value = [] + for (let i = 1; i <= 12; i++) { + if(data[0][`month${i}`]){ + value.push(data[0][`month${i}`]) + } + } + lineChart({ + xName: month.splice(0,value.length), + yData: value, + yDataName: "能耗百分比" + }, document.getElementById("energyConsumption"), '') })