import { http } from '@/utils/http/axios';

/**
 * @description: 职级列表
 */
export function getLevelList(params?) {
  return http.request({
    url: '/level/page',
    method: 'GET',
    params,
  });
}

/**
 * 获取全部职级列表
 * @param params 参数
 * @returns 返回结果
 */
export function getLevelAllList(params?) {
  return http.request({
    url: '/level/list',
    method: 'GET',
    params,
  });
}

/**
 * @description: 根据ID获取详情
 */
export function getLevelDetail(levelId) {
  return http.request({
    url: '/level/detail/' + levelId,
    method: 'get',
  });
}

/**
 * @description: 添加职级
 */
export function levelAdd(data: any) {
  return http.request({
    url: '/level/add',
    method: 'POST',
    data,
  });
}

/**
 * @description: 更新职级
 */
export function levelUpdate(data: any) {
  return http.request({
    url: '/level/update',
    method: 'PUT',
    data,
  });
}

/**
 * @description: 删除职级
 */
export function levelDelete(levelId) {
  return http.request({
    url: '/level/delete/' + levelId,
    method: 'DELETE',
  });
}

/**
 * @description: 批量删除职级
 */
export function levelBatchDelete(data: any) {
  return http.request({
    url: '/level/batchDelete',
    method: 'DELETE',
    data,
  });
}

/**
 * @description: 导出职级
 */
export function levelExport() {
  return http.request({
    url: '/level/export',
    method: 'GET',
  });
}
