From 99b24c107cf5e78d4167a446a5f74161cb576d56 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 14 Dec 2024 20:44:58 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91IoT=EF=BC=9A=E8=AE=BE=E5=A4=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9E=9A=E4=B8=BE=E5=8F=8A=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/index.ts | 8 +++++ src/views/iot/device/device/index.vue | 47 ++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts index a483484d..c618bb19 100644 --- a/src/api/iot/device/index.ts +++ b/src/api/iot/device/index.ts @@ -55,6 +55,14 @@ export interface DeviceHistoryDataVO { data: string // 数据 } +// IoT 设备状态枚举 +export enum DeviceStatusEnum { + INACTIVE = 0, // 未激活 + ONLINE = 1, // 在线 + OFFLINE = 2, // 离线 + DISABLED = 3 // 已禁用 +} + // 设备 API export const DeviceApi = { // 查询设备分页 diff --git a/src/views/iot/device/device/index.vue b/src/views/iot/device/device/index.vue index bcc2df21..f4a3702f 100644 --- a/src/views/iot/device/device/index.vue +++ b/src/views/iot/device/device/index.vue @@ -150,14 +150,45 @@ \ No newline at end of file diff --git a/src/views/iot/plugininfo/detail.vue b/src/views/iot/plugininfo/detail.vue new file mode 100644 index 00000000..2f3f02f9 --- /dev/null +++ b/src/views/iot/plugininfo/detail.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/views/iot/plugininfo/index.vue b/src/views/iot/plugininfo/index.vue new file mode 100644 index 00000000..5591cef4 --- /dev/null +++ b/src/views/iot/plugininfo/index.vue @@ -0,0 +1,257 @@ + + + \ No newline at end of file From a5565bb509e71cac5ad892ae8b94137999483fab Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 15 Dec 2024 10:46:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91IoT=EF=BC=9A=E8=AE=BE=E5=A4=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/device/index.ts | 7 +- .../iot/device/device/DeviceImportForm.vue | 139 ++++++++++++++++++ src/views/iot/device/device/index.vue | 16 +- 3 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 src/views/iot/device/device/DeviceImportForm.vue diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index c618bb19..ec80bfab 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -123,7 +123,7 @@ export const DeviceApi = { return await request.get({ url: `/iot/device/simple-list?`, params: { deviceType } }) }, - // 获取设备属性最新数据 + // 获取设备属性最���数据 getDevicePropertiesLatestData: async (params: any) => { return await request.get({ url: `/iot/device/data/latest`, params }) }, @@ -131,5 +131,10 @@ export const DeviceApi = { // 获取设备属性历史数据 getDevicePropertiesHistoryData: async (params: any) => { return await request.get({ url: `/iot/device/data/history`, params }) + }, + + // 获取导入模板 + importDeviceTemplate: async () => { + return await request.download({ url: `/iot/device/get-import-template` }) } } diff --git a/src/views/iot/device/device/DeviceImportForm.vue b/src/views/iot/device/device/DeviceImportForm.vue new file mode 100644 index 00000000..a6412f6a --- /dev/null +++ b/src/views/iot/device/device/DeviceImportForm.vue @@ -0,0 +1,139 @@ + + + diff --git a/src/views/iot/device/device/index.vue b/src/views/iot/device/device/index.vue index 9e7d53eb..8525d674 100644 --- a/src/views/iot/device/device/index.vue +++ b/src/views/iot/device/device/index.vue @@ -123,6 +123,9 @@ > 导出 + + 导入 + + +