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

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}/PandaCore/GCK/SketchPad/List`,
    method: REQUEST_METHOD_GET,
    header: { 'content-type': 'application/x-www-form-urlencoded' },
    params,
  });
}

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

// 获取点表地址信息
export function getPointAddress(params) {
  return request({
    url: `${baseURI}/PandaCore/GCK/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}/PandaCore/GCK/Device/DeviceRealInfo`,
    method: REQUEST_METHOD_POST,
    data,
  });
}
