import request from '@/utils/request'
// 获取分类树
export function getAreaTree(params) {
  return request({
    url: 'api/setarea/getall',
    method: 'get',
    params
  })
}
//获取地区树子节点
export function getAreaTreeChildNode(params) {
  return request({
    url: 'api/setarea/getallbypid',
    method: 'get',
    params
  })
}
// 添加
export function addAreaTree(data) {
  return request({
    url: 'api/setarea/add',
    method: 'post',
    data
  })
}
// 编辑
export function editAreaTree(data) {
  return request({
    url: 'api/setarea/update',
    method: 'post',
    data
  })
}
// 删除分类
export function deleteAreaTree(ids) {
  return request({
    url: 'api/setarea/delete',
    method: 'post',
    data: {
      ids
    }
  })
}
// 获取详情
export function getAreaTreeDetail(id) {
  return request({
    url: 'api/setarea/getareasingle',
    method: 'get',
    params: {
      id
    }
  })
}

