76 lines
1.4 KiB
TypeScript
76 lines
1.4 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
import { PlanVO, PlanForm, PlanQuery } from '@/api/system/InspectionPlan/type';
|
|
|
|
/**
|
|
* 查询巡检计划列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listPlan = (query: PlanQuery | {} = {}): AxiosPromise<PlanVO[]> => {
|
|
return request({
|
|
url: '/inspection/plan/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询巡检计划详细
|
|
* @param id
|
|
*/
|
|
export const getPlan = (id: string | number): AxiosPromise<PlanVO> => {
|
|
return request({
|
|
url: '/inspection/plan/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增巡检计划
|
|
* @param data
|
|
*/
|
|
export const addPlan = (data: PlanForm) => {
|
|
return request({
|
|
url: '/inspection/plan',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改巡检计划
|
|
* @param data
|
|
*/
|
|
export const updatePlan = (data: PlanForm) => {
|
|
return request({
|
|
url: '/inspection/plan',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除巡检计划
|
|
* @param id
|
|
*/
|
|
export const delPlan = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/inspection/plan/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|
|
/**
|
|
* 改变巡检计划状态
|
|
* @param id
|
|
* @param status
|
|
*/
|
|
export const changePlanStatus = (id: string, status: string) => {
|
|
return request({
|
|
url: '/inspection/plan/changeStatus',
|
|
method: 'put',
|
|
params: { id, status }
|
|
});
|
|
};
|