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)
|
}
|
|
function ownKeys(e, t) {
|
var n, r = Object.keys(e);
|
return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(e), t && (n = n.filter(function(t) {
|
return Object.getOwnPropertyDescriptor(e, t).enumerable
|
})), r.push.apply(r, n)), r
|
}
|
|
function _objectSpread(e) {
|
for (var t = 1; t < arguments.length; t++) {
|
var n = null != arguments[t] ? arguments[t] : {};
|
t % 2 ? ownKeys(Object(n), !0).forEach(function(t) {
|
_defineProperty(e, t, n[t])
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
ownKeys(Object(n)).forEach(function(t) {
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
|
})
|
}
|
return e
|
}
|
|
function _defineProperty(t, e, n) {
|
return e in t ? Object.defineProperty(t, e, {
|
value: n,
|
enumerable: !0,
|
configurable: !0,
|
writable: !0
|
}) : t[e] = n, t
|
}
|
|
function _classCallCheck(t, e) {
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
|
}
|
|
function _defineProperties(t, e) {
|
for (var n = 0; n < e.length; n++) {
|
var r = e[n];
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object
|
.defineProperty(t, r.key, r)
|
}
|
}
|
|
function _createClass(t, e, n) {
|
return e && _defineProperties(t.prototype, e), n && _defineProperties(t, n), t
|
}
|
|
function _inherits(t, e) {
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
t.prototype = Object.create(e && e.prototype, {
|
constructor: {
|
value: t,
|
writable: !0,
|
configurable: !0
|
}
|
}), e && _setPrototypeOf(t, e)
|
}
|
|
function _setPrototypeOf(t, e) {
|
return (_setPrototypeOf = Object.setPrototypeOf || function(t, e) {
|
return t.__proto__ = e, t
|
})(t, e)
|
}
|
|
function _createSuper(n) {
|
var r = _isNativeReflectConstruct();
|
return function() {
|
var t, e = _getPrototypeOf(n);
|
return _possibleConstructorReturn(this, r ? (t = _getPrototypeOf(this).constructor, Reflect.construct(e,
|
arguments, t)) : e.apply(this, arguments))
|
}
|
}
|
|
function _possibleConstructorReturn(t, e) {
|
if (e && ("object" === _typeof(e) || "function" == typeof e)) return e;
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
return _assertThisInitialized(t)
|
}
|
|
function _assertThisInitialized(t) {
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
return t
|
}
|
|
function _isNativeReflectConstruct() {
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
if (Reflect.construct.sham) return !1;
|
if ("function" == typeof Proxy) return !0;
|
try {
|
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0
|
} catch (t) {
|
return !1
|
}
|
}
|
|
function _getPrototypeOf(t) {
|
return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
|
return t.__proto__ || Object.getPrototypeOf(t)
|
})(t)
|
}! function(f) {
|
var t = function() {
|
"use strict";
|
_inherits(e, f.widget.BaseWidget);
|
var t = _createSuper(e);
|
|
function e() {
|
return _classCallCheck(this, e), t.apply(this, arguments)
|
}
|
return _createClass(e, [{
|
key: "resources",
|
get: function() {
|
return ["view.css"]
|
}
|
}, {
|
key: "view",
|
get: function() {
|
return {
|
type: "append",
|
url: "view.html",
|
parent: "#centerDiv"
|
}
|
}
|
}, {
|
key: "create",
|
value: function() {
|
this.data = this.config.data || [{
|
name: "业务图层",
|
icon: "fa fa-tasks",
|
widget: "widgets/manageLayers/widget.js"
|
}]
|
}
|
}, {
|
key: "winCreateOK",
|
value: function(t, e) {
|
var n, r;
|
"append" == t.type && (n = this.data, !haoutil.system.isPCBroswer() && 3 == n
|
.length && n[0].children && (r = n.shift(), t = n.shift(), n[0].children
|
.insert(t, 0), n[0].children.insert(r, 0)), this.initMenu(n))
|
}
|
}, {
|
key: "initMenu",
|
value: function(t) {
|
for (var e = {}, n = "", r = 0, o = t.length; r < o; r++) {
|
var i = t[r];
|
if (!i.hasOwnProperty("visible") || i.visible)
|
if (i.children) {
|
n += '<div class="btn-group">\n <button type="button" class="btn btn-link toolBarRight-btn dropdown-toggle" data-toggle="dropdown" aria-expanded="false" >\n <i class="'
|
.concat(i.icon, '"></i>').concat(i.name,
|
'<span class="caret"></span>\n </button>\n <ul class="dropdown-menu dropdown-menu-right toolBarRight-dropdown-menu" >'
|
);
|
for (var c = 0, a = i.children.length; c < a; c++) {
|
var s, u = i.children[c];
|
u.hasOwnProperty("visible") && !u.visible || (s = "", u.onclick ?
|
s = 'onclick="' + u.onclick + '"' : u.widget && (s =
|
'data-widget="' + u.widget + '"'), n +=
|
'<li class="widget-btn" '.concat(s,
|
' >\n <a href="javascript:void(0)"><i class="'
|
).concat(u.icon, '"></i>').concat(u.name,
|
"</a>\n </li>"), e[u.widget] = u)
|
}
|
n += " </ul></div>"
|
} else {
|
var l = "";
|
i.onclick ? l = 'onclick="' + i.onclick + '"' : i.widget && (l =
|
'data-widget="' + i.widget + '"'), n +=
|
'<button type="button" class="widget-btn btn btn-link toolBarRight-btn " '
|
.concat(l, ' > <i class="').concat(i.icon,
|
'"></i>').concat(i.name, "\n </button>"), e[i
|
.widget] = i
|
}
|
}
|
$(".toolBarRight").html(n), $(".toolBarRight .widget-btn").click(function() {
|
var t = $(this).attr("data-widget");
|
haoutil.isutil.isNull(t) || (f.widget.isActivate(t) ? f.widget.disable(
|
t) : (t = _objectSpread(_objectSpread({}, e[t] || {}), {}, {
|
uri: t
|
}), f.widget.activate(t)))
|
})
|
}
|
}, {
|
key: "activate",
|
value: function() {}
|
}, {
|
key: "disable",
|
value: function() {}
|
}]), e
|
}();
|
f.widget.bindClass(t)
|
}((window, mars3d));
|