75 lines
1.4 KiB
TypeScript
75 lines
1.4 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
import { PointVO, PointForm, PointQuery } from '@/api/system/InspectionPoint/type';
|
|
|
|
/**
|
|
* 查询巡检点列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listPoint = (query?: PointQuery | {}): AxiosPromise<PointVO[]> => {
|
|
return request({
|
|
url: '/inspection/point/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询巡检点详细
|
|
* @param id
|
|
*/
|
|
export const getPoint = (id: string | number): AxiosPromise<PointVO> => {
|
|
return request({
|
|
url: '/inspection/point/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增巡检点
|
|
* @param data
|
|
*/
|
|
export const addPoint = (data: PointForm) => {
|
|
return request({
|
|
url: '/inspection/point',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改巡检点
|
|
* @param data
|
|
*/
|
|
export const updatePoint = (data: PointForm) => {
|
|
return request({
|
|
url: '/inspection/point',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除巡检点
|
|
* @param id
|
|
*/
|
|
export const delPoint = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/inspection/point/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|
|
/**
|
|
* 修改巡检点状态
|
|
* @param id
|
|
* @param status
|
|
*/
|
|
export const changePointStatus = (id: string, status: string) => {
|
|
return request({
|
|
url: '/inspection/point/changeStatus?id=' + id + '&status=' + status,
|
|
method: 'PUT'
|
|
});
|
|
};
|