import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReportPointDnbVO, ReportPointDnbForm, ReportPointDnbQuery } from '@/api/ems/report/types';

/**
 * 查询DNB点位报表列表
 */
export function listReportPointDnb(query: ReportPointDnbQuery): AxiosPromise<ReportPointDnbVO[]> {
  return request({
    url: '/ems/report/reportPointDnb/list',
    method: 'get',
    params: query
  });
}

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

/**
 * 生成DNB点位报表
 */
export function generateReportPointDnb(data: ReportPointDnbForm) {
  return request({
    url: '/ems/report/reportPointDnb/generate',
    method: 'post',
    data: data
  });
}

/**
 * 新增DNB点位报表
 */
export function addReportPointDnb(data: ReportPointDnbForm): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointDnb',
    method: 'post',
    data: data
  });
}

/**
 * 修改DNB点位报表
 */
export function updateReportPointDnb(data: ReportPointDnbForm): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointDnb',
    method: 'put',
    data: data
  });
}

/**
 * 删除DNB点位报表
 */
export function delReportPointDnb(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointDnb/' + objId,
    method: 'delete'
  });
}

/**
 * 导出DNB点位报表
 */
export function exportReportPointDnb(query: ReportPointDnbQuery) {
  return request({
    url: '/ems/report/reportPointDnb/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
}
