import { defHttp } from '/@/utils/http/axios';
enum BaseURL {
  url = '/cdy_api',
}
enum API {
  ST_DETAIL_INFO = `${BaseURL.url}/hydro_screen_api/st_detail_info`,
  ST_STATS = `${BaseURL.url}/hydro_screen_api/st_stats`,
  RAIN_STATS_INFO = `${BaseURL.url}/hydro_screen_api/rain_stats_info`,
  REAL_TIME_INFO = `${BaseURL.url}/hydro_screen_api/real_time_info`,
  WATER_REGIMEN = `${BaseURL.url}/hydro_screen_api/water_regimen`,
  RAIN_MONITORING = `${BaseURL.url}/hydro_screen_api/rain_monitoring`,
  HYDRO_MONITORING = `${BaseURL.url}/hydro_screen_api/hydro_monitoring`,
  // 工程点
  GC_SITE=`${BaseURL.url}/hydro_screen_api/project_info`,
  // 测站详情>监测信息
  MONITOR_INFO = `${BaseURL.url}/hydro_screen_api/monitor_info`,
  WEATH_MONITORING = `${BaseURL.url}/hydro_screen_api/weath_monitoring`,
  HYDRO_FORECAST_INFO = `${BaseURL.url}/hydro_screen_api/hydro_forecast_info`,
  WEATH_FORECAST = `${BaseURL.url}/hydro_screen_api/weath_forecast`,
  RAIN_LIVE_IMG = `${BaseURL.url}/hydro_screen_api/rain_live_img`,
  REAL_DATA_NUM = `${BaseURL.url}/hydro_screen_api/real_data_num`,
  // 面雨量分布图
  RAIN_MAP=`${BaseURL.url}/hydro_screen_api/topic_data_st_r`,
  // 风速风向和温度
  WD_MAP=`${BaseURL.url}/hydro_screen_api/topic_data_weath_info`,
  // 面雨量分区
  RAIN_MAPFQ=`${BaseURL.url}/hydro_screen_api/topic_data_part_r`,
  // 修改高度
  CHANGE_HEIGHT=`${BaseURL.url}/hydro_screen_api/update_st_elev`,
  // 重要测站点
  IMPORTTANT_POINT=`${BaseURL.url}/hydro_screen_api/home_gis_import_point`,
}
// 阻止是否携带/api和yt
const BaseData = {
  isSw: true,
  joinPrefix: false,
  apiUrl: false,
};

// 获取测站数据
export const getStDetailInfo = () => {
  return defHttp.get(
    {
      url: API.ST_DETAIL_INFO,
    },
    BaseData
  );
};
// 获取测站统计数据
export const getStStats = () => {
  return defHttp.get(
    {
      url: API.ST_STATS,
    },
    BaseData
  );
};
// 获取水情数据
export const postRainStatsInfo = (params) => {
  return defHttp.post(
    {
      url: API.RAIN_STATS_INFO,
      params,
    },
    BaseData
  );
};
// 获取实时告警数据REAL_TIME_INFO
export const getrealTimeInfo = () => {
  return defHttp.get(
    {
      url: API.REAL_TIME_INFO,
    },
    BaseData
  );
};
//获取水情信息
export const getWaterRegimen = (params) => {
  return defHttp.post(
    {
      url: API.WATER_REGIMEN,
      params,
    },
    BaseData
  );
};
// 雨情监控
export const getRainMonitoring = (params) => {
  return defHttp.post(
    {
      url: API.RAIN_MONITORING,
      params,
    },
    BaseData
  );
};
// 水情监测
export const getHydroMonitoring = (params) => {
  return defHttp.get(
    {
      url: API.HYDRO_MONITORING,
    },
    BaseData
  );
};
// 获取水位（7）测站详情->监测信息
export const getMonitorInfo = (params) => {
  return defHttp.post(
    {
      url: API.MONITOR_INFO,
      params,
    },
    BaseData
  );
};
// 获取气象监测
export const getWeathMonitoring = (params) => {
  return defHttp.get(
    {
      url: API.WEATH_MONITORING,
    },
    BaseData
  );
};
// 获取断面对照图
export const getHydroForecastInfo = (params) => {
  return defHttp.get(
    {
      url: API.HYDRO_FORECAST_INFO,
    },
    BaseData
  );
};
// 获取天气预报
export const getWeathForecast = (params) => {
  return defHttp.get(
    {
      url: API.WEATH_FORECAST,
    },
    BaseData
  );
};
// 获取雷达，云图，气象图RAIN_LIVE_IMG
export const getRainLiveImg = (params) => {
  return defHttp.get(
    {
      url: API.RAIN_LIVE_IMG,
    },
    BaseData
  );
};
// 获取实时数据统计
export const getRealDataNum = (params) => {
  return defHttp.get(
    {
      url: API.REAL_DATA_NUM,
    },
    BaseData
  );
};
// 面雨量专题图
export const rainMap = (params) => {
  return defHttp.post(
    {
      url: API.RAIN_MAP,
      params,
    },
    BaseData
  );
};
// 面雨量分区专题图
export const rainMapfq = (params) => {
  return defHttp.post(
    {
      url: API.RAIN_MAPFQ,
      params,
    },
    BaseData
  );
};
// 风速风向和温度专题图
export const wdMap = (params) => {
  return defHttp.post(
    {
      url: API.WD_MAP,
      params,
    },
    BaseData
  );
};
// 工程点
export const gcSite = (params) => {
  return defHttp.get(
    {
      url: API.GC_SITE,
    },
    BaseData
  );
};
// 获取重要测站点
export const getImportPoint = (params) => {
  return defHttp.get(
    {
      url: API.IMPORTTANT_POINT,
    },
    BaseData
  );
};
// 修改高度 {"stcd":90610003,"high":2930.50} 
export const changeHeight = (params) => {
  return defHttp.post(
    {
      url: API.CHANGE_HEIGHT,
      params,
    },
    BaseData
  );
};
