import request from '@/utils/request'

// 查询编码配置列表
export function listRule(query) {
  return request({
    url: '/code/rule/list',
    method: 'get',
    params: query
  })
}

// 查询编码配置详细
export function getRule(id) {
  return request({
    url: '/code/rule/' + id,
    method: 'get'
  })
}

// 新增编码配置
export function addRule(data) {
  return request({
    url: '/code/rule',
    method: 'post',
    data: data
  })
}

// 修改编码配置
export function updateRule(data) {
  return request({
    url: '/code/rule',
    method: 'put',
    data: data
  })
}

// 删除编码配置
export function delRule(id) {
  return request({
    url: '/code/rule/' + id,
    method: 'delete'
  })
}

// 导出编码配置
export function exportRule(query) {
  return request({
    url: '/code/rule/export',
    method: 'get',
    params: query
  })
}

export function treeselect() {
  return request({
    url: '/code/rule/treeselect',
    method: 'get'
  })
}

// 查询编码配置列表
export function listLevelAndRule(query) {
  return request({
    url: '/code/rule/listofall',
    method: 'get',
    params: query
  })
}
