import { defHttp } from '/@/utils/http/axios';
import { Modal } from 'ant-design-vue';

enum Api {
  list = '/dkgl/dsrwGeoJd/cityList',
  addList = '/dkgl/gDsrwGeo/geoCheckPagelist',
  save = '/dkgl/dsrwGeoJd/add',
  deleteOne = '/dkgl/dsrwGeoJd/delete',
  cityAudit = '/dkgl/dsrwGeoJd/cityAudit',
  citychecksubmit = '/dkgl/dsrwGeoJd/cityCheckSubmit',
  findZrzyjList = '/dkgl/dsrwGeoJdAudit/findZrzyjList',
  findStbmList = '/dkgl/dsrwGeoJdAudit/findStbmList',
  exportXls = '/dkgl/dsrwGeoJd/exportXls',
  downloadMdb = '/dkgl/dsrwGeoJd/downloadMdb',
  downloadGdb = '/dkgl/dsrwGeoJd/downloadGdb',
  cityZgbmCheck = '/dkgl/dsrwGeoJd/cityZgbmCheck',  //市级审核校验
}
/**
 * 下载mdb文件
 * @param params
 */
export const getDownloadMdb = (params) => defHttp.get({ url: Api.downloadMdb, params });
/**
 * 下载gdb文件接口
 * @param params
 */
export const getDownloadGdb = (params) => defHttp.get({ url: Api.downloadGdb, params });

/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 列表接口
 * @param params
 */
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
 * 添加列表接口
 * @param params
 */
export const addList = (params) => defHttp.get({ url: Api.addList, params });
/**
 * 审核历史列表接口
 * @param params
 */
export const findStbmList = (params) => defHttp.get({ url: Api.findStbmList, params });
/**
 * 审核列表接口
 * @param params
 */
export const findZrzyjList = (params) => defHttp.get({ url: Api.findZrzyjList, params });
/**
 * 审核校验接口
 * @param params
 */
export const cityZgbmCheck = (params) => defHttp.get({ url: Api.cityZgbmCheck, params });
/**
 * 删除单个
 * @param params
 * @param handleSuccess
 */
export const deleteOne = (params, handleSuccess) => {
  return defHttp.post({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};
/**
 * 审核校验
 * @param params
 */
export const saveCityAuditCheck = (params) => {
  return defHttp.get({ url: Api.citychecksubmit + '?jd=' + params.jd });
};
/**
 * 审核
 * @param params
 */
export const saveCityAudit = (params) => {
  return defHttp.post({ url: Api.cityAudit, params });
};
/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params) => {
  return defHttp.post({ url: Api.save, params });
};
