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

enum Api {
  // 矿山信息
  getMineData = '/ventanaly-province/province/mineData/getMineData',
  // 接入统计
  getGoafAccessCount = '/ventanaly-province/province/mineData/getGoafAccessCount',
  // 数据质量
  getDataQuaQueList = '/ventanaly-province/province/dataQuaQue/list',
  getMineDataQuality = '/ventanaly-province/province/mineData/getMineDataQuality',
  getMineDataQualityHistory = '/ventanaly-province/province/mineData/getMineDataQualityHistory',
  addDataQuaQue = '/ventanaly-province/province/dataQuaQue/add',
  deleteDataQuaQue = '/ventanaly-province/province/dataQuaQue/delete',
  editDataQuaQue = '/ventanaly-province/province/dataQuaQue/edit',
  // 密闭统计
  getClosedAccessCount = '/ventanaly-province/province/mineData/getZFCGoafAccessCount',

  getGoafQuestionReportList = '/ventanaly-province/province/goafQuestionReport/list',
  addGoafQuestionReport = '/ventanaly-province/province/goafQuestionReport/add',
  deleteGoafQuestionReport = '/ventanaly-province/province/goafQuestionReport/delete',
  editGoafQuestionReport = '/ventanaly-province/province/goafQuestionReport/edit',
  getGoafQuestionReport = '/ventanaly-province/province/goafQuestionReport/queryById',
}
// 矿山信息

export const getMineData = (params) =>
  defHttp.post({
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    url: Api.getMineData,
    params,
  });

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

// 数据质量相关接口

/**
 * 分页列表查询
 * @param params
 */
export const getDataQuaQueList = (params) =>
  defHttp.post(
    {
      // headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
      url: Api.getMineDataQuality,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

export const getMineDataQualityHistory = (params) =>
  defHttp.post(
    {
      // headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
      url: Api.getMineDataQualityHistory,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );

/**
 * 新增质量问题
 * @param params
 */
export const addDataQuaQue = (params) =>
  defHttp.post({
    url: Api.addDataQuaQue,
    params,
  });

/**
 * 通过id删除质量问题
 * @param params
 */
export const deleteDataQuaQue = (params) =>
  defHttp.delete({
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    url: Api.deleteDataQuaQue,
    params,
  });

/**
 * 编辑质量问题
 * @param params
 */
export const editDataQuaQue = (params) =>
  defHttp.post({
    url: Api.editDataQuaQue,
    params,
  });

// 密闭统计
export const getClosedAccessCount = (params) =>
  defHttp.get({
    url: Api.getClosedAccessCount,
    params,
  });

export const getGoafQuestionReportList = (params) =>
  defHttp.get({
    url: Api.getGoafQuestionReportList,
    params,
  });
export const addGoafQuestionReport = (params) =>
  defHttp.post({
    url: Api.addGoafQuestionReport,
    params,
  });
export const deleteGoafQuestionReport = (params) =>
  defHttp.delete(
    {
      url: Api.deleteGoafQuestionReport,
      params,
    },
    {
      joinParamsToUrl: true,
    }
  );
export const editGoafQuestionReport = (params) =>
  defHttp.post({
    url: Api.editGoafQuestionReport,
    params,
  });
export const getGoafQuestionReport = (params) =>
  defHttp.get({
    url: Api.getGoafQuestionReport,
    params,
  });
