diff --git a/src/api/iot/device/device/index.ts b/src/api/iot/device/device/index.ts
index 026525e4e..7a0ef6def 100644
--- a/src/api/iot/device/device/index.ts
+++ b/src/api/iot/device/device/index.ts
@@ -157,8 +157,8 @@ export const DeviceApi = {
},
// 查询设备日志分页
- getDeviceLogPage: async (params: any) => {
- return await request.get({ url: `/iot/device/log/page`, params })
+ getDeviceMessagePage: async (params: any) => {
+ return await request.get({ url: `/iot/device/message/page`, params })
},
// 获取设备 MQTT 连接参数
diff --git a/src/api/iot/plugin/index.ts b/src/api/iot/plugin/index.ts
deleted file mode 100644
index f68b5f941..000000000
--- a/src/api/iot/plugin/index.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import request from '@/config/axios'
-
-// IoT 插件配置 VO
-export interface PluginConfigVO {
- id: number // 主键ID
- pluginKey: string // 插件标识
- name: string // 插件名称
- description: string // 描述
- deployType: number // 部署方式
- fileName: string // 插件包文件名
- version: string // 插件版本
- type: number // 插件类型
- protocol: string // 设备插件协议类型
- status: number // 状态
- configSchema: string // 插件配置项描述信息
- config: string // 插件配置信息
- script: string // 插件脚本
-}
-
-// IoT 插件配置 API
-export const PluginConfigApi = {
- // 查询插件配置分页
- getPluginConfigPage: async (params: any) => {
- return await request.get({ url: `/iot/plugin-config/page`, params })
- },
-
- // 查询插件配置详情
- getPluginConfig: async (id: number) => {
- return await request.get({ url: `/iot/plugin-config/get?id=` + id })
- },
-
- // 新增插件配置
- createPluginConfig: async (data: PluginConfigVO) => {
- return await request.post({ url: `/iot/plugin-config/create`, data })
- },
-
- // 修改插件配置
- updatePluginConfig: async (data: PluginConfigVO) => {
- return await request.put({ url: `/iot/plugin-config/update`, data })
- },
-
- // 删除插件配置
- deletePluginConfig: async (id: number) => {
- return await request.delete({ url: `/iot/plugin-config/delete?id=` + id })
- },
-
- // 修改插件状态
- updatePluginStatus: async (data: any) => {
- return await request.put({ url: `/iot/plugin-config/update-status`, data })
- }
-}
diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
index b8828b538..39bbe0ae5 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -733,17 +733,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
activeMenu: '/iot/device/device'
},
component: () => import('@/views/iot/device/device/detail/index.vue')
- },
- {
- path: 'plugin/detail/:id',
- name: 'IoTPluginDetail',
- meta: {
- title: '插件详情',
- noCache: true,
- hidden: true,
- activeMenu: '/iot/plugin'
- },
- component: () => import('@/views/iot/plugin/detail/index.vue')
}
]
}
diff --git a/src/views/iot/device/device/detail/DeviceDetailsLog.vue b/src/views/iot/device/device/detail/DeviceDetailsLog.vue
deleted file mode 100644
index 8bbad4008..000000000
--- a/src/views/iot/device/device/detail/DeviceDetailsLog.vue
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
-
-
-
-
-
-
-
-
-
- {{ formatDate(scope.row.ts) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/iot/device/device/detail/DeviceDetailsMessage.vue b/src/views/iot/device/device/detail/DeviceDetailsMessage.vue
new file mode 100644
index 000000000..6abf6d627
--- /dev/null
+++ b/src/views/iot/device/device/detail/DeviceDetailsMessage.vue
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+
+
+ {{ formatDate(scope.row.ts) }}
+
+
+
+
+
+ {{ scope.row.upstream ? '上行' : '下行' }}
+
+
+
+
+
+
+
+
+
+
+ {{ methodOptions.find(item => item.value === scope.row.method)?.label }}
+
+
+
+
+
+ {{ `{"code":${scope.row.code},"msg":"${scope.row.msg}","data":${scope.row.data}\}` }}
+
+ {{ scope.row.params }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/device/device/detail/DeviceDetailsSimulator.vue b/src/views/iot/device/device/detail/DeviceDetailsSimulator.vue
index 0ce918aa0..c37405c6b 100644
--- a/src/views/iot/device/device/detail/DeviceDetailsSimulator.vue
+++ b/src/views/iot/device/device/detail/DeviceDetailsSimulator.vue
@@ -134,7 +134,7 @@
-
+
@@ -146,7 +146,7 @@
import { ProductVO } from '@/api/iot/product/product'
import { SimulatorData, ThingModelApi } from '@/api/iot/thingmodel'
import { DeviceApi, DeviceStateEnum, DeviceVO } from '@/api/iot/device/device'
-import DeviceDetailsLog from './DeviceDetailsLog.vue'
+import DeviceDetailsMessage from './DeviceDetailsMessage.vue'
import { getDataTypeOptionsLabel } from '@/views/iot/thingmodel/config'
import { DataDefinition } from '@/views/iot/thingmodel/components'
diff --git a/src/views/iot/device/device/detail/index.vue b/src/views/iot/device/device/detail/index.vue
index a2bd3dec3..50408ffbe 100644
--- a/src/views/iot/device/device/detail/index.vue
+++ b/src/views/iot/device/device/detail/index.vue
@@ -10,14 +10,12 @@
-
-
-
-
+
+
{
/** 初始化 */
const { delView } = useTagsViewStore() // 视图操作
-const { currentRoute } = useRouter() // 路由
+const router = useRouter() // 路由
+const { currentRoute } = router
onMounted(async () => {
if (!id) {
message.warning('参数错误,产品不能为空!')
diff --git a/src/views/iot/utils/constants.ts b/src/views/iot/utils/constants.ts
index 29a9ef983..b31319f82 100644
--- a/src/views/iot/utils/constants.ts
+++ b/src/views/iot/utils/constants.ts
@@ -2,3 +2,39 @@
export const IOT_PROVIDE_KEY = {
PRODUCT: 'IOT_PRODUCT'
}
+
+/**
+ * IoT 设备消息的方法枚举
+ */
+export const IotDeviceMessageMethodEnum = {
+ // ========== 设备状态 ==========
+ STATE_ONLINE: {
+ method: 'thing.state.online',
+ name: '设备上线',
+ upstream: true
+ },
+ STATE_OFFLINE: {
+ method: 'thing.state.offline',
+ name: '设备下线',
+ upstream: true
+ },
+
+ // ========== 设备属性 ==========
+ PROPERTY_POST: {
+ method: 'thing.property.post',
+ name: '属性上报',
+ upstream: true
+ },
+ PROPERTY_SET: {
+ method: 'thing.property.set',
+ name: '属性设置',
+ upstream: false
+ },
+
+ // ========== 设备事件 ==========
+ EVENT_POST: {
+ method: 'thing.event.post',
+ name: '事件上报',
+ upstream: true
+ }
+}