import request from '@/utils/request'

export function getList(data = {}) {
  return request({
    url: 'positioning/countarea/getList',
    method: 'post',
    data
  })
}
/**
 * 获取部门树的数据 - 异步获取
 * @param {} pid
 * @returns
 */
export function getTree(data) {
  return request({
    url: 'positioning/countarea/getTree',
    method: 'post',
    data
  })
}

export function add(data) {
  return request({
    url: 'positioning/countarea/saveFormJson',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'positioning/countarea/deleteFormJson',
    method: 'post',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'positioning/countarea/saveFormJson',
    method: 'post',
    data
  })
}

export default { add, edit, del, getList, getTree }