import request from '@/utils/request';

// 基本信息
export function getBasicData(data) {
  var param = '?month=' + data.month;
  if (data.projectId != undefined) {
    param += '&projectId=' + data.projectId;
  }
  return request({
    url: '/overview/basic' + param,
    method: 'get',
    data,
  });
}

// 能耗指标
export function getConsumptionData(data) {
  var param = '?start=' + data.start + '&end=' + data.end;
  if (data.projectId != undefined) {
    param += '&projectId=' + data.projectId;
  }
  return request({
    url: '/overview/energyConsumption' + param,
    method: 'get',
    data,
  });
}
// 运维信息-巡检填报统计
export function getInspectionData(data) {
  var param = '?start=' + data.start + '&end=' + data.end;
  if (data.projectId != undefined) {
    param += '&projectId=' + data.projectId;
  }
  return request({
    url: '/overview/inspection' + param,
    method: 'get',
    data,
  });
}

// 运维信息-告警统计
export function getAlarmData(data) {
  var param = '?start=' + data.start + '&end=' + data.end;
  if (data.projectId != undefined) {
    param += '&projectId=' + data.projectId;
  }
  return request({
    url: '/overview/alarm' + param,
    method: 'get',
    data,
  });
}
// 运维信息-任务工单统计
export function getTaskData(data) {
  var param = '?start=' + data.start + '&end=' + data.end;
  if (data.projectId != undefined) {
    param += '&projectId=' + data.projectId;
  }
  return request({
    url: '/overview/task' + param,
    method: 'get',
    data,
  });
}
// 考勤统计
export function getAttendanceData(data) {
  var param = '?start=' + data.start + '&end=' + data.end;
  if (data.projectId != undefined) {
    param += '&projectId=' + data.projectId;
  }
  return request({
    url: '/overview/attendance' + param,
    method: 'get',
    data,
  });
}
