import request from '@/utils/request'

// 查询层级规则列表
export function listRule(query) {
  return request({
    url: '/level/rule/list',
    method: 'get',
    params: query
  })
}

// 查询层级规则详细
export function getRule(id) {
  return request({
    url: '/level/rule/' + id,
    method: 'get'
  })
}

// 新增层级规则
export function addRule(data) {
  return request({
    url: '/level/rule',
    method: 'post',
    data: data
  })
}

// 修改层级规则
export function updateRule(data) {
  return request({
    url: '/level/rule',
    method: 'put',
    data: data
  })
}

// 删除层级规则
export function delRule(id) {
  return request({
    url: '/level/rule/' + id,
    method: 'delete'
  })
}

// 导出层级规则
export function exportRule(query) {
  return request({
    url: '/level/rule/export',
    method: 'get',
    params: query
  })
}