"use strict";

function _typeof(t) {
  return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
    return typeof t
  } : function(t) {
    return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  })(t)
}
Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.downloadIecTmpl = exports.deleteIecChannelPoint = exports.getIecChannelPoint = exports.deletePoint = exports.addPoint = exports.deleteChannelPoint = exports.getChannelPoint = exports.deleteChannel = exports.createChannel = exports.getChannelByType = exports.fetchTopoDeviceAction = exports.fetchCapacityInterfaceAction = exports.fetchTopoEquipmentAction = exports.fetchAllTemplatOrEqpQuotaPropertyAction = exports.addEditEquipmentAction = exports.fetchTemplatOrEqpQuotaPropertyAction = exports.fetchTemplatOrEqpQuotaAction = exports.fetchCapacityListInfoAction = exports.deleteEquipmentTemplateAction = exports.deleteEquipmentAction = exports.editEquipmentNameAction = exports.fetchTemplatOrEqpIntfcAction = exports.fetchTemplatEquipmentsAction = exports.fetchTemplateStatisticsAction = void 0;
var _urlFormat = _interopRequireDefault(require("amos-processor/lib/utils/urlFormat")),
  _urlConsts = _interopRequireWildcard(require("../consts/urlConsts")),
  _request = require("../utils/request");

function _getRequireWildcardCache() {
  if ("function" != typeof WeakMap) return null;
  var t = new WeakMap;
  return _getRequireWildcardCache = function() {
    return t
  }, t
}

function _interopRequireWildcard(t) {
  if (t && t.__esModule) return t;
  if (null === t || "object" !== _typeof(t) && "function" != typeof t) return {
    default: t
  };
  var e = _getRequireWildcardCache();
  if (e && e.has(t)) return e.get(t);
  var n, o, r = {},
    c = Object.defineProperty && Object.getOwnPropertyDescriptor;
  for (n in t) Object.prototype.hasOwnProperty.call(t, n) && ((o = c ? Object.getOwnPropertyDescriptor(t, n) : null) && (o.get || o.set) ? Object.defineProperty(r, n, o) : r[n] = t[n]);
  return r.default = t, e && e.set(t, r), r
}

