rt-sim-training-client/src/api/project.js
2020-01-03 11:18:18 +08:00

72 lines
1.8 KiB
JavaScript

import request from '@/utils/request';
/** 新建项目设备*/
export function createDevice(data) {
return request({
url: `/api/project/device`,
method: 'post',
data: data
});
}
/** 项目设备编码是否已存在 */
export function deviceIsExist(projectCode, code) {
return request({
url: `/api/project/device/exist/${projectCode}/${code}`,
method: 'get'
});
}
/** 分页查询项目设备 */
export function getProjectDeviceList(params) {
return request({
url: `/api/project/device/paging`,
method: 'get',
params:params
});
}
/** 删除项目设备 */
export function deleteProjectDevice(id) {
return request({
url: `/api/project/device/${id}`,
method: 'delete'
});
}
/** 获取设备详情 */
export function getDeviceDetail(id) {
return request({
url: `/api/project/device/${id}`,
method: 'get'
});
}
/** 添加/修改屏蔽门设备网关映射配置 */
export function setPsdConfig(id, data) {
return request({
url: `/api/project/device/${id}/config/psd`,
method: 'put',
data: data
});
}
/** 添加/修改信号机设备网关映射配置 */
export function setSignalConfig(id, data) {
return request({
url: `/api/project/device/${id}/config/signal`,
method: 'put',
data: data
});
}
/** 添加/修改信号机设备网关映射配置 */
export function setSwitchConfig(id, data) {
return request({
url: `/api/project/device/${id}/config/switch`,
method: 'put',
data: data
});
}
/** 查询项目下的所有设备 */
export function getAllDeviceInProject(params) {
return request({
url: `/api/project/device/project`,
method: 'get',
params
});
}