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

/**
 * 导出报表
 * page func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function getChartReport (parameter) {
  return axios({
    url: parameter.sqlVal,
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 导出模板报表
 * export file
 * parameter: { }
 * @param parameter :
  * @returns {*}
 */
export function exportChartReport (parameter) {
  return axios({
    url: parameter.url + '/export?' + stringify(parameter),
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    responseType: 'blob'
  })
}