Files
td_official/src/api/safety/violationLevel/index.ts

64 lines
1.3 KiB
TypeScript
Raw Normal View History

import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ViolationLevelVO, ViolationLevelForm, ViolationLevelQuery } from '@/api/safety/violationLevel/types';
/**
*
* @param query
* @returns {*}
*/
export const listViolationLevel = (query?: ViolationLevelQuery): AxiosPromise<ViolationLevelVO[]> => {
return request({
url: '/safety/violationLevel/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getViolationLevel = (id: string | number): AxiosPromise<ViolationLevelVO> => {
return request({
url: '/safety/violationLevel/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addViolationLevel = (data: ViolationLevelForm) => {
return request({
url: '/safety/violationLevel',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateViolationLevel = (data: ViolationLevelForm) => {
return request({
url: '/safety/violationLevel',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delViolationLevel = (id: string | number | Array<string | number>) => {
return request({
url: '/safety/violationLevel/' + id,
method: 'delete'
});
};