|
|
|
|
@ -1,92 +1,101 @@
|
|
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
|
|
// 物联设备 VO
|
|
|
|
|
export interface DeviceVO {
|
|
|
|
|
id: number // ID
|
|
|
|
|
deviceConfigId: string // 设备配置id
|
|
|
|
|
deviceCode: string // 设备编号
|
|
|
|
|
deviceName: string // 设备名称
|
|
|
|
|
deviceType: string // 设备类型
|
|
|
|
|
siemensSeries: string // Siemens系列(S7-300、S7-1500)
|
|
|
|
|
siemensConnectParam: string // 连接参数(波特率,数据位,停止位,校验位 例如:9600,8,1,N)
|
|
|
|
|
readCronType: string // 读取任务方式(0无,1有)
|
|
|
|
|
readRepeatValue: number // 读取任务时间间隔
|
|
|
|
|
readRepeatUnit: string // 读取任务时间间隔单位
|
|
|
|
|
readCron: string // 读取任务时间表达式
|
|
|
|
|
writeCronType: string // 写入任务时间间隔
|
|
|
|
|
writeRepeatValue: number // 写入任务时间间隔
|
|
|
|
|
writeRepeatUnit: string // 写入任务时间间隔单位
|
|
|
|
|
writeCron: string // 写入任务时间表达式
|
|
|
|
|
localPersistent: string // 是否持久化(0不持久化,1持久化)
|
|
|
|
|
uploadRate: string // 上传方式(1实时,2自定义)
|
|
|
|
|
rateCount: number // 上传频率
|
|
|
|
|
modbusProtocol: string // modbus协议类型(serial-rtu)
|
|
|
|
|
modbusPattern: string // modbus模式(client)
|
|
|
|
|
portName: string // modbus串口号
|
|
|
|
|
modbusConnectParam: string // 连接参数(波特率,数据位,停止位,校验位 例如:9600,8,1,N)
|
|
|
|
|
modbusReadAddrGap: string // 读地址是否连续(0否,1是)
|
|
|
|
|
isUpload: string // 是否已下发(0下,1没下)
|
|
|
|
|
gatewayId: number // 网关id
|
|
|
|
|
orgId: number // 组织设备id
|
|
|
|
|
remark: string // 备注
|
|
|
|
|
isEnable: boolean // 是否启用
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 物联设备 API
|
|
|
|
|
export const DeviceApi = {
|
|
|
|
|
// 查询物联设备分页
|
|
|
|
|
getDevicePage: async (params: any) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/page`, params })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 查询物联设备详情
|
|
|
|
|
getDevice: async (id: number) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/get?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 新增物联设备
|
|
|
|
|
createDevice: async (data: DeviceVO) => {
|
|
|
|
|
return await request.post({ url: `/iot/device/create`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 修改物联设备
|
|
|
|
|
updateDevice: async (data: DeviceVO) => {
|
|
|
|
|
return await request.put({ url: `/iot/device/update`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 删除物联设备
|
|
|
|
|
deleteDevice: async (id: number) => {
|
|
|
|
|
return await request.delete({ url: `/iot/device/delete?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 导出物联设备 Excel
|
|
|
|
|
exportDevice: async (params) => {
|
|
|
|
|
return await request.download({ url: `/iot/device/export-excel`, params })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ==================== 子表(设备属性) ====================
|
|
|
|
|
|
|
|
|
|
// 获得设备属性分页
|
|
|
|
|
getDeviceAttributePage: async (params) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/device-attribute/page`, params })
|
|
|
|
|
},
|
|
|
|
|
// 新增设备属性
|
|
|
|
|
createDeviceAttribute: async (data) => {
|
|
|
|
|
return await request.post({ url: `/iot/device/device-attribute/create`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 修改设备属性
|
|
|
|
|
updateDeviceAttribute: async (data) => {
|
|
|
|
|
return await request.put({ url: `/iot/device/device-attribute/update`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 删除设备属性
|
|
|
|
|
deleteDeviceAttribute: async (id: number) => {
|
|
|
|
|
return await request.delete({ url: `/iot/device/device-attribute/delete?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获得设备属性
|
|
|
|
|
getDeviceAttribute: async (id: number) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/device-attribute/get?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
|
|
// 物联设备 VO
|
|
|
|
|
export interface DeviceVO {
|
|
|
|
|
id: number // ID
|
|
|
|
|
deviceConfigId: string // 设备配置id
|
|
|
|
|
deviceCode: string // 设备编号
|
|
|
|
|
deviceName: string // 设备名称
|
|
|
|
|
deviceType: string // 设备类型
|
|
|
|
|
siemensSeries: string // Siemens系列(S7-300、S7-1500)
|
|
|
|
|
siemensConnectParam: string // 连接参数(波特率,数据位,停止位,校验位 例如:9600,8,1,N)
|
|
|
|
|
readCronType: string // 读取任务方式(0无,1有)
|
|
|
|
|
readRepeatValue: number // 读取任务时间间隔
|
|
|
|
|
readRepeatUnit: string // 读取任务时间间隔单位
|
|
|
|
|
readCron: string // 读取任务时间表达式
|
|
|
|
|
writeCronType: string // 写入任务时间间隔
|
|
|
|
|
writeRepeatValue: number // 写入任务时间间隔
|
|
|
|
|
writeRepeatUnit: string // 写入任务时间间隔单位
|
|
|
|
|
writeCron: string // 写入任务时间表达式
|
|
|
|
|
localPersistent: string // 是否持久化(0不持久化,1持久化)
|
|
|
|
|
uploadRate: string // 上传方式(1实时,2自定义)
|
|
|
|
|
rateCount: number // 上传频率
|
|
|
|
|
modbusProtocol: string // modbus协议类型(serial-rtu)
|
|
|
|
|
modbusPattern: string // modbus模式(client)
|
|
|
|
|
portName: string // modbus串口号
|
|
|
|
|
modbusConnectParam: string // 连接参数(波特率,数据位,停止位,校验位 例如:9600,8,1,N)
|
|
|
|
|
modbusReadAddrGap: string // 读地址是否连续(0否,1是)
|
|
|
|
|
isUpload: string // 是否已下发(0下,1没下)
|
|
|
|
|
gatewayId: number // 网关id
|
|
|
|
|
orgId: number // 组织设备id
|
|
|
|
|
remark: string // 备注
|
|
|
|
|
isEnable: boolean // 是否启用
|
|
|
|
|
|
|
|
|
|
deviceUseType: string // 数采设备类型
|
|
|
|
|
apIp: string // ap_ip
|
|
|
|
|
gateBridgeIp: string // 网桥ip
|
|
|
|
|
comServerIp: string // 串口服务器IP
|
|
|
|
|
comServerPort: string // 串口服务器端口
|
|
|
|
|
plcControllerIp: string // PLC控制器地址
|
|
|
|
|
plcScreenIp: string // PLC触控屏地址
|
|
|
|
|
orgMachineId: number // i机台id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 物联设备 API
|
|
|
|
|
export const DeviceApi = {
|
|
|
|
|
// 查询物联设备分页
|
|
|
|
|
getDevicePage: async (params: any) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/page`, params })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 查询物联设备详情
|
|
|
|
|
getDevice: async (id: number) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/get?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 新增物联设备
|
|
|
|
|
createDevice: async (data: DeviceVO) => {
|
|
|
|
|
return await request.post({ url: `/iot/device/create`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 修改物联设备
|
|
|
|
|
updateDevice: async (data: DeviceVO) => {
|
|
|
|
|
return await request.put({ url: `/iot/device/update`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 删除物联设备
|
|
|
|
|
deleteDevice: async (id: number) => {
|
|
|
|
|
return await request.delete({ url: `/iot/device/delete?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 导出物联设备 Excel
|
|
|
|
|
exportDevice: async (params) => {
|
|
|
|
|
return await request.download({ url: `/iot/device/export-excel`, params })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// ==================== 子表(设备属性) ====================
|
|
|
|
|
|
|
|
|
|
// 获得设备属性分页
|
|
|
|
|
getDeviceAttributePage: async (params) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/device-attribute/page`, params })
|
|
|
|
|
},
|
|
|
|
|
// 新增设备属性
|
|
|
|
|
createDeviceAttribute: async (data) => {
|
|
|
|
|
return await request.post({ url: `/iot/device/device-attribute/create`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 修改设备属性
|
|
|
|
|
updateDeviceAttribute: async (data) => {
|
|
|
|
|
return await request.put({ url: `/iot/device/device-attribute/update`, data })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 删除设备属性
|
|
|
|
|
deleteDeviceAttribute: async (id: number) => {
|
|
|
|
|
return await request.delete({ url: `/iot/device/device-attribute/delete?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获得设备属性
|
|
|
|
|
getDeviceAttribute: async (id: number) => {
|
|
|
|
|
return await request.get({ url: `/iot/device/device-attribute/get?id=` + id })
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|