From a23c97c5130d17d7b4b1f296e8a637f881b0ea47 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Fri, 23 May 2025 18:02:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(iot):=20=E7=89=A9=E8=81=94=E7=BD=91?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增设备事件列表接口和相关组件 - 在设备详情页面添加事件标签页 - 优化设备运行状态和日志的展示样式 - 重构功能定义相关的组件,提高复用性 - 优化 JSON 数据的展示方式 --- src/api/iot/device.js | 9 + src/basedata/physicalModel.js | 20 ++ src/components/DialogTemplate/index.vue | 2 +- src/views/iot/device/profile/details.vue | 13 +- src/views/iot/device/profile/functionWrap.vue | 3 - src/views/iot/model/index.vue | 7 +- src/views/iot/modelScries/index.vue | 18 +- src/views/personal/device/profile/details.vue | 22 +- .../profile/DeviceDetailsView/deviceLog.vue | 44 ++- .../profile/DeviceDetailsView/eventLog.vue | 282 ++++++++++++++++++ src/views/profile/DeviceDetailsView/index.vue | 14 +- src/views/profile/attribute/attributeView.vue | 2 +- .../profile/attribute/eventFormModel.vue | 129 ++++++-- src/views/profile/attribute/eventView.vue | 3 +- .../profile/attribute/functionFormModel.vue | 239 ++++++++------- src/views/profile/attribute/functionView.vue | 83 +----- src/views/profile/attribute/groupView.vue | 4 +- src/views/profile/attribute/paramsJson.vue | 10 +- src/views/tenant/device/profile/details.vue | 14 +- 19 files changed, 679 insertions(+), 239 deletions(-) create mode 100644 src/basedata/physicalModel.js create mode 100644 src/views/profile/DeviceDetailsView/eventLog.vue diff --git a/src/api/iot/device.js b/src/api/iot/device.js index d5dd5f71..6890ebc2 100644 --- a/src/api/iot/device.js +++ b/src/api/iot/device.js @@ -80,6 +80,15 @@ export function listDeviceLogList(query) { }); } +// 获取设备事件列表 +export function listDeviceEventLogList(query) { + return request({ + url: "/iot/device/event-list", + method: "get", + params: query + }); +} + // 获取设备类型列表 export function getDeviceFunList(query) { return request({ diff --git a/src/basedata/physicalModel.js b/src/basedata/physicalModel.js new file mode 100644 index 00000000..70e3bbd4 --- /dev/null +++ b/src/basedata/physicalModel.js @@ -0,0 +1,20 @@ +export const dataTypeOption = { + int: 'int(整数型)', + long: 'long(长整数型)', + float: 'float(单精度浮点型)', + double: 'double(双精度浮点数)', + string: 'text(字符串)', + boolean: 'boolean(布尔型)', + date: 'date(时间型)', + enum: 'enum(枚举)', + array: 'array(数组)', + object: 'object(结构体)', + file: 'file(文件)', + password: 'password(密码)', + geoPoint: 'geoPoint(地理位置)', +}; +export const eventLevel = { + ordinary:'普通', + warn:'警告', + urgent:'紧急', +} diff --git a/src/components/DialogTemplate/index.vue b/src/components/DialogTemplate/index.vue index a7269638..abddb79f 100644 --- a/src/components/DialogTemplate/index.vue +++ b/src/components/DialogTemplate/index.vue @@ -1,6 +1,6 @@