"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"), _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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"), fetchTemplateStatisticsAction = function(t) {
    return (0, _request.commonPost)(_urlConsts.default.fetchTemplateStatistics, t);
};

exports.fetchTemplateStatisticsAction = fetchTemplateStatisticsAction;

var fetchTemplatEquipmentsAction = function(t, e) {
    var n = "".concat(_urlConsts.default.fetchTemplatEquipments, "/").concat(t);
    return (0, _request.commonPost)(n, e);
};

exports.fetchTemplatEquipmentsAction = fetchTemplatEquipmentsAction;

var fetchTemplatOrEqpIntfcAction = function(t, e) {
    e = void 0 === e ? 0 : e;
    var n = "".concat(_urlConsts.default.fetchTemplatOrEqpIntfc, "/").concat(t, "/").concat(e, "/intfcs");
    return (0, _request.commonGet)(n);
};

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) {
    var e = "".concat(_urlConsts.default.deleteDeviceById, "/").concat(t);
    return (0, _request.commonDelete)(e);
};

exports.deleteEquipmentTemplateAction = deleteEquipmentTemplateAction;

var fetchCapacityListInfoAction = function(t) {
    var e = "".concat(_urlConsts.default.fetchCapacityListInfoById, "/").concat(t);
    return (0, _request.commonGet)(e);
};

exports.fetchCapacityListInfoAction = fetchCapacityListInfoAction;

var fetchTemplatOrEqpQuotaAction = function(t, e) {
    e = void 0 === e ? 0 : e;
    var n = "".concat(_urlConsts.default.fetchTemplatOrEqpQuota, "/").concat(t, "/").concat(e, "/cpbls");
    return (0, _request.commonGet)(n);
};

exports.fetchTemplatOrEqpQuotaAction = fetchTemplatOrEqpQuotaAction;

var fetchTemplatOrEqpQuotaPropertyAction = function(t, e) {
    t = void 0 === t ? 0 : t;
    var n = "".concat(_urlConsts.default.fetchTemplatOrEqpQuota, "/").concat(t, "/").concat(e, "/cpblAttrs");
    return (0, _request.commonGet)(n);
};

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;
    var n = "".concat(_urlConsts.default.fetchTemplatOrEqpQuota, "/").concat(t, "/").concat(e, "/eqpCpblAttrs");
    return (0, _request.commonGet)(n);
};

exports.fetchAllTemplatOrEqpQuotaPropertyAction = fetchAllTemplatOrEqpQuotaPropertyAction;

var fetchTopoEquipmentAction = function(t) {
    return (0, _request.commonPost)(_urlConsts.default.getRealDevice, t);
};

exports.fetchTopoEquipmentAction = fetchTopoEquipmentAction;

var fetchCapacityInterfaceAction = function(t) {
    var e = "".concat(_urlConsts.default.fetchCapacityInterface, "/").concat(t);
    return (0, _request.commonGet)(e);
};

exports.fetchCapacityInterfaceAction = fetchCapacityInterfaceAction;

var fetchTopoDeviceAction = function(t) {
    var e = "".concat(_urlConsts.default.fetchTopoDevice, "/").concat(t);
    return (0, _request.commonGet)(e);
};

exports.fetchTopoDeviceAction = fetchTopoDeviceAction;

var getChannelByType = function(t) {
    var e = (0, _urlFormat.default)(_urlConsts.IecUrl.channelListUrl, {
        type: t
    });
    return (0, _request.commonGet)(e);
};

exports.getChannelByType = getChannelByType;

var createChannel = function(t) {
    return (0, _request.commonPost)(_urlConsts.IecUrl.channelUrl, t);
};

exports.createChannel = createChannel;

var deleteChannel = function(t) {
    var e = (0, _urlFormat.default)(_urlConsts.IecUrl.deleteChannelUrl, {
        id: t
    });
    return (0, _request.commonDelete)(e);
};

exports.deleteChannel = deleteChannel;

var getChannelPoint = function(t) {
    var e = (0, _urlFormat.default)(_urlConsts.IecUrl.channelPointUrl, {
        channel: t
    });
    return (0, _request.commonGet)(e);
};

exports.getChannelPoint = getChannelPoint;

var deleteChannelPoint = function(t) {
    var e = (0, _urlFormat.default)(_urlConsts.IecUrl.channelPointUrl, {
        channel: t
    });
    return (0, _request.commonDelete)(e);
};

exports.deleteChannelPoint = deleteChannelPoint;

var addPoint = function(t) {
    return (0, _request.commonPost)(_urlConsts.IecUrl.pointUrl, t);
};

exports.addPoint = addPoint;

var deletePoint = function(t) {
    var e = (0, _urlFormat.default)(_urlConsts.IecUrl.deletePointUrl, {
        ids: t
    });
    return (0, _request.commonDelete)(e);
};

exports.deletePoint = deletePoint;

var getIecChannelPoint = function(t, e) {
    var n = (0, _urlFormat.default)(_urlConsts.IecUrl.iecChannelPointUrl, {
        channelNo: t,
        pointType: e
    });
    return (0, _request.commonGet)(n);
};

exports.getIecChannelPoint = getIecChannelPoint;

var deleteIecChannelPoint = function(t, e) {
    var n = (0, _urlFormat.default)(_urlConsts.IecUrl.iecChannelPointUrl, {
        channelNo: t,
        pointType: e
    });
    return (0, _request.commonDelete)(n);
};

exports.deleteIecChannelPoint = deleteIecChannelPoint;

var downloadIecTmpl = function() {
    var t = document.createElement("a");
    t.href = _urlConsts.IecUrl.iecDownloadIecTmplUrl, t.click();
};

exports.downloadIecTmpl = downloadIecTmpl;