import { request } from '@wisdom-utils/utils';

const REQUEST_METHOD_GET = 'get';
const REQUEST_METHOD_POST = 'post';
// eslint-disable-next-line no-undef
const baseURI = typeof DUMI_TYPE !== 'undefined' && DUMI_TYPE === 'dumi' ? '/api' : '';
// 获取画板列表接口
export function getSketchPadList(params) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/SketchPad/List`,
    method: REQUEST_METHOD_GET,
    header: { 'content-type': 'application/x-www-form-urlencoded' },
    params,
  });
}

// 获取画板JSON
export function getSketchPadContent(params) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/SketchPad/SketchContent`,
    method: REQUEST_METHOD_GET,
    params,
  });
}

// 获取点表地址信息
export function getPointAddress(params) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/PointAddress/GetPointAddress`,
    method: REQUEST_METHOD_GET,
    params,
  });
}

// 获取数据字典
export function getDictionaryList(params) {
  return request({
    url: `${baseURI}/PandaOMS/OMS/DataManger/GetDataDictionaryList`,
    method: REQUEST_METHOD_GET,
    params,
  });
}

// 获取设备实时数据
export function getDeviceRealInfo(data) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/Device/DeviceRealInfo`,
    method: REQUEST_METHOD_POST,
    data,
  });
}

// 获取历史数据
export function getHistoryInfo(data) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/Device/GetSensorsDataForStation`,
    method: REQUEST_METHOD_POST,
    data,
  });
}

// 获取视频通道详情
export function getVideoDetail(params) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/Video/GetVideoPlayListByDeviceCode`,
    method: REQUEST_METHOD_GET,
    params,
  });
}

// 获取统计数据
export function getStatisticsInfo(data) {
  return request({
    url: `${baseURI}/PandaMonitor/Monitor/Device/EquipmentDataReports`,
    method: REQUEST_METHOD_POST,
    data,
  });
}