From 3dc7d2000547ba1e0cf2c5b91175ef6e31381e1f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 9 Jan 2025 12:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E8=AE=BE=E5=A4=87=E6=97=A5=E5=BF=97=20TDe?= =?UTF-8?q?ngine=20=E8=A1=A8=E4=B8=8E=E6=A8=A1=E6=8B=9F=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/device/index.ts | 18 +++++++++--------- src/api/iot/thingmodel/index.ts | 3 ++- .../device/device/detail/DeviceDetailsLog.vue | 12 +++++++----- .../device/detail/DeviceDetailsSimulator.vue | 17 ++++++++++++----- src/views/iot/device/device/detail/index.vue | 12 +++++++++--- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index b489a04f..fae8100a 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -58,19 +58,20 @@ export interface DeviceHistoryDataVO { // IoT 设备状态枚举 export enum DeviceStatusEnum { INACTIVE = 0, // 未激活 - ONLINE = 1, // 在线 - OFFLINE = 2, // 离线 - DISABLED = 3 // 已禁用 + ONLINE = 1, // 在线 + OFFLINE = 2, // 离线 + DISABLED = 3 // 已禁用 } // IoT 模拟设备数据 +// TODO @super:DeviceSimulatorDataReqVO export interface SimulatorDataVO { productKey: string deviceKey: string type: string subType: string reportTime: number // 时间戳 - content: string // 存储 JSON 字符串 + content: string // 存储 JSON 字符串 } // 设备 API @@ -101,10 +102,7 @@ export const DeviceApi = { }, // 修改设备分组 - updateDeviceGroup: async (data: { - ids: number[] - groupIds: number[] - }) => { + updateDeviceGroup: async (data: { ids: number[]; groupIds: number[] }) => { return await request.put({ url: `/iot/device/update-group`, data }) }, @@ -150,10 +148,12 @@ export const DeviceApi = { // 模拟设备 simulatorDevice: async (data: SimulatorDataVO) => { + // TODO @super:/iot/device/simulator return await request.post({ url: `/iot/device/data/simulator`, data }) }, - //查询设备日志分页 + // 查询设备日志分页 getDeviceLogPage: async (params: any) => { + // TODO @super:/iot/log-page 或者 /iot/log/page return await request.get({ url: `/iot/device/data/log/page`, params }) } } diff --git a/src/api/iot/thingmodel/index.ts b/src/api/iot/thingmodel/index.ts index 0c3ccdb4..5deaaad5 100644 --- a/src/api/iot/thingmodel/index.ts +++ b/src/api/iot/thingmodel/index.ts @@ -20,8 +20,9 @@ export interface ThingModelData { /** * IoT 模拟设备 */ +// TODO @super:和 ThingModelSimulatorData 会不会好点 export interface SimulatorData extends ThingModelData { - simulateValue?: string | number // 用于存储模拟值 + simulateValue?: string | number // 用于存储模拟值 TODO @super:字段使用 value 会不会好点 } /** diff --git a/src/views/iot/device/device/detail/DeviceDetailsLog.vue b/src/views/iot/device/device/detail/DeviceDetailsLog.vue index e703ca4f..2ffcd5de 100644 --- a/src/views/iot/device/device/detail/DeviceDetailsLog.vue +++ b/src/views/iot/device/device/detail/DeviceDetailsLog.vue @@ -5,6 +5,7 @@ + @@ -48,7 +49,6 @@ diff --git a/src/views/iot/device/device/detail/index.vue b/src/views/iot/device/device/detail/index.vue index 8e342590..1c7e7c45 100644 --- a/src/views/iot/device/device/detail/index.vue +++ b/src/views/iot/device/device/detail/index.vue @@ -17,11 +17,16 @@ - + + - - + + @@ -34,6 +39,7 @@ import DeviceDetailsInfo from './DeviceDetailsInfo.vue' import DeviceDetailsModel from './DeviceDetailsModel.vue' import DeviceDetailsLog from './DeviceDetailsLog.vue' import DeviceDetailsSimulator from './DeviceDetailsSimulator.vue' + defineOptions({ name: 'IoTDeviceDetail' }) const route = useRoute()