diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts index 57d66e99..d49db614 100644 --- a/src/api/iot/device/device/index.ts +++ b/src/api/iot/device/device/index.ts @@ -10,10 +10,9 @@ export interface DeviceVO { deviceType: number // 设备类型 nickname: string // 设备备注名称 gatewayId: number // 网关设备 ID - status: number // 设备状态 - statusLastUpdateTime: Date // 设备状态最后更新时间 - lastOnlineTime: Date // 最后上线时间 - lastOfflineTime: Date // 最后离线时间 + state: number // 设备状态 + onlineTime: Date // 最后上线时间 + offlineTime: Date // 最后离线时间 activeTime: Date // 设备激活时间 createTime: Date // 创建时间 ip: string // 设备的 IP 地址 @@ -31,11 +30,6 @@ export interface DeviceVO { groupIds?: number[] // 添加分组 ID } -export interface DeviceUpdateStatusVO { - id: number // 设备 ID,主键,自增 - status: number // 设备状态 -} - // IoT 设备数据 VO export interface DeviceDataVO { deviceId: number // 设备编号 @@ -93,11 +87,6 @@ export const DeviceApi = { return await request.put({ url: `/iot/device/update`, data }) }, - // 修改设备状态 - updateDeviceStatus: async (data: DeviceUpdateStatusVO) => { - return await request.put({ url: `/iot/device/update-status`, data }) - }, - // 修改设备分组 updateDeviceGroup: async (data: { ids: number[]; groupIds: number[] }) => { return await request.put({ url: `/iot/device/update-group`, data }) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index db8b9d9f..91000e15 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -1,8 +1,8 @@ /** * 数据字典工具类 */ -import {useDictStoreWithOut} from '@/store/modules/dict' -import {ElementPlusInfoType} from '@/types/elementPlus' +import { useDictStoreWithOut } from '@/store/modules/dict' +import { ElementPlusInfoType } from '@/types/elementPlus' const dictStore = useDictStoreWithOut() @@ -235,7 +235,7 @@ export enum DICT_TYPE { IOT_PRODUCT_DEVICE_TYPE = 'iot_product_device_type', // IOT 产品设备类型 IOT_DATA_FORMAT = 'iot_data_format', // IOT 数据格式 IOT_PROTOCOL_TYPE = 'iot_protocol_type', // IOT 接入网关协议 - IOT_DEVICE_STATUS = 'iot_device_status', // IOT 设备状态 + IOT_DEVICE_STATE = 'iot_device_state', // IOT 设备状态 IOT_THING_MODEL_TYPE = 'iot_thing_model_type', // IOT 产品功能类型 IOT_DATA_TYPE = 'iot_data_type', // IOT 数据类型 IOT_THING_MODEL_UNIT = 'iot_thing_model_unit', // IOT 物模型单位 diff --git a/src/views/iot/device/device/detail/DeviceDetailsInfo.vue b/src/views/iot/device/device/detail/DeviceDetailsInfo.vue index b34fde5b..a6894286 100644 --- a/src/views/iot/device/device/detail/DeviceDetailsInfo.vue +++ b/src/views/iot/device/device/detail/DeviceDetailsInfo.vue @@ -23,13 +23,13 @@ {{ formatDate(device.activeTime) }} - {{ formatDate(device.lastOnlineTime) }} + {{ formatDate(device.onlineTime) }} - + - {{ formatDate(device.lastOfflineTime) }} + {{ formatDate(device.offlineTime) }} 查看 diff --git a/src/views/iot/device/device/index.vue b/src/views/iot/device/device/index.vue index de4d37c9..a92e7015 100644 --- a/src/views/iot/device/device/index.vue +++ b/src/views/iot/device/device/index.vue @@ -64,7 +64,7 @@ class="!w-240px" > - {{ getDictLabel(DICT_TYPE.IOT_DEVICE_STATUS, item.status) }} + {{ getDictLabel(DICT_TYPE.IOT_DEVICE_STATE, item.state) }} @@ -199,9 +199,9 @@
所属产品 - {{ - products.find((p) => p.id === item.productId)?.name - }} + + {{ products.find((p) => p.id === item.productId)?.name }} +
设备类型 @@ -209,7 +209,9 @@
DeviceKey - + {{ item.deviceKey }}
@@ -306,13 +308,13 @@