From 5243f5849f06d5aaead38de3c5917926d68a93dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com>
Date: Tue, 5 Nov 2024 23:25:47 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E3=80=91IOT=EF=BC=9A=E8=AE=BE=E5=A4=87=E5=8E=86=E5=8F=B2?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iot/device/index.ts | 11 ++
.../iot/device/detail/DeviceDataDetail.vue | 107 ++++++++++++++++--
2 files changed, 109 insertions(+), 9 deletions(-)
diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts
index 9bc82c4f..5f788ec9 100644
--- a/src/api/iot/device/index.ts
+++ b/src/api/iot/device/index.ts
@@ -48,6 +48,12 @@ export interface DeviceDataVO {
value: string // 最新值
}
+// IoT 设备数据 VO
+export interface DeviceHistoryDataVO {
+ time: number // 时间
+ data: string // 数据
+}
+
// 设备 API
export const DeviceApi = {
// 查询设备分页
@@ -88,5 +94,10 @@ export const DeviceApi = {
// 获取设备属性最新数据
getDevicePropertiesLatestData: async (params: any) => {
return await request.get({ url: `/iot/device/data/latest-data`, params })
+ },
+
+ // 获取设备属性历史数据
+ getDevicePropertiesHistoryData: async (params: any) => {
+ return await request.get({ url: `/iot/device/data/history-data`, params })
}
}
diff --git a/src/views/iot/device/detail/DeviceDataDetail.vue b/src/views/iot/device/detail/DeviceDataDetail.vue
index b4df6484..b4a25800 100644
--- a/src/views/iot/device/detail/DeviceDataDetail.vue
+++ b/src/views/iot/device/detail/DeviceDataDetail.vue
@@ -1,28 +1,117 @@