From 600fe8bf85e8a46b944618794e6e0d69280d6008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Wed, 15 May 2024 17:59:36 +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 --- .../ArrayTemperatureData.html | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) 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 e05bb77..094b2d9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/ArrayTemperatureData/ArrayTemperatureData.html +++ b/ruoyi-admin/src/main/resources/templates/system/ArrayTemperatureData/ArrayTemperatureData.html @@ -120,10 +120,35 @@ const color = colors[i - 1]; // 获取当前颜色 const x = ((i - 1) % 32) * gridWidth; // 计算x坐标 const y = Math.floor((i - 1) / 32) * gridHeight; // 计算y坐标 + + // 绘制格子 ctx.fillStyle = color; // 设置填充颜色为十六进制颜色值 ctx.fillRect(x, y, gridWidth, gridHeight); // 绘制矩形格子 } + for (let i = 1; i <= 768; i++) { + const x = ((i - 1) % 32) * gridWidth; // 计算x坐标 + const y = Math.floor((i - 1) / 32) * gridHeight; // 计算y坐标 + + if (Math.min(...tems) === e.rows[0]['site' + i]) { + ctx.font = '12px Arial'; + ctx.fillStyle = 'blue'; + ctx.fillText('I', x + gridWidth / 2 - 6, y + gridHeight / 2 + 6); + ctx.strokeStyle = 'blue'; + ctx.lineWidth = 1; + ctx.strokeText('I', x + gridWidth / 2 - 6, y + gridHeight / 2 + 6); + } + + if (Math.max(...tems) === e.rows[0]['site' + i]) { + ctx.font = '12px Arial'; + ctx.fillStyle = '#fff'; + ctx.fillText('A', x + gridWidth / 2 - 6, y + gridHeight / 2 + 6); + ctx.strokeStyle = '#fff'; + ctx.lineWidth = 1; + ctx.strokeText('A', x + gridWidth / 2 - 6, y + gridHeight / 2 + 6); + } + + } }) }