import axios from '@/common/services/axios-instance'
class AuditPortraitService {
  // 获取所有指标
  getListMetricName(data) {
    return axios({
      url: 'api/xcoa-mobile/v1/iammodelmaintain/listMetricName',
      method: 'post',
      data,
    })
  }

  // 获取公司
  getCompanyList(data) {
    return axios({
      url: 'api/xcoa-mobile/v1/iammodelmaintain/listByMdgOrgCode',
      method: 'post',
      data,
    })
  }

  // 获取报表
  getReportList(data) {
    return axios({
      url: 'api/xcoa-mobile/v1/iammodelmaintain/listIndexValue',
      method: 'post',
      data,
    })
  }

  // 获取公司 、人员等详情信息/xcoa-mobile/v1/iammodelmaintain/selectCompanyInformation?mdgOrgCode=100190&year=2021
  getSelectCompanyInformation(data) {
    return axios({
      url: `api/xcoa-mobile/v1/iammodelmaintain/selectCompanyInformation?mdgOrgCode=${data.code}&year=${data.year}`,
      method: 'post',
    })
  }

  // 查询二三级组织单位数据
  // /iammodelmaintain/getGroupsByCode  mdgOrgCode lev POST  不是json格式的
  getGroupsByCode(data) {
    return axios({
      method: 'post',
      url:
        'api/xcoa-mobile/v1/iammodelmaintain/getGroupsByCode?mdgOrgCode=' +
        data.mdgOrgCode +
        '&lev=' +
        data.lev,
    })
  }

  // 获取有数的组织机构/iammodelmaintain/selectCompanyByYear  根据年份查询组织机构  POST 参数  year      @YYL
  getSelectCompany(data) {
    return axios({
      method: 'post',
      url: 'api/xcoa-mobile/v1/iammodelmaintain/selectCompanyByYear?year=' + data,
    })
  }

  // 通用接口
  // http://localhost:8080/-app-/api/xcoa-mobile/v1/iam-page/businessList
  getBusinessList(data) {
    return axios({
      method: 'post',
      url: 'api/xcoa-mobile/v1/iam-page/businessList',
      data,
    })
  }

  // /listMetricCompare 指标对比
  listMetricCompare(data) {
    return axios({
      method: 'post',
      url: 'api/xcoa-mobile/v1/iammodelmaintain/listMetricCompare',
      data,
    })
  }

  // /iammodelmaintain/orgList
  // 获取有数据的公司
  getOrgList(data) {
    return axios({
      method: 'post',
      url: 'api/xcoa-mobile/v1/iammodelmaintain/orgList',
      data,
    })
  }

  // 采购管理里获取指标信息
  getPurchaseData(data) {
    return axios({
      method: 'post',
      url: 'api/xcoa-mobile/v1/iammodelmaintain//listIndexValueForBuy',
      data,
    })
  }
}
export default new AuditPortraitService()
