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

enum Api {
  getCoalSeamFireNum = '/province/homeData/getCoalSeamFireNum',
  getMineProductionStatusNum = '/province/homeData/getMineProductionStatusNum',
  getOverLimitNum = '/province/homeData/getOverLimitNum',
  getGoafAlarmNum = '/province/homeData/getGoafAlarmNum',
  getGoafAlarmLevel = '/province/homeData/getGoafAlarmLevel',
  getGoafAccessCount = '/province/mineData/getGoafAccessCount',
  getGoafData = '/province/device/getGoafData',
  getGoafStatusNum = '/province/homeData/getGoafStatusNum',
  getProvinceAlarm = '/province/alarm/getProvinceAlarm',
}

// 查询煤层自燃倾向数量统计
export const getCoalSeamFireNum = (params) =>
  defHttp.post(
    {
      url: Api.getCoalSeamFireNum,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

// 查询矿井生成状态统计
export const getMineProductionStatusNum = (params) =>
  defHttp.post(
    {
      url: Api.getMineProductionStatusNum,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

// 查询采空区超限数量统计
export const getOverLimitNum = (params) =>
  defHttp.post(
    {
      url: Api.getOverLimitNum,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

// 执法处风险统计
export const getGoafAlarmNum = (params) =>
  defHttp.post(
    {
      url: Api.getGoafAlarmNum,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

// 根据矿编码查询矿下采空区风险等级
export const getGoafAlarmLevel = (params) =>
  defHttp.post(
    {
      headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
      url: Api.getGoafAlarmLevel,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

// 接入统计
export const getGoafAccessCount = (params) =>
  defHttp.get(
    {
      url: Api.getGoafAccessCount,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

// 查询密闭监测数据
export function getGoafData(params: any) {
  return defHttp.post({ url: Api.getGoafData, params }, { joinParamsToUrl: true });
}

// 查询密闭统计
export function getGoafStatusNum(params) {
  return defHttp.post(
    {
      url: Api.getGoafStatusNum,
      params,
    },
    { joinParamsToUrl: true }
  );
}

// 查询预警信息列表
export function getProvinceAlarm(params) {
  return defHttp.post(
    {
      url: Api.getProvinceAlarm,
      params,
    },
    { joinParamsToUrl: true }
  );
}
