import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReportPointSteamVO, ReportPointSteamForm, ReportPointSteamQuery } from '@/api/ems/report/types';

/**
 * 查询蒸汽点位报表列表
 */
export function listReportPointSteam(query: ReportPointSteamQuery): AxiosPromise<ReportPointSteamVO[]> {
  return request({
    url: '/ems/report/reportPointSteam/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询蒸汽点位报表详细
 */
export function getReportPointSteam(objId: string | number): AxiosPromise<ReportPointSteamVO> {
  return request({
    url: '/ems/report/reportPointSteam/' + objId,
    method: 'get'
  });
}

/**
 * 生成蒸汽点位报表
 */
export function generateReportPointSteam(data: ReportPointSteamForm) {
  return request({
    url: '/ems/report/reportPointSteam/generate',
    method: 'post',
    data: data
  });
}

/**
 * 导出蒸汽点位报表
 */
export function exportReportPointSteam(query: ReportPointSteamQuery) {
  return request({
    url: '/ems/report/reportPointSteam/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  });
}

// 查询蒸汽整点数据（曲线）
export function pointSteamInstantList(query) {
  return request({
    url: '/ems/report/reportPointSteam/pointSteamInstantList',
    method: 'get',
    params: query
  })
}

// 新增蒸汽整点数据
export function addReportPointSteam(data: ReportPointSteamForm): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointSteam',
    method: 'post',
    data: data
  });
}

// 修改蒸汽整点数据
export function updateReportPointSteam(data: ReportPointSteamForm): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointSteam',
    method: 'put',
    data: data
  });
}

// 删除蒸汽整点数据
export function delReportPointSteam(objId: string | number | Array<string | number>): AxiosPromise<any> {
  return request({
    url: '/ems/report/reportPointSteam/' + objId,
    method: 'delete'
  });
}
