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

enum Api {
  list = '/dkgl/dsrwGeoJd/provinceList',
  addList = '/dkgl/gDsrwGeo/geoCheckPagelist',
  save = '/dkgl/dsrwGeoJd/add',
  deleteOne = '/dkgl/dsrwGeoJd/delete',
  provinceAudit = '/dkgl/dsrwGeoJd/provinceAudit',
  provicecheckSubmit = '/dkgl/dsrwGeoJd/proviceCheckSubmit',
  findZrzyjList = '/dkgl/dsrwGeoJdAudit/findZrzyjList',
  findStbmList = '/dkgl/dsrwGeoJdAudit/findStbmList',
  provinceAuditsPageList = '/dkgl/dsrwGeoJd/provinceAuditsPageList',
  exportXls = '/dkgl/dsrwGeoJd/exportXls',
  downloadMdb = '/dkgl/dsrwGeoJd/downloadMdb',
  downloadGdb = '/dkgl/dsrwGeoJd/downloadGdb',
  proviceZgbmCheck = '/dkgl/dsrwGeoJd/proviceZgbmCheck',
}
/**
 * 下载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 provinceAuditsPageList = (params) => defHttp.get({ url: Api.provinceAuditsPageList, params });
/**
 * 自规部门审核校验
 * @param params
 */
export const proviceZgbmCheck = (params) => defHttp.get({ url: Api.proviceZgbmCheck, params });
/**
 * 列表接口
 * @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
 * @param handleSuccess
 */
export const deleteOne = (params, handleSuccess) => {
  return defHttp.post({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};
/**
 * 审核校验
 * @param params
 */
export const saveProvinceAuditCheck = (params) => {
  return defHttp.get({ url: Api.provicecheckSubmit + '?jd=' + params.jd });
};
/**
 * 审核
 * @param params
 */
export const saveProvinceAudit = (params) => {
  return defHttp.post({ url: Api.provinceAudit, params });
};
/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params) => {
  return defHttp.post({ url: Api.save, params });
};
