import request from '/@/utils/request';

/**
 * 分页查询处分等级配置列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/stupunlishlevelconfig/page',
    method: 'get',
    params: query
  });
};

/**
 * 获取所有启用的处分等级配置
 */
export const getAllActiveConfigs = () => {
  return request({
    url: '/stuwork/stupunlishlevelconfig/getAllActiveConfigs',
    method: 'get'
  });
};

/**
 * 新增处分等级配置
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/stupunlishlevelconfig',
    method: 'post',
    data
  });
};

/**
 * 获取详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/stupunlishlevelconfig/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 编辑处分等级配置
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/stupunlishlevelconfig/edit',
    method: 'post',
    data
  });
};

/**
 * 删除处分等级配置
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/stupunlishlevelconfig/delete',
    method: 'post',
    data: ids
  });
};