@zpc_npm/vue-iclient-common
Version:
KQGIS iClient for Vue.js
299 lines (264 loc) • 12.4 kB
JavaScript
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* reexport */ ToolBar; }
});
;// CONCATENATED MODULE: external "vue"
var external_vue_namespaceObject = require("vue");
;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/_utils/util"
var util_namespaceObject = require("@zpc_npm/vue-iclient-common/_utils/util");
;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-icons"
var vue_iclient_icons_namespaceObject = require("@zpc_npm/vue-iclient-icons");
;// CONCATENATED MODULE: external "@element-plus/icons-vue"
var icons_vue_namespaceObject = require("@element-plus/icons-vue");
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/common/toolbar/ToolBar.vue?vue&type=script&setup=true&lang=js
const _hoisted_1 = {
class: "kq-tool-bar-wrap"
};
const __default__ = {
name: "KqToolBar"
};
/* harmony default export */ var ToolBarvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
props: {
show: {
type: Boolean,
default: true
},
showShadow: {
type: Boolean,
default: false
},
/**
* 例:"center","topLeft","topRight","bottomLeft","bottomRight", "topCenter", "bottomCenter" {top:'16px',left:'16px'}, {top:16,left:16}
*/
position: [String, Object],
tools: {
type: Array,
default: () => [{
value: "search",
type: "menu",
title: "查询",
icon: (0,external_vue_namespaceObject.markRaw)(icons_vue_namespaceObject.Search),
children: [{
value: "featureIdentify",
title: "要素识别",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconFeatureIdentify)
}, {
value: "advQuery",
title: "高级查询",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconAdvancedQuery)
}]
}, {
value: "legend",
type: "menu",
title: "图例",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconLegend)
}, {
value: "contrast",
type: "menu",
title: "对比",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconContrast),
children: [{
value: "twoWin",
title: "二窗口",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconTwoWin)
}, {
value: "fourWin",
title: "四窗口",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconFourWin)
}, {
value: "opacity",
title: "透明度",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconOpacity)
}, {
value: "roller",
title: "卷帘",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconRoller)
}]
}, {
value: "map",
type: "menu",
title: "地图",
icon: (0,external_vue_namespaceObject.markRaw)(vue_iclient_icons_namespaceObject.IconMap)
}]
}
},
emits: ["select"],
setup(__props, {
emit
}) {
const props = __props; // 组件容器Ref
let boxRef = (0,external_vue_namespaceObject.ref)(null);
/**
* @description 监听工具条选择变化
* @param {string} key - 选择的当前工具
* @param {string} keyPath - 选择工具集合
*/
const onSelect = (key, keyPath) => {
console.log(key, keyPath);
emit("select", key);
};
(0,external_vue_namespaceObject.onMounted)(() => {
(0,util_namespaceObject.updatePosition)(boxRef.value, props);
});
return (_ctx, _cache) => {
const _component_kq_icon = (0,external_vue_namespaceObject.resolveComponent)("kq-icon");
const _component_kq_menu_item = (0,external_vue_namespaceObject.resolveComponent)("kq-menu-item");
const _component_kq_sub_menu = (0,external_vue_namespaceObject.resolveComponent)("kq-sub-menu");
const _component_kq_menu = (0,external_vue_namespaceObject.resolveComponent)("kq-menu");
return (0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createElementBlock)("section", {
class: (0,external_vue_namespaceObject.normalizeClass)(["kq-tool-bar", __props.showShadow ? 'shadow' : null]),
ref_key: "boxRef",
ref: boxRef
}, [(0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
name: "slide-fade",
persisted: ""
}, {
default: (0,external_vue_namespaceObject.withCtx)(() => [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createElementVNode)("div", _hoisted_1, [(0,external_vue_namespaceObject.renderSlot)(_ctx.$slots, "default"), (0,external_vue_namespaceObject.createVNode)(_component_kq_menu, {
class: "kq-menu-wrap",
mode: "horizontal",
onSelect: onSelect,
ellipsis: false,
"unique-opened": true
}, {
default: (0,external_vue_namespaceObject.withCtx)(() => [((0,external_vue_namespaceObject.openBlock)(true), (0,external_vue_namespaceObject.createElementBlock)(external_vue_namespaceObject.Fragment, null, (0,external_vue_namespaceObject.renderList)(__props.tools, (item, index) => {
return (0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createElementBlock)("div", {
key: index
}, [!item.children ? ((0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createBlock)(_component_kq_menu_item, {
key: 0,
index: item.value
}, {
default: (0,external_vue_namespaceObject.withCtx)(() => [(0,external_vue_namespaceObject.createVNode)(_component_kq_icon, null, {
default: (0,external_vue_namespaceObject.withCtx)(() => [((0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createBlock)((0,external_vue_namespaceObject.resolveDynamicComponent)(item.icon)))]),
_: 2
/* DYNAMIC */
}, 1024
/* DYNAMIC_SLOTS */
), (0,external_vue_namespaceObject.createTextVNode)(" " + (0,external_vue_namespaceObject.toDisplayString)(item.title), 1
/* TEXT */
)]),
_: 2
/* DYNAMIC */
}, 1032
/* PROPS, DYNAMIC_SLOTS */
, ["index"])) : item.children ? ((0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createBlock)(_component_kq_sub_menu, {
key: 1,
index: item.value,
"popper-append-to-body": false
}, {
title: (0,external_vue_namespaceObject.withCtx)(() => [(0,external_vue_namespaceObject.createVNode)(_component_kq_icon, null, {
default: (0,external_vue_namespaceObject.withCtx)(() => [((0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createBlock)((0,external_vue_namespaceObject.resolveDynamicComponent)(item.icon)))]),
_: 2
/* DYNAMIC */
}, 1024
/* DYNAMIC_SLOTS */
), (0,external_vue_namespaceObject.createTextVNode)(" " + (0,external_vue_namespaceObject.toDisplayString)(item.title), 1
/* TEXT */
)]),
default: (0,external_vue_namespaceObject.withCtx)(() => [((0,external_vue_namespaceObject.openBlock)(true), (0,external_vue_namespaceObject.createElementBlock)(external_vue_namespaceObject.Fragment, null, (0,external_vue_namespaceObject.renderList)(item.children, (childItem, idx) => {
return (0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createBlock)(_component_kq_menu_item, {
index: childItem.value,
key: idx
}, {
default: (0,external_vue_namespaceObject.withCtx)(() => [(0,external_vue_namespaceObject.createVNode)(_component_kq_icon, null, {
default: (0,external_vue_namespaceObject.withCtx)(() => [((0,external_vue_namespaceObject.openBlock)(), (0,external_vue_namespaceObject.createBlock)((0,external_vue_namespaceObject.resolveDynamicComponent)(childItem.icon)))]),
_: 2
/* DYNAMIC */
}, 1024
/* DYNAMIC_SLOTS */
), (0,external_vue_namespaceObject.createTextVNode)(" " + (0,external_vue_namespaceObject.toDisplayString)(childItem.title), 1
/* TEXT */
)]),
_: 2
/* DYNAMIC */
}, 1032
/* PROPS, DYNAMIC_SLOTS */
, ["index"]);
}), 128
/* KEYED_FRAGMENT */
))]),
_: 2
/* DYNAMIC */
}, 1032
/* PROPS, DYNAMIC_SLOTS */
, ["index"])) : (0,external_vue_namespaceObject.createCommentVNode)("v-if", true)]);
}), 128
/* KEYED_FRAGMENT */
))]),
_: 1
/* STABLE */
})], 512
/* NEED_PATCH */
), [[external_vue_namespaceObject.vShow, __props.show]])]),
_: 3
/* FORWARDED */
})], 2
/* CLASS */
);
};
}
}));
;// CONCATENATED MODULE: ./src/common/toolbar/ToolBar.vue?vue&type=script&setup=true&lang=js
;// CONCATENATED MODULE: ./src/common/toolbar/ToolBar.vue
const __exports__ = ToolBarvue_type_script_setup_true_lang_js;
/* harmony default export */ var ToolBar = (__exports__);
;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/init.js"
var init_js_namespaceObject = require("@zpc_npm/vue-iclient-common/init.js");
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
;// CONCATENATED MODULE: ./src/common/toolbar/index.js
ToolBar.install = (Vue, opts) => {
init_js_default()(Vue, opts);
Vue.component(ToolBar.name, ToolBar);
};
module.exports = __webpack_exports__;
/******/ })()
;