import { axios } from '@/utils/request'
import { stringify } from 'qs'

/**
 * page func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function getMonthReport (parameter) {
  return axios({
    url: '/report/check/jobs?' + stringify(parameter),
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * export file
 * parameter: { }
 * @param parameter :
  * @returns {*}
 */
export function exportMonthReport (parameter) {
  return axios({
    url: '/report/check/jobs/export?' + stringify(parameter),
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    responseType: 'blob'
  })
}

/**
 * page func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function getWeekReport (parameter) {
  return axios({
    url: '/report/check/jobs/week?' + stringify(parameter),
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * export file
 * parameter: { }
 * @param parameter :
  * @returns {*}
 */
export function exportWeekReport (parameter) {
  return axios({
    url: '/report/check/jobs/week/export?' + stringify(parameter),
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    responseType: 'blob'
  })
}
