index.js 920 Bytes
Newer Older
1 2 3 4 5 6 7
import { request } from '@wisdom-utils/utils';

const REQUEST_METHOD_GET = 'get';
const REQUEST_METHOD_POST = 'post';
// eslint-disable-next-line no-undef
const baseUrl = typeof DUMI_TYPE !== 'undefined' && DUMI_TYPE === 'dumi' ? '/api' : '';

8
const monitorDeviceUrl = `${baseUrl}/PandaMonitor/Monitor/Device`;
9 10 11
// 获取历史数据
export function getHistoryInfo(data) {
  return request({
12
    url: `${monitorDeviceUrl}/GetSensorsDataForStation`,
13 14 15 16
    method: REQUEST_METHOD_POST,
    data,
  });
}
17 18 19 20 21 22 23 24 25

// 获取指标报警方案配置
export function getDeviceAlarmScheme(option) {
  return request({
    url: `${monitorDeviceUrl}/GetDeviceAlarmScheme`,
    method: REQUEST_METHOD_POST,
    ...option,
  });
}
张瑶's avatar
张瑶 committed
26 27 28 29 30 31 32 33 34

// 导出设备指标历史数据
export function getExportDeviceHistoryUrl(data) {
  return request({
    url: `${monitorDeviceUrl}/ExportDeviceHistoryInfo`,
    method: REQUEST_METHOD_POST,
    data,
  });
}