function _interopRequireDefault(t) {
  return t && t.__esModule ? t : {
    default: t
  }
}
var fetchTemplateStatisticsAction = function(t) {
  return (0, _request.commonPost)(_urlConsts.default.fetchTemplateStatistics, t)
};
exports.fetchTemplateStatisticsAction = fetchTemplateStatisticsAction;
var fetchTemplatEquipmentsAction = function(t, e) {
  t = "".concat(_urlConsts.default.fetchTemplatEquipments, "/").concat(t);
  return (0, _request.commonPost)(t, e)
};
exports.fetchTemplatEquipmentsAction = fetchTemplatEquipmentsAction;
var fetchTemplatOrEqpIntfcAction = function(t, e) {
  e = void 0 === e ? 0 : e;
  e = "".concat(_urlConsts.default.fetchTemplatOrEqpIntfc, "/").concat(t, "/").concat(e, "/intfcs");
  return (0, _request.commonGet)(e)
};
exports.fetchTemplatOrEqpIntfcAction = fetchTemplatOrEqpIntfcAction;
var editEquipmentNameAction = function(t) {
  return (0, _request.commonPost)(_urlConsts.default.editEquipmentName, t)
};
exports.editEquipmentNameAction = editEquipmentNameAction;
var deleteEquipmentAction = function(t) {
  var e = "".concat(_urlConsts.default.delEquipmentById);
  return (0, _request.commonDelete)(e, t)
};
exports.deleteEquipmentAction = deleteEquipmentAction;
var deleteEquipmentTemplateAction = function(t) {
  t = "".concat(_urlConsts.default.deleteDeviceById, "/").concat(t);
  return (0, _request.commonDelete)(t)
};
exports.deleteEquipmentTemplateAction = deleteEquipmentTemplateAction;
var fetchCapacityListInfoAction = function(t) {
  t = "".concat(_urlConsts.default.fetchCapacityListInfoById, "/").concat(t);
  return (0, _request.commonGet)(t)
};
exports.fetchCapacityListInfoAction = fetchCapacityListInfoAction;
var fetchTemplatOrEqpQuotaAction = function(t, e) {
  e = void 0 === e ? 0 : e;
  e = "".concat(_urlConsts.default.fetchTemplatOrEqpQuota, "/").concat(t, "/").concat(e, "/cpbls");
  return (0, _request.commonGet)(e)
};
exports.fetchTemplatOrEqpQuotaAction = fetchTemplatOrEqpQuotaAction;
var fetchTemplatOrEqpQuotaPropertyAction = function(t, e) {
  t = void 0 === t ? 0 : t;
  e = "".concat(_urlConsts.default.fetchTemplatOrEqpQuota, "/").concat(t, "/").concat(e, "/cpblAttrs");
  return (0, _request.commonGet)(e)
};
exports.fetchTemplatOrEqpQuotaPropertyAction = fetchTemplatOrEqpQuotaPropertyAction;
var addEditEquipmentAction = function(t) {
  return (0, _request.commonPost)(_urlConsts.default.addEditEquipment, t)
};
exports.addEditEquipmentAction = addEditEquipmentAction;
var fetchAllTemplatOrEqpQuotaPropertyAction = function(t, e) {
  e = void 0 === e ? 0 : e;
  e = "".concat(_urlConsts.default.fetchTemplatOrEqpQuota, "/").concat(t, "/").concat(e, "/eqpCpblAttrs");
  return (0, _request.commonGet)(e)
};
exports.fetchAllTemplatOrEqpQuotaPropertyAction = fetchAllTemplatOrEqpQuotaPropertyAction;
var fetchTopoEquipmentAction = function(t) {
  return (0, _request.commonPost)(_urlConsts.default.getRealDevice, t)
};
exports.fetchTopoEquipmentAction = fetchTopoEquipmentAction;
var fetchCapacityInterfaceAction = function(t) {
  t = "".concat(_urlConsts.default.fetchCapacityInterface, "/").concat(t);
  return (0, _request.commonGet)(t)
};
exports.fetchCapacityInterfaceAction = fetchCapacityInterfaceAction;
var fetchTopoDeviceAction = function(t) {
  t = "".concat(_urlConsts.default.fetchTopoDevice, "/").concat(t);
  return (0, _request.commonGet)(t)
};
exports.fetchTopoDeviceAction = fetchTopoDeviceAction;
var getChannelByType = function(t) {
  t = (0, _urlFormat.default)(_urlConsts.IecUrl.channelListUrl, {
    type: t
  });
  return (0, _request.commonGet)(t)
};
exports.getChannelByType = getChannelByType;
var createChannel = function(t) {
  return (0, _request.commonPost)(_urlConsts.IecUrl.channelUrl, t)
};
exports.createChannel = createChannel;
var deleteChannel = function(t) {
  t = (0, _urlFormat.default)(_urlConsts.IecUrl.deleteChannelUrl, {
    id: t
  });
  return (0, _request.commonDelete)(t)
};
exports.deleteChannel = deleteChannel;
var getChannelPoint = function(t) {
  t = (0, _urlFormat.default)(_urlConsts.IecUrl.channelPointUrl, {
    channel: t
  });
  return (0, _request.commonGet)(t)
};
exports.getChannelPoint = getChannelPoint;
var deleteChannelPoint = function(t) {
  t = (0, _urlFormat.default)(_urlConsts.IecUrl.channelPointUrl, {
    channel: t
  });
  return (0, _request.commonDelete)(t)
};
exports.deleteChannelPoint = deleteChannelPoint;
var addPoint = function(t) {
  return (0, _request.commonPost)(_urlConsts.IecUrl.pointUrl, t)
};
exports.addPoint = addPoint;
var deletePoint = function(t) {
  t = (0, _urlFormat.default)(_urlConsts.IecUrl.deletePointUrl, {
    ids: t
  });
  return (0, _request.commonDelete)(t)
};
exports.deletePoint = deletePoint;
var getIecChannelPoint = function(t, e) {
  e = (0, _urlFormat.default)(_urlConsts.IecUrl.iecChannelPointUrl, {
    channelNo: t,
    pointType: e
  });
  return (0, _request.commonGet)(e)
};
exports.getIecChannelPoint = getIecChannelPoint;
var deleteIecChannelPoint = function(t, e) {
  e = (0, _urlFormat.default)(_urlConsts.IecUrl.iecChannelPointUrl, {
    channelNo: t,
    pointType: e
  });
  return (0, _request.commonDelete)(e)
};
exports.deleteIecChannelPoint = deleteIecChannelPoint;
var downloadIecTmpl = function() {
  var t = document.createElement("a");
  t.href = _urlConsts.IecUrl.iecDownloadIecTmplUrl, t.click()
};
exports.downloadIecTmpl = downloadIecTmpl;
