import axios from '@/common/services/axios-instance'
import PageService from '@/common/services/page-service'

class StatisticsService {
  // 查询
  getprojectList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getAuditProjectList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 发现明细列表
  getfindList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getAuditFindList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 导出
  exportData(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportAuditProjectList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  // 项目执行情况列表 查询
  getImplementList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getProjectExecList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 项目执行情况列表 导出
  exportImplementList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportProjectExecList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  // 整改情况统计 查询
  getRectifyList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getRectifyStatusList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 整改情况统计-按整改单位 查询
  getUnitRectifyList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getUnitRectifyStatusList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 整改情况统计 导出
  exportRectifyList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportRectifyStatusList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  // 整改情况统计-按整改单位 导出
  exportUnitRectifyList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportUnitRectifyStatusList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  // 机构人员统计-机构基本情况统计 查询
  getPersonalStatisticsList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getOrgStatusList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 机构人员统计-人员工作情况统计 查询
  getPersonalWorkStatisticsList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/getUserStatusList`,
      method: 'POST',
      data,
    }).then((res) => {
      return res.data
    })
  }

  // 机构人员统计 导出
  exportPersonalStatisticsList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportOrgStatusList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  // 机构人员统计 导出
  exportPersonalWorkStatisticsList(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportUserStatusList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  //  整改发现列表导出
  exportAuditfindData(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iam-statistics/exportFindRectifyList`,
      method: 'POST',
      data,
      responseType: 'blob',
    }).then((res) => {
      return res.data
    })
  }

  // 根据parentId获取审计发现类别
  getFindAuditTree(parentId) {
    return axios({
      url: `api/xcoa-mobile/v1/audit-report-find/find-audit-tree?parentId=${parentId}`,
      method: 'post',
    })
  }

  // 获取审计发现类别统计--仅在审计发现类别使用
  getReportFindList(params) {
    return axios({
      method: 'post',
      url: 'api/xcoa-mobile/v1/iam-statistics/getReportFindList',
      data: params,
    })
  }
}

export default new StatisticsService()
