import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReportPointIOTVO, ReportPointIOTForm, ReportPointIOTQuery } from '@/api/ems/report/types';

/**
 * 查询IOT点位报表列表
 */
export function listReportPointIOT(query: ReportPointIOTQuery): AxiosPromise<ReportPointIOTVO[]> {
  return request({
    url: '/ems/report/reportPointIOT/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询IOT点位报表详细
 */
export function getReportPointIOT(objId: string | number): AxiosPromise<ReportPointIOTVO> {
  return request({
    url: '/ems/report/reportPointIOT/' + objId,
    method: 'get'
  });
}

/**
 * 生成IOT点位报表
 */
export function generateReportPointIOT(data: ReportPointIOTForm) {
  return request({
    url: '/ems/report/reportPointIOT/generate',
    method: 'post',
    data: data
  });
}

/**
 * 导出IOT点位报表
 */
export function exportReportPointIOT(query: ReportPointIOTQuery) {
  return request({
    url: '/ems/report/reportPointIOT/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
}
