import request from '@/config/axios'

export interface RankVO {
  id?: number
  name: string
  sort: number
  status: number
  remark: string
  createTime?: Date
}

// 查询职级列表
export const getRankPage = async (params: PageParam) => {
  return await request.get({ url: '/system/rank/page', params })
}

// 获取职级精简信息列表
export const getSimpleRankList = async (): Promise<RankVO[]> => {
  return await request.get({ url: '/system/rank/simple-list' })
}

// 查询职级详情
export const getRank = async (id: number) => {
  return await request.get({ url: '/system/rank/get?id=' + id })
}

// 新增职级
export const createRank = async (data: RankVO) => {
  return await request.post({ url: '/system/rank/create', data })
}

// 修改职级
export const updateRank = async (data: RankVO) => {
  return await request.put({ url: '/system/rank/update', data })
}

// 删除职级
export const deleteRank = async (id: number) => {
  return await request.delete({ url: '/system/rank/delete?id=' + id })
}

// 导出职级
export const exportRank = async (params) => {
  return await request.download({ url: '/system/rank/export', params })
}
