parent
dc67e252b7
commit
aeb237470c
@ -0,0 +1,112 @@
|
||||
import helper from 'src/Utils/helper';
|
||||
import { request } from '../../boot/axios';
|
||||
import { Pagination } from '../class';
|
||||
import {
|
||||
DeivceSearchEntity,
|
||||
DeivceEntity,
|
||||
DeivcePointSearchEntity,
|
||||
DeivcePointEntity
|
||||
} from './model/deivce';
|
||||
const pathName = 'Device/';
|
||||
|
||||
class DeviceApi {
|
||||
// PLC控制器 分页
|
||||
getDevicePageList = (val: Pagination<DeivceSearchEntity>) => {
|
||||
let format = `?page=${val.page}&size=${val.rowsPerPage}`;
|
||||
if (val.data.deviceCode) {
|
||||
format += `&deviceCode=${val.data.deviceCode}`;
|
||||
}
|
||||
if (val.data.deviceName) {
|
||||
format += `&deviceName=${val.data.deviceName}`;
|
||||
}
|
||||
if (val.data.activated != undefined && val.data.activated != null) {
|
||||
format += `&activated=${val.data.activated}`;
|
||||
}
|
||||
return request.get(`${pathName}GetDevicePageList${format}`);
|
||||
};
|
||||
|
||||
// 添加PLC控制器
|
||||
addDevice = (val: DeivceEntity) => {
|
||||
return request.post(`${pathName}AddDevice`, val);
|
||||
};
|
||||
// 修改PLC控制器
|
||||
updateDevice = (val: DeivceEntity) => {
|
||||
return request.post(`${pathName}UpdateDevice`, val);
|
||||
};
|
||||
// 删除PLC控制器
|
||||
deleteDevice = (val: any) => {
|
||||
return request.post(`${pathName}DeleteDevice?id=${val}`);
|
||||
};
|
||||
|
||||
// 获取PLC控制器列表
|
||||
getDeviceInfoList = (val: DeivceSearchEntity) => {
|
||||
const format = helper.params(val);
|
||||
return request.get(`${pathName}GetDeviceInfoList${format}`);
|
||||
};
|
||||
|
||||
// 获取PLC控制器明细
|
||||
getDeviceDetail = (val: any) => {
|
||||
return request.get(`${pathName}GetDeviceDetail?id=${val}`);
|
||||
};
|
||||
|
||||
// PLC控制器点位 分页
|
||||
getDevicePointPageList = (val: Pagination<DeivcePointSearchEntity>) => {
|
||||
let format = `?page=${val.page}&size=${val.rowsPerPage}`;
|
||||
if (val.data.deviceId) {
|
||||
format += `&deviceId=${val.data.deviceId}`;
|
||||
}
|
||||
if (val.data.deviceCode) {
|
||||
format += `&deviceCode=${val.data.deviceCode}`;
|
||||
}
|
||||
if (val.data.deviceName) {
|
||||
format += `&deviceName=${val.data.deviceName}`;
|
||||
}
|
||||
if (val.data.equipmentName) {
|
||||
format += `&equipmentName=${val.data.equipmentName}`;
|
||||
}
|
||||
if (val.data.equipmentCode) {
|
||||
format += `&equipmentCode=${val.data.equipmentCode}`;
|
||||
}
|
||||
if (val.data.equipmentType) {
|
||||
format += `&equipmentType=${val.data.equipmentType}`;
|
||||
}
|
||||
if (val.data.pointCode) {
|
||||
format += `&pointCode=${val.data.pointCode}`;
|
||||
}
|
||||
if (val.data.pointName) {
|
||||
format += `&pointName=${val.data.pointName}`;
|
||||
}
|
||||
if (val.data.activated != undefined && val.data.activated != null) {
|
||||
format += `&activated=${val.data.activated}`;
|
||||
}
|
||||
return request.get(`${pathName}GetDevicePointPageList${format}`);
|
||||
};
|
||||
|
||||
// 获取PLC控制器点位列表
|
||||
getDevicePointList = (val: DeivcePointSearchEntity) => {
|
||||
debugger;
|
||||
const format = helper.params(val);
|
||||
return request.get(`${pathName}GetDevicePointList${format}`);
|
||||
};
|
||||
|
||||
// 获取PLC控制器点位明细
|
||||
getDevicePointDetail = (val: any) => {
|
||||
return request.get(`${pathName}GetDevicePointDetail?id=${val}`);
|
||||
};
|
||||
|
||||
// 添加PLC控制器点位
|
||||
addDevicePoint = (val: DeivcePointEntity) => {
|
||||
return request.post(`${pathName}AddDevicePoint`, val);
|
||||
};
|
||||
// 修改PLC控制器点位
|
||||
updateDevicePoint = (val: DeivcePointEntity) => {
|
||||
return request.post(`${pathName}UpdateDevicePoint`, val);
|
||||
};
|
||||
// 删除PLC控制器点位
|
||||
deleteDevicePoint = (val: any) => {
|
||||
return request.post(`${pathName}DeleteDevicePoint?id=${val}`);
|
||||
};
|
||||
}
|
||||
const deviceApi = new DeviceApi();
|
||||
|
||||
export { deviceApi };
|
Loading…
Reference in New Issue