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');