import request from '@/utils/request';
// 获取基本区域列表
export async function basicAreaPageAPI(params) {
  const res = await request.post(`/main/basicarea/page`, params);
  if (res.data.code == 0) {
    return res.data.data.list;
  }
  return Promise.reject(new Error(res.data.message));
}
// 保存基本区域
export async function basicAreaSaveAPI(params) {
  const res = await request.post(`/main/basicarea/save`, params);
  if (res.data.code == 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
// 修改基本区域
export async function basicAreaUpdateAPI(params) {
  const res = await request.put(`/main/basicarea/update`, params);
  if (res.data.code == 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
// 删除基本区域
export async function basicAreaDeleteAPI(data) {
  const res = await request.delete(`/main/basicarea/delete`, {data});
  if (res.data.code == 0) {
    return res.data.message;
  }
  return Promise.reject(new Error(res.data.message));
}
