import { defHttp } from '/@/utils/http/axios';

enum Api {
  getProvinceAlarm = '/province/alarm/getProvinceAlarm',
  getMineData = '/province/mineData/getMineData',
  getProvinceAlarmNum = '/province/alarm/getProvinceAlarmNum',
  getGoafData = '/province/device/getGoafList',
  getProvinceAlarmHistory = '/province/alarm/getProvinceAlarmHistory',
  getEnfMineTreeData = '/jeecg-system/sys/user/getEnfMineTreeData',
}
//根据预警类型查询不同等级数量
export const getProvinceAlarmNum = (params) =>
  defHttp.post(
    {
      url: Api.getProvinceAlarmNum,
      params,
    },
    { joinParamsToUrl: true }
  );
//查询煤矿列表
export const getMineData = (params) =>
  defHttp.post({
    url: Api.getMineData,
    params,
  });
//查询预警数据
export const getProvinceAlarm = (params) =>
  defHttp.post({
    url: Api.getProvinceAlarm,
    params,
  });
//查询密闭列表
export const getGoafData = (params) =>
  defHttp.post({
    url: Api.getGoafData,
    params,
  });
//查询预警历史数据
export const getProvinceAlarmHistory = (params) =>
  defHttp.post(
    {
      url: Api.getProvinceAlarmHistory,
      params: {
        alarmType: 'fireAlarm',
        ...params,
      },
    },
    { joinParamsToUrl: true }
  ); //获取执法处以及区域数据
export const getEnfMineTreeData = () =>
  defHttp.get({
    url: Api.getEnfMineTreeData,
  });
