You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
1.9 KiB
89 lines
1.9 KiB
import request from '@/utils/request'
|
|
function customParamsSerializer(params) {
|
|
let result = '';
|
|
for (let key in params) {
|
|
if (params.hasOwnProperty(key)) {
|
|
if (Array.isArray(params[key])) {
|
|
params[key].forEach((item,index) => {
|
|
if(item.key){
|
|
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
|
|
|
|
}else{
|
|
result +=`${key}[${index}]=${item}&`
|
|
}
|
|
});
|
|
} else {
|
|
result += `${key}=${params[key]}&`;
|
|
}
|
|
}
|
|
}
|
|
return result.slice(0, -1);
|
|
}
|
|
|
|
// 设备运维规则配置
|
|
export function getMaintainConfigList(params) {
|
|
return request({
|
|
url: '/api/admin/equipment-maintain-config/index',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getMaintainConfigDetail(params) {
|
|
return request({
|
|
url: '/api/admin/equipment-maintain-config/show',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function saveMaintainConfig(data) {
|
|
return request({
|
|
url: '/api/admin/equipment-maintain-config/save',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteMaintainConfig(params) {
|
|
return request({
|
|
url: '/api/admin/equipment-maintain-config/destroy',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
// 设备运维记录
|
|
export function getOperationList(params) {
|
|
return request({
|
|
url: '/api/admin/equipment-operation/index',
|
|
method: 'get',
|
|
params,
|
|
paramsSerializer: customParamsSerializer,
|
|
})
|
|
}
|
|
|
|
export function getOperationDetail(params) {
|
|
return request({
|
|
url: '/api/admin/equipment-operation/show',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function saveOperation(data) {
|
|
return request({
|
|
url: '/api/admin/equipment-operation/save',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteOperation(params) {
|
|
return request({
|
|
url: '/api/admin/equipment-operation/destroy',
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|