From deecbb90a473b50f486adc38f54c08d90a61c2d0 Mon Sep 17 00:00:00 2001 From: zch Date: Mon, 26 May 2025 15:31:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A6=96=E9=A1=B5index):=20=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=AE=BE=E8=AE=A1=E9=A6=96=E9=A1=B5=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重新设计了首页布局,包括页面标题、统计卡片和设备监控数据展示 - 添加了设备监控数据的获取和展示功能,包括温度、湿度、噪声等传感器数据 - 实现了设备状态的判断和展示,包括正常、警告、异常和离线状态 - 优化了数据加载和刷新逻辑,支持自动刷新 -增加了异常数据过滤和提示功能 --- src/api/ems/record/recordIotenvInstant.js | 8 + src/views/index.vue | 619 +++++++++++++++++++--- 2 files changed, 555 insertions(+), 72 deletions(-) diff --git a/src/api/ems/record/recordIotenvInstant.js b/src/api/ems/record/recordIotenvInstant.js index 7e6b541..19ed368 100644 --- a/src/api/ems/record/recordIotenvInstant.js +++ b/src/api/ems/record/recordIotenvInstant.js @@ -51,3 +51,11 @@ export function getRecordIotenvInstantList(query) { params: query }) } + +// 获取所有设备的最新数据(用于首页展示) +export function getLatestRecords() { + return request({ + url: '/ems/record/recordIotenvInstant/getLatestRecords', + method: 'get' + }) +} diff --git a/src/views/index.vue b/src/views/index.vue index 1ea4896..0c726bc 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,100 +1,575 @@ - + - <!– 折线图部分 –> - - - + +
+
+
+
+ +
+
+
{{ totalDeviceCount }}
+
设备总数
+
+
+
+
-<!– –> -<!– –> -<!–
–> -<!– –> -<!–
–> -<!–
–> -<!– –> -<!–
–> -<!– –> -<!–
–> -<!–
–> -<!– –> -<!–
–> -<!– –> -<!–
–> -<!–
–> -<!–
–> + +
+
+

设备监控数据

+
+ + 刷新数据 + +
+
+ +
+
+ + +
+
+

{{ device.monitorName || '未知设备' }}

+ {{ device.monitorId }} +
+
+ + {{ getStatusText(device) }} +
+
+ + +
+
+
+ + 温度 + {{ formatValue(device.temperature, '°C') }} +
+
+ +
+
+ + 湿度 + {{ formatValue(device.humidity, '%') }} +
+
+ +
+
+ + 噪声 + {{ formatValue(device.noise, 'dB') }} +
+
+ +
+
+ + 照度 + {{ formatValue(device.illuminance, 'lx') }} +
+
+ +
+
+ + 硫化氢 + {{ formatValue(device.concentration, 'ppm') }} +
+
+ +
+
+ + 振动速度 + {{ formatValue(device.vibrationSpeed, 'mm/s') }} +
+
+ + +
+ + 无最新数据 +
+
+ + + +
+
+ + +
+ +

暂无设备数据

+
+
--->