import request from '@/utils/request';

const path = {
  cableTimeList: 'api/sysMonitorAlarm/selectPage',
  cableConfirm: 'api/sysMonitorAlarm/confirm',
  cableCancel: 'api/sysMonitorAlarm/cancel',
  eliminate: 'api/sysMonitorAlarm/eliminate',
  deviceList: 'api/sysConnectAlarm/selectPage',
  deviceConfirm: 'api/sysConnectAlarm/confirm',
  deviceCancel: 'api/sysConnectAlarm/cancel',

  alarmConfirmStatusStatistics: 'api/sysMonitorAlarmStatistics/alarmConfirmStatusStatistics',
  alarmLevelStatistics: '/api/sysMonitorAlarmStatistics/alarmLevelStatistics',
  alarmLevelCountStatistics: '/api/sysMonitorAlarmStatistics/alarmLevelCountStatistics',
  selectPage: '/api/sysMonitorAlarmStatistics/selectPage',
  export: '/api/sysMonitorAlarmStatistics/export',
}

const blobConf = { responseType: 'blob' }
function requestBlob(url, params, config = {}) {
  return request.post(url, params, {
    ...config,
    ...blobConf
  })
}
export function cableTimeList() {
  return request.post(path.cableTimeList, ...arguments);
}
export function cableCancel() {
  return request.post(path.cableCancel, ...arguments);
}
export function cableConfirm() {
  return request.post(path.cableConfirm, ...arguments);
}
export function eliminate() {
  return request.post(path.eliminate, ...arguments);
}
export function deviceList() {
  return request.post(path.deviceList, ...arguments);
}
export function deviceConfirm() {
  return request.post(path.deviceConfirm, ...arguments);
}
export function deviceCancel() {
  return request.post(path.deviceCancel, ...arguments);
}

export function alarmConfirmStatusStatistics() {
  return request.post(path.alarmConfirmStatusStatistics, ...arguments);
}
export function alarmLevelStatistics() {
  return request.post(path.alarmLevelStatistics, ...arguments);
}
export function alarmLevelCountStatistics() {
  return request.post(path.alarmLevelCountStatistics, ...arguments);
}
export function selectPage() {
  return request.post(path.selectPage, ...arguments);
}
export function exportExcel() {
  return requestBlob(path.export, ...arguments)
}