Merge remote-tracking branch 'yudao/feature/iot' into feature/iot

# Conflicts:
#	src/views/iot/product/product/detail/ThingModel/ThingModelDataSpecs.vue
#	src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelEnumTypeDataSpecs.vue
#	src/views/iot/product/product/detail/ThingModel/dataSpecs/ThingModelNumberTypeDataSpecs.vue
#	src/views/iot/thinkmodel/ThinkModelForm.vue
#	src/views/iot/thinkmodel/dataSpecs/ThinkModelArrayTypeDataSpecs.vue
This commit is contained in:
puhui999
2024-12-17 15:46:50 +08:00
18 changed files with 692 additions and 43 deletions

View File

@ -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 } })
},
// 获取设备属性最数据
// 获取设备属性最<EFBFBD><EFBFBD><EFBFBD>数据
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` })
}
}

View File

@ -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 })
}
}

View File

@ -51,6 +51,7 @@ export enum ProductFunctionAccessModeEnum {
READ_ONLY = 'r' // 只读
}
// TODO @puhui999getProductThingModelPage => getThingModelPage 哈,不用带 product 前缀
// IoT 产品物模型 API
export const ThinkModelApi = {
// 查询产品物模型分页