diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/device/index.ts similarity index 91% rename from src/api/iot/device/index.ts rename to src/api/iot/device/device/index.ts index a483484d..ec80bfab 100644 --- a/src/api/iot/device/index.ts +++ b/src/api/iot/device/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 = { // 查询设备分页 @@ -115,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 }) }, @@ -123,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/api/iot/plugininfo/index.ts b/src/api/iot/plugininfo/index.ts new file mode 100644 index 00000000..03229f70 --- /dev/null +++ b/src/api/iot/plugininfo/index.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +// IoT 插件信息 VO +export interface PluginInfoVO { + id: number // 主键ID + pluginId: string // 插件包id + name: string // 插件名称 + description: string // 描述 + deployType: number // 部署方式 + file: string // 插件包文件名 + version: string // 插件版本 + type: number // 插件类型 + protocol: string // 设备插件协议类型 + status: number // 状态 + configSchema: string // 插件配置项描述信息 + config: string // 插件配置信息 + script: string // 插件脚本 +} + +// IoT 插件信息 API +export const PluginInfoApi = { + // 查询IoT 插件信息分页 + getPluginInfoPage: async (params: any) => { + return await request.get({ url: `/iot/plugin-info/page`, params }) + }, + + // 查询IoT 插件信息详情 + getPluginInfo: async (id: number) => { + return await request.get({ url: `/iot/plugin-info/get?id=` + id }) + }, + + // 新增IoT 插件信息 + createPluginInfo: async (data: PluginInfoVO) => { + return await request.post({ url: `/iot/plugin-info/create`, data }) + }, + + // 修改IoT 插件信息 + updatePluginInfo: async (data: PluginInfoVO) => { + return await request.put({ url: `/iot/plugin-info/update`, data }) + }, + + // 删除IoT 插件信息 + deletePluginInfo: async (id: number) => { + return await request.delete({ url: `/iot/plugin-info/delete?id=` + id }) + }, + + // 导出IoT 插件信息 Excel + exportPluginInfo: async (params) => { + return await request.download({ url: `/iot/plugin-info/export-excel`, params }) + } +} diff --git a/src/api/iot/thinkmodel/index.ts b/src/api/iot/thinkmodel/index.ts index ee314790..8817f755 100644 --- a/src/api/iot/thinkmodel/index.ts +++ b/src/api/iot/thinkmodel/index.ts @@ -51,6 +51,7 @@ export enum ProductFunctionAccessModeEnum { READ_ONLY = 'r' // 只读 } +// TODO @puhui999:getProductThingModelPage => getThingModelPage 哈,不用带 product 前缀 // IoT 产品物模型 API export const ThinkModelApi = { // 查询产品物模型分页 diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 1134152b..5538ed60 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -239,5 +239,8 @@ export enum DICT_TYPE { IOT_PRODUCT_FUNCTION_TYPE = 'iot_product_function_type', // IOT 产品功能类型 IOT_DATA_TYPE = 'iot_data_type', // IOT 数据类型 IOT_UNIT_TYPE = 'iot_unit_type', // IOT 单位类型 - IOT_RW_TYPE = 'iot_rw_type' // IOT 读写类型 + IOT_RW_TYPE = 'iot_rw_type', // IOT 读写类型 + IOT_PLUGIN_DEPLOY_TYPE = 'iot_plugin_deploy_type', // IOT 插件部署类型 + IOT_PLUGIN_STATUS = 'iot_plugin_status', // IOT 插件状态 + IOT_PLUGIN_TYPE = 'iot_plugin_type' // IOT 插件类型 } diff --git a/src/views/iot/device/device/DeviceForm.vue b/src/views/iot/device/device/DeviceForm.vue index bda22adb..be33c0c5 100644 --- a/src/views/iot/device/device/DeviceForm.vue +++ b/src/views/iot/device/device/DeviceForm.vue @@ -85,7 +85,7 @@ diff --git a/src/views/iot/device/device/detail/DeviceDataDetail.vue b/src/views/iot/device/device/detail/DeviceDataDetail.vue index ded1d8b3..0c9ca9c3 100644 --- a/src/views/iot/device/device/detail/DeviceDataDetail.vue +++ b/src/views/iot/device/device/detail/DeviceDataDetail.vue @@ -53,10 +53,9 @@ diff --git a/src/views/iot/device/device/index.vue b/src/views/iot/device/device/index.vue index bcc2df21..8525d674 100644 --- a/src/views/iot/device/device/index.vue +++ b/src/views/iot/device/device/index.vue @@ -123,6 +123,9 @@ > 导出 + + 导入 + - -
+ + +
+
+
-
{{ item.deviceName }}
+
{{ item.deviceName }}
+ +
+
+
+ + {{ getDictLabel(DICT_TYPE.IOT_DEVICE_STATUS, item.status) }} + +
@@ -186,7 +220,7 @@ - +
- 日志 + 数据
查看 - 日志 + 日志 + + \ 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 diff --git a/src/views/iot/product/product/detail/index.vue b/src/views/iot/product/product/detail/index.vue index c74c10a9..e3537642 100644 --- a/src/views/iot/product/product/detail/index.vue +++ b/src/views/iot/product/product/detail/index.vue @@ -18,7 +18,7 @@