From 67f7a1e2190d896f40a59aa76faf149694d085cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 16 May 2024 09:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/ArrayTemperatureData/ArrayTemperatureData.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/ArrayTemperatureData/ArrayTemperatureData.html b/ruoyi-admin/src/main/resources/templates/system/ArrayTemperatureData/ArrayTemperatureData.html index 975376f..8a59948 100644 --- a/ruoyi-admin/src/main/resources/templates/system/ArrayTemperatureData/ArrayTemperatureData.html +++ b/ruoyi-admin/src/main/resources/templates/system/ArrayTemperatureData/ArrayTemperatureData.html @@ -119,13 +119,13 @@ } const getData = () => { $.post(prefix + '/newDataStreak', {monitorId}, (e) => { - $('#temInfo').html(`最高温度:${e.rows[0].maxTemperature}℃ 最低温度:${e.rows[0].minTemperature}℃ 平均温度:${e.rows[0].avgTemperature}℃`) - $('#timeInfo').html(`采集时间:${e.rows[0].collectTime} `) + $('#temInfo').html(`最高温度:${e.rows?.[0]?.maxTemperature || ''}℃ 最低温度:${e.rows?.[0]?.minTemperature || ''}℃ 平均温度:${e.rows?.[0]?.avgTemperature || ''}℃`) + $('#timeInfo').html(`采集时间:${e.rows?.[0]?.collectTime || ''} `) let colors = [] let tems = [] for (i in e.rows[0]) { if (i.includes('site')) { - tems.push(e.rows[0][i]) + tems.push(e?.rows?.[0]?.[i]) } } let sum = Math.max(...tems) - Math.min(...tems) @@ -136,7 +136,7 @@ } for (let i = 1; i <= 768; i++) { - colors.push(getColorByTemperature[e.rows[0]['site' + i]]) + colors.push(getColorByTemperature[e?.rows?.[0]?.['site' + i]]) } const canvas = document.getElementById('canvas');