import { request } from '@@/plugin-request/request';
import { stringify } from 'qs';

/**
 * 查询区域管理列表数据
 * @param param
 */
export async function queryAreaTree(param: object) {
  return request(`/web/v1/report_districts?${stringify(param)}`);
}

/**
 * 新增区域
 * @param params
 */
export async function createAreaTree(params: object) {
  return request(`/web/v1/report_districts`, {
    method: 'POST',
    data: params,
  });
}

/**
 * 编辑区域
 * @param params
 */
export async function updateAreaTree(params: object) {
  return request(`/web/v1/report_districts`, {
    method: 'POST',
    data: params,
  });
}

/**
 * 删除区域
 * @param record_id
 */
export async function delAreaTree(record_id: any) {
  return request(`/web/v1/report_districts/${record_id}`, {
    method: 'DELETE',
  });
}
