web-component-gallery 1.1.45 → 1.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amap.umd.js +102 -11
- package/dist/index.umd.js +102 -11
- package/dist/table.umd.js +2 -2
- package/dist/tree.umd.js +1 -1
- package/lib/amap/AmapDraw.jsx +16 -17
- package/lib/table/index.vue +1 -1
- package/lib/tree/Directory.js +1 -1
- package/package.json +1 -1
- package/plugins/lib/amap/AmapDraw.jsx +16 -17
- package/plugins/lib/table/index.vue +1 -1
- package/plugins/lib/tree/Directory.js +1 -1
- package/plugins/method/AMap.js +301 -250
- package/plugins/method/Theme.js +1 -1
- package/plugins/utils/Axios.js +105 -0
- package/plugins/utils/Request.js +38 -0
- package/plugins/utils/Tree.js +25 -25
- package/plugins/utils/Websocket.js +96 -152
- package/utils/Axios.js +105 -0
- package/utils/Request.js +38 -0
- package/utils/Tree.js +25 -25
- package/utils/Websocket.js +96 -152
- package/plugins/utils/flexible.js +0 -145
- package/utils/AutoFlexible.js +0 -39
- package/utils/flexible.js +0 -145
package/dist/amap.umd.js
CHANGED
|
@@ -19,6 +19,17 @@
|
|
|
19
19
|
return /******/ (function() { // webpackBootstrap
|
|
20
20
|
/******/ var __webpack_modules__ = ({
|
|
21
21
|
|
|
22
|
+
/***/ "./node_modules/@amap/amap-jsapi-loader/dist/index.js":
|
|
23
|
+
/*!************************************************************!*\
|
|
24
|
+
!*** ./node_modules/@amap/amap-jsapi-loader/dist/index.js ***!
|
|
25
|
+
\************************************************************/
|
|
26
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
27
|
+
|
|
28
|
+
"use strict";
|
|
29
|
+
eval("\n\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n(function (m, p) {\n true ? module.exports = p() : 0;\n})(this, function () {\n function m(a) {\n var b = [];\n a.AMapUI && b.push(p(a.AMapUI));\n a.Loca && b.push(r(a.Loca));\n return Promise.all(b);\n }\n function p(a) {\n return new Promise(function (h, c) {\n var f = [];\n if (a.plugins) for (var e = 0; e < a.plugins.length; e += 1) -1 == d.AMapUI.plugins.indexOf(a.plugins[e]) && f.push(a.plugins[e]);\n if (g.AMapUI === b.failed) c(\"\\u524d\\u6b21\\u8bf7\\u6c42 AMapUI \\u5931\\u8d25\");else if (g.AMapUI === b.notload) {\n g.AMapUI = b.loading;\n d.AMapUI.version = a.version || d.AMapUI.version;\n e = d.AMapUI.version;\n var l = document.body || document.head,\n k = document.createElement(\"script\");\n k.type = \"text/javascript\";\n k.src = \"https://webapi.amap.com/ui/\" + e + \"/main.js\";\n k.onerror = function (a) {\n g.AMapUI = b.failed;\n c(\"\\u8bf7\\u6c42 AMapUI \\u5931\\u8d25\");\n };\n k.onload = function () {\n g.AMapUI = b.loaded;\n if (f.length) window.AMapUI.loadUI(f, function () {\n for (var a = 0, b = f.length; a < b; a++) {\n var c = f[a].split(\"/\").slice(-1)[0];\n window.AMapUI[c] = arguments[a];\n }\n for (h(); n.AMapUI.length;) n.AMapUI.splice(0, 1)[0]();\n });else for (h(); n.AMapUI.length;) n.AMapUI.splice(0, 1)[0]();\n };\n l.appendChild(k);\n } else g.AMapUI === b.loaded ? a.version && a.version !== d.AMapUI.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c AMapUI \\u6df7\\u7528\") : f.length ? window.AMapUI.loadUI(f, function () {\n for (var a = 0, b = f.length; a < b; a++) {\n var c = f[a].split(\"/\").slice(-1)[0];\n window.AMapUI[c] = arguments[a];\n }\n h();\n }) : h() : a.version && a.version !== d.AMapUI.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c AMapUI \\u6df7\\u7528\") : n.AMapUI.push(function (a) {\n a ? c(a) : f.length ? window.AMapUI.loadUI(f, function () {\n for (var a = 0, b = f.length; a < b; a++) {\n var c = f[a].split(\"/\").slice(-1)[0];\n window.AMapUI[c] = arguments[a];\n }\n h();\n }) : h();\n });\n });\n }\n function r(a) {\n return new Promise(function (h, c) {\n if (g.Loca === b.failed) c(\"\\u524d\\u6b21\\u8bf7\\u6c42 Loca \\u5931\\u8d25\");else if (g.Loca === b.notload) {\n g.Loca = b.loading;\n d.Loca.version = a.version || d.Loca.version;\n var f = d.Loca.version,\n e = d.AMap.version.startsWith(\"2\"),\n l = f.startsWith(\"2\");\n if (e && !l || !e && l) c(\"JSAPI \\u4e0e Loca \\u7248\\u672c\\u4e0d\\u5bf9\\u5e94\\uff01\\uff01\");else {\n e = d.key;\n l = document.body || document.head;\n var k = document.createElement(\"script\");\n k.type = \"text/javascript\";\n k.src = \"https://webapi.amap.com/loca?v=\" + f + \"&key=\" + e;\n k.onerror = function (a) {\n g.Loca = b.failed;\n c(\"\\u8bf7\\u6c42 AMapUI \\u5931\\u8d25\");\n };\n k.onload = function () {\n g.Loca = b.loaded;\n for (h(); n.Loca.length;) n.Loca.splice(0, 1)[0]();\n };\n l.appendChild(k);\n }\n } else g.Loca === b.loaded ? a.version && a.version !== d.Loca.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c Loca \\u6df7\\u7528\") : h() : a.version && a.version !== d.Loca.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c Loca \\u6df7\\u7528\") : n.Loca.push(function (a) {\n a ? c(a) : c();\n });\n });\n }\n if (!window) throw Error(\"AMap JSAPI can only be used in Browser.\");\n var b;\n (function (a) {\n a.notload = \"notload\";\n a.loading = \"loading\";\n a.loaded = \"loaded\";\n a.failed = \"failed\";\n })(b || (b = {}));\n var d = {\n key: \"\",\n AMap: {\n version: \"1.4.15\",\n plugins: []\n },\n AMapUI: {\n version: \"1.1\",\n plugins: []\n },\n Loca: {\n version: \"1.3.2\"\n }\n },\n g = {\n AMap: b.notload,\n AMapUI: b.notload,\n Loca: b.notload\n },\n n = {\n AMap: [],\n AMapUI: [],\n Loca: []\n },\n q = [],\n t = function (a) {\n \"function\" == typeof a && (g.AMap === b.loaded ? a(window.AMap) : q.push(a));\n };\n return {\n load: function (a) {\n return new Promise(function (h, c) {\n if (g.AMap == b.failed) c(\"\");else if (g.AMap == b.notload) {\n var f = a.key,\n e = a.version,\n l = a.plugins;\n f ? (window.AMap && \"lbs.amap.com\" !== location.host && c(\"\\u7981\\u6b62\\u591a\\u79cdAPI\\u52a0\\u8f7d\\u65b9\\u5f0f\\u6df7\\u7528\"), d.key = f, d.AMap.version = e || d.AMap.version, d.AMap.plugins = l || d.AMap.plugins, g.AMap = b.loading, e = document.body || document.head, window.___onAPILoaded = function (d) {\n delete window.___onAPILoaded;\n if (d) g.AMap = b.failed, c(d);else for (g.AMap = b.loaded, m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c); q.length;) q.splice(0, 1)[0]();\n }, l = document.createElement(\"script\"), l.type = \"text/javascript\", l.src = \"https://webapi.amap.com/maps?callback=___onAPILoaded&v=\" + d.AMap.version + \"&key=\" + f + \"&plugin=\" + d.AMap.plugins.join(\",\"), l.onerror = function (a) {\n g.AMap = b.failed;\n c(a);\n }, e.appendChild(l)) : c(\"\\u8bf7\\u586b\\u5199key\");\n } else if (g.AMap == b.loaded) {\n if (a.key && a.key !== d.key) c(\"\\u591a\\u4e2a\\u4e0d\\u4e00\\u81f4\\u7684 key\");else if (a.version && a.version !== d.AMap.version) c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c JSAPI \\u6df7\\u7528\");else {\n f = [];\n if (a.plugins) for (e = 0; e < a.plugins.length; e += 1) -1 == d.AMap.plugins.indexOf(a.plugins[e]) && f.push(a.plugins[e]);\n if (f.length) window.AMap.plugin(f, function () {\n m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n });else m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n }\n } else if (a.key && a.key !== d.key) c(\"\\u591a\\u4e2a\\u4e0d\\u4e00\\u81f4\\u7684 key\");else if (a.version && a.version !== d.AMap.version) c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c JSAPI \\u6df7\\u7528\");else {\n var k = [];\n if (a.plugins) for (e = 0; e < a.plugins.length; e += 1) -1 == d.AMap.plugins.indexOf(a.plugins[e]) && k.push(a.plugins[e]);\n t(function () {\n if (k.length) window.AMap.plugin(k, function () {\n m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n });else m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n });\n }\n });\n },\n reset: function () {\n delete window.AMap;\n delete window.AMapUI;\n delete window.Loca;\n d = {\n key: \"\",\n AMap: {\n version: \"1.4.15\",\n plugins: []\n },\n AMapUI: {\n version: \"1.1\",\n plugins: []\n },\n Loca: {\n version: \"1.3.2\"\n }\n };\n g = {\n AMap: b.notload,\n AMapUI: b.notload,\n Loca: b.notload\n };\n n = {\n AMap: [],\n AMapUI: [],\n Loca: []\n };\n }\n };\n});\n\n//# sourceURL=webpack://mui/./node_modules/@amap/amap-jsapi-loader/dist/index.js?");
|
|
30
|
+
|
|
31
|
+
/***/ }),
|
|
32
|
+
|
|
22
33
|
/***/ "./node_modules/@ant-design/colors/lib/generate.js":
|
|
23
34
|
/*!*********************************************************!*\
|
|
24
35
|
!*** ./node_modules/@ant-design/colors/lib/generate.js ***!
|
|
@@ -8679,7 +8690,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */
|
|
|
8679
8690
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8680
8691
|
|
|
8681
8692
|
"use strict";
|
|
8682
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue/es */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es */ \"./node_modules/ant-design-vue/es/table/index.js\");\n/* harmony import */ var ant_design_vue_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue/es */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\nconst IconFont = ant_design_vue_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createFromIconfontCN({\n scriptUrl: '//at.alicdn.com/t/c/font_4640977_auv55jur50b.js'\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n Table: ant_design_vue_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n name: 'uTable',\n data() {\n return {\n pagination: {\n total: 0,\n size: 10,\n current: 1\n },\n tableScrollBody: 600\n };\n },\n props: {\n // 紧凑型和宽松型 \n // relax 宽松型\n // compact 紧凑型\n tableStyle: {\n type: String,\n default: 'compact'\n },\n // compact 紧凑型情况下是否有分割线\n tableSplit: {\n type: Boolean,\n default: true\n },\n // 表格数据\n datas: {\n type: Array,\n default: () => []\n },\n // 选中数据项\n selectedRowKeys: {\n type: Array,\n default: () => []\n },\n // 分页默认值\n paginationParams: {\n type: Object,\n default: () => ({\n total: 0,\n size: 10,\n current: 1\n })\n },\n // 配置分页数据\n pageSizeOptions: {\n type: Array,\n default: () => ['10', '15', '20', '30', '50']\n }\n },\n computed: {\n setAttrs() {\n const h = this.$createElement;\n return {\n pagination: false,\n rowKey: (record, i) => record.id ?? `${this.pagination.current}${i}`,\n rowSelection: {\n selectedRowKeys: this.selectedRowKeys,\n onChange: this.onSelectChange\n },\n locale: {\n emptyText: h(\"div\", {\n \"class\": \"WebComponentTable__List__Empty\"\n }, [h(IconFont, {\n \"attrs\": {\n \"type\": \"icon-zanwushuju\"\n }\n }), h(\"span\", [\"\\u6682\\u65E0\\u6570\\u636E\"])])\n },\n ...this.$attrs\n };\n },\n tableSize() {\n return this.tableStyle == 'compact' ? 'middle' : 'default';\n }\n },\n watch: {\n paginationParams(newValue) {\n this.pagination = {\n ...newValue\n };\n }\n },\n mounted() {\n this.pagination = {\n ...this.paginationParams\n };\n const scrollTimer = setTimeout(() => {\n this.getScrollBodyH();\n clearTimeout(scrollTimer);\n }, 300);\n window.addEventListener('resize', () => this.getScrollBodyH());\n this.removeDomElement();\n },\n destroyed() {\n // window.removeEventListener( 'resize' )\n },\n methods: {\n /** 根据内容高度计算滚动长度 */\n getScrollBodyH() {\n this.tableScrollBody = this.$refs.Table.clientHeight - this.$refs.TableHead.offsetHeight - this.$refs.TablePagination.offsetHeight - 16 - this.$refs.TableListTitle.offsetHeight - document.querySelector('.ant-table-thead').offsetHeight - 20;\n /** 20为获取高度时抹掉的小数点后两位的浮动空间(存在叠加多个获取错误的情况) */\n console.log(this.$refs.Table.clientHeight, this.tableScrollBody, 'tableScrollBody滚动高度');\n },\n /** 根据高度判断dom元素是否加载 进行删除 */\n removeDomElement() {\n let domElement;\n this.$refs.Table.querySelectorAll('div').forEach(node => {\n node.className == 'ant-table-title' && (domElement = node);\n });\n !this.$scopedSlots.ATableHead && this.$refs.TableHead.remove();\n !this.$scopedSlots.ATableTitle && (domElement.style.padding = '0');\n },\n onSelectChange(selectedKey, selectedRecord) {\n this.$emit('selectedRecords', selectedKey, selectedRecord);\n },\n paginationChange(current, pageSize) {\n this.pagination = {\n ...this.pagination,\n size: pageSize,\n current\n };\n this.$emit('pageSizeChange', this.pagination);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/table/index.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8693
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_design_vue_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ant-design-vue/es */ \"./node_modules/ant-design-vue/es/icon/index.js\");\n/* harmony import */ var ant_design_vue_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es */ \"./node_modules/ant-design-vue/es/table/index.js\");\n/* harmony import */ var ant_design_vue_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue/es */ \"./node_modules/ant-design-vue/es/pagination/index.js\");\n\nconst IconFont = ant_design_vue_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createFromIconfontCN({\n scriptUrl: '//at.alicdn.com/t/c/font_4640977_auv55jur50b.js'\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n Table: ant_design_vue_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Pagination: ant_design_vue_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n name: 'uTable',\n data() {\n return {\n pagination: {\n total: 0,\n size: 10,\n current: 1\n },\n tableScrollBody: 600\n };\n },\n props: {\n // 紧凑型和宽松型 \n // relax 宽松型\n // compact 紧凑型\n tableStyle: {\n type: String,\n default: 'compact'\n },\n // compact 紧凑型情况下是否有分割线\n tableSplit: {\n type: Boolean,\n default: true\n },\n // 表格数据\n datas: {\n type: Array,\n default: () => []\n },\n // 选中数据项\n selectedRowKeys: {\n type: Array,\n default: () => []\n },\n // 分页默认值\n paginationParams: {\n type: Object,\n default: () => ({\n total: 0,\n size: 10,\n current: 1\n })\n },\n // 配置分页数据\n pageSizeOptions: {\n type: Array,\n default: () => ['10', '15', '20', '30', '50']\n }\n },\n computed: {\n setAttrs() {\n const h = this.$createElement;\n return {\n pagination: false,\n rowKey: (record, i) => record.id ?? `${this.pagination.current}${i}`,\n rowSelection: {\n selectedRowKeys: this.selectedRowKeys,\n onChange: this.onSelectChange\n },\n locale: {\n emptyText: h(\"div\", {\n \"class\": \"WebComponentTable__List__Empty\"\n }, [h(IconFont, {\n \"attrs\": {\n \"type\": \"icon-zanwushuju\"\n }\n }), h(\"span\", [\"\\u6682\\u65E0\\u6570\\u636E\"])])\n },\n scroll: {\n y: this.tableScrollBody,\n x: this.$attrs.scrollX\n },\n ...this.$attrs\n };\n },\n tableSize() {\n return this.tableStyle == 'compact' ? 'middle' : 'default';\n }\n },\n watch: {\n paginationParams(newValue) {\n this.pagination = {\n ...newValue\n };\n }\n },\n mounted() {\n this.pagination = {\n ...this.paginationParams\n };\n const scrollTimer = setTimeout(() => {\n this.getScrollBodyH();\n clearTimeout(scrollTimer);\n }, 300);\n window.addEventListener('resize', () => this.getScrollBodyH());\n this.removeDomElement();\n },\n destroyed() {\n // window.removeEventListener( 'resize' )\n },\n methods: {\n /** 根据内容高度计算滚动长度 */\n getScrollBodyH() {\n this.tableScrollBody = this.$refs.Table.clientHeight - this.$refs.TableHead.offsetHeight - this.$refs.TablePagination.offsetHeight - 16 - this.$refs.TableListTitle.offsetHeight - document.querySelector('.ant-table-thead').offsetHeight - 20;\n /** 20为获取高度时抹掉的小数点后两位的浮动空间(存在叠加多个获取错误的情况) */\n console.log(this.$refs.Table.clientHeight, this.tableScrollBody, 'tableScrollBody滚动高度');\n },\n /** 根据高度判断dom元素是否加载 进行删除 */\n removeDomElement() {\n let domElement;\n this.$refs.Table.querySelectorAll('div').forEach(node => {\n node.className == 'ant-table-title' && (domElement = node);\n });\n !this.$scopedSlots.ATableHead && this.$refs.TableHead.remove();\n !this.$scopedSlots.ATableTitle && (domElement.style.padding = '0');\n },\n onSelectChange(selectedKey, selectedRecord) {\n this.$emit('selectedRecords', selectedKey, selectedRecord);\n },\n paginationChange(current, pageSize) {\n this.pagination = {\n ...this.pagination,\n size: pageSize,\n current\n };\n this.$emit('pageSizeChange', this.pagination);\n }\n }\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/table/index.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8683
8694
|
|
|
8684
8695
|
/***/ }),
|
|
8685
8696
|
|
|
@@ -8910,7 +8921,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8910
8921
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8911
8922
|
|
|
8912
8923
|
"use strict";
|
|
8913
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n ref: \"Table\",\n class: [_vm.tableStyle, \"WebComponentTable\"]\n }, [_c(\"div\", {\n ref: \"TableHead\",\n staticClass: \"WebComponentTable__Head\"\n }, [_vm._t(\"ATableHead\")], 2), _vm._v(\" \"), _c(\"Table\", _vm._g(_vm._b({\n ref: \"TableList\",\n staticClass: \"WebComponentTable__List\",\n attrs: {\n size: _vm.tableSize,\n \"data-source\": _vm.datas
|
|
8924
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; },\n/* harmony export */ staticRenderFns: function() { return /* binding */ staticRenderFns; }\n/* harmony export */ });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n ref: \"Table\",\n class: [_vm.tableStyle, \"WebComponentTable\"]\n }, [_c(\"div\", {\n ref: \"TableHead\",\n staticClass: \"WebComponentTable__Head\"\n }, [_vm._t(\"ATableHead\")], 2), _vm._v(\" \"), _c(\"Table\", _vm._g(_vm._b({\n ref: \"TableList\",\n staticClass: \"WebComponentTable__List\",\n attrs: {\n size: _vm.tableSize,\n \"data-source\": _vm.datas\n },\n scopedSlots: _vm._u([_vm._l(_vm.$attrs.columns, function ({\n dataIndex\n }) {\n return {\n key: dataIndex,\n fn: function () {\n return [_vm._t(dataIndex)];\n },\n proxy: true\n };\n }), {\n key: \"customRender\",\n fn: function (text, record, i, column) {\n return [_vm._t(column.dataIndex, null, {\n customProps: record,\n text: text,\n index: i\n })];\n }\n }], null, true)\n }, \"Table\", _vm.setAttrs, false), _vm.$listeners), [_c(\"div\", {\n ref: \"TableListTitle\",\n staticClass: \"WebComponentTable__List__Title\",\n attrs: {\n slot: \"title\"\n },\n slot: \"title\"\n }, [_vm._t(\"ATableTitle\")], 2)]), _vm._v(\" \"), _c(\"div\", {\n ref: \"TablePagination\",\n staticClass: \"WebComponentTable__Pagination\"\n }, [_vm._t(\"ATablePagination\", function () {\n return [_c(\"Pagination\", {\n attrs: {\n size: \"small\",\n pageSizeOptions: _vm.pageSizeOptions,\n \"show-total\": total => `共 ${total} 条记录`,\n \"show-size-changer\": \"\",\n \"show-quick-jumper\": \"\",\n defaultCurrent: 1,\n pageSize: _vm.pagination.size,\n current: _vm.pagination.current,\n total: _vm.pagination.total\n },\n on: {\n \"update:pageSize\": function ($event) {\n return _vm.$set(_vm.pagination, \"size\", $event);\n },\n \"update:page-size\": function ($event) {\n return _vm.$set(_vm.pagination, \"size\", $event);\n },\n showSizeChange: _vm.paginationChange,\n change: _vm.paginationChange\n }\n })];\n })], 2)], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack://mui/./plugins/lib/table/index.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet%5B1%5D.rules%5B2%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options");
|
|
8914
8925
|
|
|
8915
8926
|
/***/ }),
|
|
8916
8927
|
|
|
@@ -8984,10 +8995,10 @@ eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source cod
|
|
|
8984
8995
|
/*!***************************************!*\
|
|
8985
8996
|
!*** ./plugins/lib/amap/AmapDraw.jsx ***!
|
|
8986
8997
|
\***************************************/
|
|
8987
|
-
/***/ (function(
|
|
8998
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8988
8999
|
|
|
8989
9000
|
"use strict";
|
|
8990
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDrawProps: function() { return /* binding */ AmapDrawProps; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _AmapDraw_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AmapDraw.less */ \"./plugins/lib/amap/AmapDraw.less\");\n\n\n\n\nconst AmapDrawProps = {\n /** drawEl为地图容器实例名称 */\n drawEl: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].string.def('AmapDraw'),\n /** drawType为绘制类型\r\n * 可选值(point点 | line线 | polygon面)\r\n */\n drawType: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].string.def('point'),\n /** 绘制图标 (只在point类型下生效 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].any.def('http://qxfa.tpddns.cn:8090/poi/poi-marker-default.png'),\n /** drawCount为绘制物绘制个数 */\n drawCount: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].number.def(1),\n /** drawOptions为绘制物配置项 */\n drawOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].object.def({}),\n /** drawInfo为绘制物信息 */\n drawInfo: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].array]),\n /** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)\r\n * 格式: { point: ([]||{}), line: ([]||{}) }\r\n */\n drawInfoAll: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].object,\n /** 限制区域 */\n drawLimitArea: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].string]),\n /** 限制区域样式配置 */\n drawLimitAreaOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].object.def({}),\n /** 是否为纯地图展示数据 */\n isExhibition: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].bool.def(false)\n};\nconst AmapDraw = {\n name: 'AmapDraw',\n props: AmapDrawProps,\n data() {\n return {\n amap: null,\n drawArea: null,\n drawLayers: null,\n drawMouseTool: null,\n buttonProps: [],\n drawButtonProps: [{\n type: 'primary',\n text: '绘制',\n event: {\n click: this.AmapDraw\n }\n }, {\n text: '清除',\n event: {\n click: this.AmapDrawClear\n }\n }],\n saveButtonProps: [{\n type: 'primary',\n text: '保存',\n event: {\n click: this.AmapDrawSave\n }\n }, {\n text: '取消',\n event: {\n click: this.AmapDrawReset\n }\n }]\n };\n },\n computed: {\n drawLayersInfo: {\n get() {\n return this.drawInfo;\n },\n set(newValue) {\n this.$emit('getAMapLayersInfo', newValue);\n }\n }\n },\n watch: {\n drawInfo: {\n handler(newVal, oldVal) {\n const newValue = this.drawLayersInfo;\n newVal && this.echoDrawLayers(this.drawType);\n },\n deep: true\n },\n drawInfoAll(newValue) {\n newValue && this.echoDrawLayers();\n },\n drawOptions(newValue) {\n /** 检测options覆盖物配置是否更改,更改后要同步到地图上 */\n Object.keys(newValue).length && this.setOverlayOptions(newValue);\n },\n drawLimitArea(newValue) {\n newValue && this.setDrawLimitArea();\n }\n },\n mounted() {\n const timer = setTimeout(() => {\n this.$initAMap({\n el: this.drawEl\n }, amap => {\n this.amap = amap;\n this.buttonProps = [].concat(this.drawButtonProps);\n this.echoDrawLayers(this.drawType);\n /** 如果有限制区域,则描绘在地图上 */\n this.drawLimitArea && this.setDrawLimitArea();\n clearTimeout(timer);\n });\n }, 600);\n },\n destroyed() {\n this.AmapDrawClear();\n },\n methods: {\n /** 绘制 */\n AmapDraw() {\n this.buttonProps = [].concat(this.saveButtonProps);\n this.drawMouseTool = new this.$amap.MouseTool(this.amap);\n this.AmapDrawClear();\n this.setDrawLayers(this.drawType);\n this.drawMouseTool.on('draw', ({\n obj\n }) => {\n if (this.drawArea && !this[`is${this.drawType}InRing`](obj)) return this.amap.remove(obj), this.$message.error('未在范围内描绘!');\n /** 暂未支持一次性绘制多个 */\n this.drawCount > 1 ? (this.drawLayers = this.drawLayers || [], this.drawLayers.push(obj)) : this.drawLayers = obj;\n if (this.drawLayers && (this.drawLayers.length == this.drawCount || this.drawCount == 1)) {\n return this.drawMouseTool.close();\n }\n });\n },\n /** 清空绘制 / 清空搜索 */\n AmapDrawClear() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && this.amap.remove(layerItem));\n // this.amap.clearMap()\n this.drawLayers = null;\n this.drawLayersInfo = {};\n },\n /** 保存当前绘制 */\n AmapDrawSave() {\n this.assignDrawLayers(this.drawType);\n this.buttonProps = [].concat(this.drawButtonProps);\n },\n /** 取消当前绘制 */\n AmapDrawReset() {\n this.buttonProps = [].concat(this.drawButtonProps);\n this.AmapDrawClear();\n },\n /** 搜索地址 */\n searchChoose(searchMarker, searchInfo) {\n this.AmapDrawClear();\n searchMarker.setMap(this.amap);\n this.amap.setZoomAndCenter(15, searchMarker.getPosition());\n this.drawType == 'point' && (this.drawLayersInfo = searchInfo);\n // this.$emit('getAMapLayersInfo', this.drawLayersInfo)\n },\n /** 检测覆盖物配置信息并同步 */\n setOverlayOptions(options) {\n if (!this.drawLayers) return;\n this.drawCount > 1 ? this.drawLayers.forEach(drawItem => drawItem.setOptions(options)) : this.drawLayers.setOptions(options);\n },\n /** 绘制限定区域 */\n setDrawLimitArea() {\n let areaRange = [];\n try {\n areaRange = JSON.parse(this.drawLimitArea);\n } catch {\n areaRange = this.drawLimitArea;\n }\n this.drawArea && this.amap.remove(this.drawArea);\n /** 判断目前地图上存在的所绘制覆盖物是否在限制范围内 */\n this.setMapArea(areaRange);\n this.judgeOverlays();\n },\n /** 绘制地图区域范围 */\n setMapArea(jurisdictionRange) {\n this.drawArea = new this.$amap.Polygon({\n map: this.amap,\n path: jurisdictionRange,\n extData: 'Area',\n strokeWeight: 6,\n ...this.drawLimitAreaOptions\n });\n const {\n lng,\n lat\n } = this.drawArea.getBounds().getCenter();\n this.amap.setZoomAndCenter(15, [lng, lat]);\n },\n /** 判断一个线段是否在面内 */\n islineInRing(polyline) {\n const paths = polyline.getPath();\n return paths.every(pointItem => this.ispointInRing(pointItem));\n },\n /** 判断一个点是否在面内 */\n ispointInRing(point) {\n let position;\n try {\n position = point.getPosition();\n } catch {\n position = point;\n }\n return this.$amap.GeometryUtil.isPointInRing(position, this.drawArea.getPath());\n },\n /** 判断地图上所覆盖物是否在限制范围内 */\n judgeOverlays() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && !this[`is${this.drawType}InRing`](layerItem) && this.removeOverlay(layerItem));\n },\n /** 清除单个覆盖物(或 不符合区域范围的覆盖物 */\n removeOverlay(layerItem) {\n this.amap.remove(layerItem);\n this.$message.error('未在区域范围内,请重新描绘!');\n try {\n const i = this.drawLayers.findIndex(layer => layer.getExtData() == layerItem.getExtData());\n this.drawLayers.splice(i, 1);\n } catch {\n this.drawLayers = null;\n this.drawLayersInfo = {};\n }\n },\n /** 根据类型处理不同数据 */\n setDrawLayers(drawType) {\n const type = {\n point: 'marker',\n line: 'polyline',\n polygon: 'polygon'\n };\n\n /** 图层基础配置 */\n const drawOptions = drawType == 'point' ? {\n anchor: 'bottom-center',\n icon: this.$amapLayers.setIcon(this.drawIcon)\n } : {\n strokeWeight: 8\n };\n this.drawMouseTool[type[drawType]]({\n ...drawOptions,\n ...this.drawOptions\n });\n },\n /** 赋值不同图层数据 */\n assignDrawLayers(drawType) {\n if (drawType == 'point') {\n const {\n lng,\n lat\n } = this.drawLayers.getPosition();\n const position = {\n longitude: lng,\n latitude: lat\n };\n this.$amapMethods.getMapAddress(position, address => {\n this.drawLayersInfo = {\n ...position,\n ...address\n };\n });\n return;\n }\n const range = this.drawLayers.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n this.drawLayersInfo = {\n range\n };\n },\n /** 回显不同类型图层 */\n echoDrawLayers(drawType) {\n const drawLayersItem = (drawItem, type, i = 0) => {\n // && drawItem.latitude && drawItem.longitude 忘记当时为什么加这个了 后续在想\n if (drawItem && this.amap) {\n let layersItem = null;\n const {\n longitude,\n latitude,\n range\n } = drawItem;\n const setOptions = {\n extData: `draw${type}${i}`,\n ...this.drawOptions\n };\n if (type == 'point') {\n layersItem = this.$amapLayers.setMarker(this.drawIcon, {\n position: [longitude, latitude],\n ...setOptions\n });\n } else {\n const options = {\n path: range,\n strokeWeight: 8,\n ...setOptions\n };\n layersItem = type == 'line' ? new this.$amap.Polyline(options) : new this.$amap.Polygon(options);\n }\n layersItem.setMap(this.amap);\n this.amap.setFitView();\n }\n };\n if (!this.isExhibition) {\n drawLayersItem(this.drawLayersInfo, drawType);\n return;\n }\n if (this.drawInfoAll) {\n for (let key in this.drawInfoAll) {\n const isArray = Array.isArray(this.drawInfoAll[key]);\n isArray ? this.drawInfoAll[key].forEach((drawItem, i) => {\n drawLayersItem(drawItem, key, i);\n }) : drawLayersItem(this.drawInfoAll[key], key);\n }\n return;\n }\n drawLayersItem(this.drawLayersInfo, drawType);\n }\n },\n render(h) {\n const {\n drawEl,\n drawIcon,\n buttonProps,\n isExhibition,\n AmapDrawClear,\n searchChoose\n } = this;\n return h(\"div\", {\n \"class\": \"AmapDraw\"\n }, [!isExhibition && h(_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n \"props\": {\n ...{\n drawIcon,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose\n }\n }\n }), h(\"div\", {\n \"attrs\": {\n \"id\": drawEl\n }\n })]);\n }\n};\nAmapDraw.install = function (Vue) {\n Vue.component('AmapDraw', AmapDraw);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapDraw);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/AmapDraw.jsx?");
|
|
9001
|
+
eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDrawProps: function() { return /* binding */ AmapDrawProps; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _AmapDraw_less__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AmapDraw.less */ \"./plugins/lib/amap/AmapDraw.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__]);\n_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst amap = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_2__.getAMapInstance)();\nconst {\n AMap,\n methods,\n layers\n} = amap;\n\nconst AmapDrawProps = {\n /** drawEl为地图容器实例名称 */\n drawEl: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('AmapDraw'),\n /** drawType为绘制类型\r\n * 可选值(point点 | line线 | polygon面)\r\n */\n drawType: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('point'),\n /** 绘制图标 (只在point类型下生效 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].any.def('http://qxfa.tpddns.cn:8090/poi/poi-marker-default.png'),\n /** drawCount为绘制物绘制个数 */\n drawCount: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].number.def(1),\n /** drawOptions为绘制物配置项 */\n drawOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** drawInfo为绘制物信息 */\n drawInfo: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].array]),\n /** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)\r\n * 格式: { point: ([]||{}), line: ([]||{}) }\r\n */\n drawInfoAll: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object,\n /** 限制区域 */\n drawLimitArea: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string]),\n /** 限制区域样式配置 */\n drawLimitAreaOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** 是否为纯地图展示数据 */\n isExhibition: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].bool.def(false)\n};\nconst AmapDraw = {\n name: 'AmapDraw',\n props: AmapDrawProps,\n data() {\n return {\n amap: null,\n drawArea: null,\n drawLayers: null,\n drawMouseTool: null,\n buttonProps: [],\n drawButtonProps: [{\n type: 'primary',\n text: '绘制',\n event: {\n click: this.AmapDraw\n }\n }, {\n text: '清除',\n event: {\n click: this.AmapDrawClear\n }\n }],\n saveButtonProps: [{\n type: 'primary',\n text: '保存',\n event: {\n click: this.AmapDrawSave\n }\n }, {\n text: '取消',\n event: {\n click: this.AmapDrawReset\n }\n }]\n };\n },\n computed: {\n drawLayersInfo: {\n get() {\n return this.drawInfo;\n },\n set(newValue) {\n this.$emit('getAMapLayersInfo', newValue);\n }\n }\n },\n watch: {\n drawInfo: {\n handler(newVal, oldVal) {\n const newValue = this.drawLayersInfo;\n newVal && this.echoDrawLayers(this.drawType);\n },\n deep: true\n },\n drawInfoAll(newValue) {\n newValue && this.echoDrawLayers();\n },\n drawOptions(newValue) {\n /** 检测options覆盖物配置是否更改,更改后要同步到地图上 */\n Object.keys(newValue).length && this.setOverlayOptions(newValue);\n },\n drawLimitArea(newValue) {\n newValue && this.setDrawLimitArea();\n }\n },\n mounted() {\n this.amap = amap.initMap({\n el: this.drawEl\n });\n this.buttonProps = [].concat(this.drawButtonProps);\n this.echoDrawLayers(this.drawType);\n /** 如果有限制区域,则描绘在地图上 */\n this.drawLimitArea && this.setDrawLimitArea();\n },\n destroyed() {\n this.AmapDrawClear();\n },\n methods: {\n /** 绘制 */\n AmapDraw() {\n this.buttonProps = [].concat(this.saveButtonProps);\n this.drawMouseTool = new AMap.MouseTool(this.amap);\n this.AmapDrawClear();\n this.setDrawLayers(this.drawType);\n this.drawMouseTool.on('draw', ({\n obj\n }) => {\n if (this.drawArea && !this[`is${this.drawType}InRing`](obj)) return this.amap.remove(obj), this.$message.error('未在范围内描绘!');\n /** 暂未支持一次性绘制多个 */\n this.drawCount > 1 ? (this.drawLayers = this.drawLayers || [], this.drawLayers.push(obj)) : this.drawLayers = obj;\n if (this.drawLayers && (this.drawLayers.length == this.drawCount || this.drawCount == 1)) {\n return this.drawMouseTool.close();\n }\n });\n },\n /** 清空绘制 / 清空搜索 */\n AmapDrawClear() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && this.amap.remove(layerItem));\n // this.amap.clearMap()\n this.drawLayers = null;\n this.drawLayersInfo = {};\n },\n /** 保存当前绘制 */\n AmapDrawSave() {\n this.assignDrawLayers(this.drawType);\n this.buttonProps = [].concat(this.drawButtonProps);\n },\n /** 取消当前绘制 */\n AmapDrawReset() {\n this.buttonProps = [].concat(this.drawButtonProps);\n this.AmapDrawClear();\n },\n /** 搜索地址 */\n searchChoose(searchMarker, searchInfo) {\n this.AmapDrawClear();\n searchMarker.setMap(this.amap);\n this.amap.setZoomAndCenter(15, searchMarker.getPosition());\n this.drawType == 'point' && (this.drawLayersInfo = searchInfo);\n // this.$emit('getAMapLayersInfo', this.drawLayersInfo)\n },\n /** 检测覆盖物配置信息并同步 */\n setOverlayOptions(options) {\n if (!this.drawLayers) return;\n this.drawCount > 1 ? this.drawLayers.forEach(drawItem => drawItem.setOptions(options)) : this.drawLayers.setOptions(options);\n },\n /** 绘制限定区域 */\n setDrawLimitArea() {\n let areaRange = [];\n try {\n areaRange = JSON.parse(this.drawLimitArea);\n } catch {\n areaRange = this.drawLimitArea;\n }\n this.drawArea && this.amap.remove(this.drawArea);\n /** 判断目前地图上存在的所绘制覆盖物是否在限制范围内 */\n this.setMapArea(areaRange);\n this.judgeOverlays();\n },\n /** 绘制地图区域范围 */\n setMapArea(jurisdictionRange) {\n this.drawArea = new AMap.Polygon({\n map: this.amap,\n path: jurisdictionRange,\n extData: 'Area',\n strokeWeight: 6,\n ...this.drawLimitAreaOptions\n });\n const {\n lng,\n lat\n } = this.drawArea.getBounds().getCenter();\n this.amap.setZoomAndCenter(15, [lng, lat]);\n },\n /** 判断一个线段是否在面内 */\n islineInRing(polyline) {\n const paths = polyline.getPath();\n return paths.every(pointItem => this.ispointInRing(pointItem));\n },\n /** 判断一个点是否在面内 */\n ispointInRing(point) {\n let position;\n try {\n position = point.getPosition();\n } catch {\n position = point;\n }\n return AMap.GeometryUtil.isPointInRing(position, this.drawArea.getPath());\n },\n /** 判断地图上所覆盖物是否在限制范围内 */\n judgeOverlays() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && !this[`is${this.drawType}InRing`](layerItem) && this.removeOverlay(layerItem));\n },\n /** 清除单个覆盖物(或 不符合区域范围的覆盖物 */\n removeOverlay(layerItem) {\n this.amap.remove(layerItem);\n this.$message.error('未在区域范围内,请重新描绘!');\n try {\n const i = this.drawLayers.findIndex(layer => layer.getExtData() == layerItem.getExtData());\n this.drawLayers.splice(i, 1);\n } catch {\n this.drawLayers = null;\n this.drawLayersInfo = {};\n }\n },\n /** 根据类型处理不同数据 */\n setDrawLayers(drawType) {\n const type = {\n point: 'marker',\n line: 'polyline',\n polygon: 'polygon'\n };\n\n /** 图层基础配置 */\n const drawOptions = drawType == 'point' ? {\n anchor: 'bottom-center',\n icon: layers.setIcon(this.drawIcon)\n } : {\n strokeWeight: 8\n };\n this.drawMouseTool[type[drawType]]({\n ...drawOptions,\n ...this.drawOptions\n });\n },\n /** 赋值不同图层数据 */\n assignDrawLayers(drawType) {\n if (drawType == 'point') {\n const {\n lng,\n lat\n } = this.drawLayers.getPosition();\n const position = {\n longitude: lng,\n latitude: lat\n };\n methods.getMapAddress(position, address => {\n this.drawLayersInfo = {\n ...position,\n ...address\n };\n });\n return;\n }\n const range = this.drawLayers.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n this.drawLayersInfo = {\n range\n };\n },\n /** 回显不同类型图层 */\n echoDrawLayers(drawType) {\n const drawLayersItem = (drawItem, type, i = 0) => {\n // && drawItem.latitude && drawItem.longitude 忘记当时为什么加这个了 后续在想\n if (drawItem && this.amap) {\n let layersItem = null;\n const {\n longitude,\n latitude,\n range\n } = drawItem;\n const setOptions = {\n extData: `draw${type}${i}`,\n ...this.drawOptions\n };\n if (type == 'point') {\n layersItem = layers.setMarker(this.drawIcon, {\n position: [longitude, latitude],\n ...setOptions\n });\n } else {\n const options = {\n path: range,\n strokeWeight: 8,\n ...setOptions\n };\n layersItem = type == 'line' ? new AMap.Polyline(options) : new AMap.Polygon(options);\n }\n layersItem.setMap(this.amap);\n this.amap.setFitView();\n }\n };\n if (!this.isExhibition) {\n drawLayersItem(this.drawLayersInfo, drawType);\n return;\n }\n if (this.drawInfoAll) {\n for (let key in this.drawInfoAll) {\n const isArray = Array.isArray(this.drawInfoAll[key]);\n isArray ? this.drawInfoAll[key].forEach((drawItem, i) => {\n drawLayersItem(drawItem, key, i);\n }) : drawLayersItem(this.drawInfoAll[key], key);\n }\n return;\n }\n drawLayersItem(this.drawLayersInfo, drawType);\n }\n },\n render(h) {\n const {\n drawEl,\n drawIcon,\n buttonProps,\n isExhibition,\n AmapDrawClear,\n searchChoose\n } = this;\n return h(\"div\", {\n \"class\": \"AmapDraw\"\n }, [!isExhibition && h(_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n \"props\": {\n ...{\n drawIcon,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose\n }\n }\n }), h(\"div\", {\n \"attrs\": {\n \"id\": drawEl\n }\n })]);\n }\n};\nAmapDraw.install = function (Vue) {\n Vue.component('AmapDraw', AmapDraw);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapDraw);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/AmapDraw.jsx?");
|
|
8991
9002
|
|
|
8992
9003
|
/***/ }),
|
|
8993
9004
|
|
|
@@ -8995,10 +9006,10 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8995
9006
|
/*!**********************************************************!*\
|
|
8996
9007
|
!*** ./plugins/lib/amap/components/AmapSearch/index.jsx ***!
|
|
8997
9008
|
\**********************************************************/
|
|
8998
|
-
/***/ (function(
|
|
9009
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8999
9010
|
|
|
9000
9011
|
"use strict";
|
|
9001
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapSearchProps: function() { return /* binding */ AmapSearchProps; }\n/* harmony export */ });\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../index */ \"./plugins/lib/index.js\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.less */ \"./plugins/lib/amap/components/AmapSearch/index.less\");\n\n\n\nconst {\n ASelectCustom\n} = _index__WEBPACK_IMPORTED_MODULE_0__.FormComp;\nconst AmapSearchProps = {\n /** 搜索后绘制图标 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].any,\n buttonProps: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array.def([])\n};\nconst AmapSearch = {\n name: 'AmapSearch',\n props: AmapSearchProps,\n data() {\n return {\n searchMarker: null,\n addressValue: undefined,\n selectOptions: []\n };\n },\n methods: {\n /** 选择地址 */\n changeHandle() {\n if (!this.addressValue) return this.$emit('searchReset', this.searchMarker), this.searchMarker = null;\n const {\n label,\n location\n } = this.selectOptions.find(({\n id\n }) => id == this.addressValue);\n const searchInfo = {\n longitude: location.lng,\n latitude: location.lat,\n address: label\n };\n this.searchMarker = this.$amapLayers.setMarker(this.drawIcon, {\n position: [location.lng, location.lat]\n });\n this.$emit('searchChoose', this.searchMarker, searchInfo);\n },\n /** 根据搜索框搜索地址 */\n searchHandle(keyword) {\n this.$amapMethods.getMapSearch(keyword, addressOptions => {\n this.selectOptions = addressOptions;\n });\n }\n },\n render(h) {\n const {\n selectOptions,\n changeHandle,\n searchHandle,\n buttonProps\n } = this;\n const props = {\n valueKey: 'id',\n labelKey: 'label',\n options: selectOptions,\n placeholder: '请输入目的地进行搜索'\n };\n return h(\"div\", {\n \"class\": \"AmapDraw__Search\"\n }, [h(ASelectCustom, {\n \"props\": {\n ...props\n },\n \"on\": {\n ...{\n change: changeHandle,\n search: searchHandle\n }\n },\n \"model\": {\n value: this.addressValue,\n callback: $$v => {\n this.addressValue = $$v;\n }\n }\n }), buttonProps && h(_index__WEBPACK_IMPORTED_MODULE_0__.Button, {\n \"attrs\": {\n \"buttonProps\": buttonProps\n },\n \"class\": \"AmapDraw__Search__Button\"\n })]);\n }\n};\nAmapSearch.install = function (Vue) {\n Vue.component('AmapSearch', AmapSearch);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapSearch);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.jsx?");
|
|
9012
|
+
eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapSearchProps: function() { return /* binding */ AmapSearchProps; }\n/* harmony export */ });\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../index */ \"./plugins/lib/index.js\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.less */ \"./plugins/lib/amap/components/AmapSearch/index.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index__WEBPACK_IMPORTED_MODULE_0__]);\n_index__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\nconst {\n ASelectCustom\n} = _index__WEBPACK_IMPORTED_MODULE_0__.FormComp;\nconst AmapSearchProps = {\n /** 搜索后绘制图标 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].any,\n buttonProps: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array.def([])\n};\nconst AmapSearch = {\n name: 'AmapSearch',\n props: AmapSearchProps,\n data() {\n return {\n searchMarker: null,\n addressValue: undefined,\n selectOptions: []\n };\n },\n methods: {\n /** 选择地址 */\n changeHandle() {\n if (!this.addressValue) return this.$emit('searchReset', this.searchMarker), this.searchMarker = null;\n const {\n label,\n location\n } = this.selectOptions.find(({\n id\n }) => id == this.addressValue);\n const searchInfo = {\n longitude: location.lng,\n latitude: location.lat,\n address: label\n };\n this.searchMarker = this.$amapLayers.setMarker(this.drawIcon, {\n position: [location.lng, location.lat]\n });\n this.$emit('searchChoose', this.searchMarker, searchInfo);\n },\n /** 根据搜索框搜索地址 */\n searchHandle(keyword) {\n this.$amapMethods.getMapSearch(keyword, addressOptions => {\n this.selectOptions = addressOptions;\n });\n }\n },\n render(h) {\n const {\n selectOptions,\n changeHandle,\n searchHandle,\n buttonProps\n } = this;\n const props = {\n valueKey: 'id',\n labelKey: 'label',\n options: selectOptions,\n placeholder: '请输入目的地进行搜索'\n };\n return h(\"div\", {\n \"class\": \"AmapDraw__Search\"\n }, [h(ASelectCustom, {\n \"props\": {\n ...props\n },\n \"on\": {\n ...{\n change: changeHandle,\n search: searchHandle\n }\n },\n \"model\": {\n value: this.addressValue,\n callback: $$v => {\n this.addressValue = $$v;\n }\n }\n }), buttonProps && h(_index__WEBPACK_IMPORTED_MODULE_0__.Button, {\n \"attrs\": {\n \"buttonProps\": buttonProps\n },\n \"class\": \"AmapDraw__Search__Button\"\n })]);\n }\n};\nAmapSearch.install = function (Vue) {\n Vue.component('AmapSearch', AmapSearch);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapSearch);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } });\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.jsx?");
|
|
9002
9013
|
|
|
9003
9014
|
/***/ }),
|
|
9004
9015
|
|
|
@@ -9006,10 +9017,10 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
9006
9017
|
/*!***********************************!*\
|
|
9007
9018
|
!*** ./plugins/lib/amap/index.js ***!
|
|
9008
9019
|
\***********************************/
|
|
9009
|
-
/***/ (function(
|
|
9020
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9010
9021
|
|
|
9011
9022
|
"use strict";
|
|
9012
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDraw: function() { return /* reexport safe */ _AmapDraw_jsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _AmapDraw_jsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AmapDraw.jsx */ \"./plugins/lib/amap/AmapDraw.jsx\");\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* 地图打点 */\n\n\n/* 地图搜索 */\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n AmapSearch: _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/index.js?");
|
|
9023
|
+
eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDraw: function() { return /* reexport safe */ _AmapDraw_jsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _AmapDraw_jsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AmapDraw.jsx */ \"./plugins/lib/amap/AmapDraw.jsx\");\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_AmapDraw_jsx__WEBPACK_IMPORTED_MODULE_0__, _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__]);\n([_AmapDraw_jsx__WEBPACK_IMPORTED_MODULE_0__, _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);\n/* 地图打点 */\n\n\n/* 地图搜索 */\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n AmapSearch: _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n});\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } });\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/index.js?");
|
|
9013
9024
|
|
|
9014
9025
|
/***/ }),
|
|
9015
9026
|
|
|
@@ -9171,10 +9182,10 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var ant_
|
|
|
9171
9182
|
/*!******************************!*\
|
|
9172
9183
|
!*** ./plugins/lib/index.js ***!
|
|
9173
9184
|
\******************************/
|
|
9174
|
-
/***/ (function(
|
|
9185
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9175
9186
|
|
|
9176
9187
|
"use strict";
|
|
9177
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapComp: function() { return /* reexport safe */ _amap__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ AmapDraw: function() { return /* reexport safe */ _amap__WEBPACK_IMPORTED_MODULE_11__.AmapDraw; },\n/* harmony export */ Avatar: function() { return /* reexport safe */ _avatar__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ Brower: function() { return /* reexport safe */ _browse_index_jsx__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ Button: function() { return /* reexport safe */ _button__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ Chat: function() { return /* reexport safe */ _chat__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; },\n/* harmony export */ DateTime: function() { return /* reexport safe */ _dateTime__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ DescriptionsList: function() { return /* reexport safe */ _descriptions_index_jsx__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; },\n/* harmony export */ Directory: function() { return /* reexport safe */ _tree__WEBPACK_IMPORTED_MODULE_5__.Directory; },\n/* harmony export */ FormComp: function() { return /* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ IframePage: function() { return /* reexport safe */ _iframe_index_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _modal_index_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ Model: function() { return /* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_1__.Model; },\n/* harmony export */ MultiTab: function() { return /* reexport safe */ _multiTab__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ Search: function() { return /* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_1__.Search; },\n/* harmony export */ SvgIcon: function() { return /* reexport safe */ _svgIcon__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ Table: function() { return /* reexport safe */ _table__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ Tree: function() { return /* reexport safe */ _tree__WEBPACK_IMPORTED_MODULE_5__.Tree; },\n/* harmony export */ Weather: function() { return /* reexport safe */ _weather__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _table__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./table */ \"./plugins/lib/table/index.js\");\n/* harmony import */ var _form__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./form */ \"./plugins/lib/form/index.js\");\n/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button */ \"./plugins/lib/button/index.js\");\n/* harmony import */ var _avatar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./avatar */ \"./plugins/lib/avatar/index.js\");\n/* harmony import */ var _svgIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./svgIcon */ \"./plugins/lib/svgIcon/index.js\");\n/* harmony import */ var _tree__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tree */ \"./plugins/lib/tree/index.js\");\n/* harmony import */ var _dateTime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dateTime */ \"./plugins/lib/dateTime/index.js\");\n/* harmony import */ var _weather__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./weather */ \"./plugins/lib/weather/index.js\");\n/* harmony import */ var _multiTab__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./multiTab */ \"./plugins/lib/multiTab/index.js\");\n/* harmony import */ var _iframe_index_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iframe/index.jsx */ \"./plugins/lib/iframe/index.jsx\");\n/* harmony import */ var _modal_index_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modal/index.jsx */ \"./plugins/lib/modal/index.jsx\");\n/* harmony import */ var _amap__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./amap */ \"./plugins/lib/amap/index.js\");\n/* harmony import */ var _browse_index_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./browse/index.jsx */ \"./plugins/lib/browse/index.jsx\");\n/* harmony import */ var _descriptions_index_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./descriptions/index.jsx */ \"./plugins/lib/descriptions/index.jsx\");\n/* harmony import */ var _chat__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./chat */ \"./plugins/lib/chat/index.js\");\n// 按需引入ant-design-vue必要指令组件\n// import './lazy_use'\n\n// 将组件库中定义的所有组件引入并导出\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/** Ai聊天组件 */\n\nconst components = {\n Table: _table__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n Model: _form__WEBPACK_IMPORTED_MODULE_1__.Model,\n Search: _form__WEBPACK_IMPORTED_MODULE_1__.Search,\n FormComp: _form__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Button: _button__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Avatar: _avatar__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n SvgIcon: _svgIcon__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n Tree: _tree__WEBPACK_IMPORTED_MODULE_5__.Tree,\n Directory: _tree__WEBPACK_IMPORTED_MODULE_5__.Directory,\n DateTime: _dateTime__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n Weather: _weather__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n MultiTab: _multiTab__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n IframePage: _iframe_index_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n Modal: _modal_index_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n AmapComp: _amap__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n AmapDraw: _amap__WEBPACK_IMPORTED_MODULE_11__.AmapDraw,\n Brower: _browse_index_jsx__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n DescriptionsList: _descriptions_index_jsx__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n Chat: _chat__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n};\nconst install = function (Vue) {\n if (install.installed) return;\n Object.keys(components).forEach(component => {\n Vue.component(components[component].name, components[component]);\n });\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n install,\n ...components\n});\n\n//# sourceURL=webpack://mui/./plugins/lib/index.js?");
|
|
9188
|
+
eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapComp: function() { return /* reexport safe */ _amap__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ AmapDraw: function() { return /* reexport safe */ _amap__WEBPACK_IMPORTED_MODULE_11__.AmapDraw; },\n/* harmony export */ Avatar: function() { return /* reexport safe */ _avatar__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ Brower: function() { return /* reexport safe */ _browse_index_jsx__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ Button: function() { return /* reexport safe */ _button__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ Chat: function() { return /* reexport safe */ _chat__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; },\n/* harmony export */ DateTime: function() { return /* reexport safe */ _dateTime__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ DescriptionsList: function() { return /* reexport safe */ _descriptions_index_jsx__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; },\n/* harmony export */ Directory: function() { return /* reexport safe */ _tree__WEBPACK_IMPORTED_MODULE_5__.Directory; },\n/* harmony export */ FormComp: function() { return /* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ IframePage: function() { return /* reexport safe */ _iframe_index_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _modal_index_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ Model: function() { return /* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_1__.Model; },\n/* harmony export */ MultiTab: function() { return /* reexport safe */ _multiTab__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ Search: function() { return /* reexport safe */ _form__WEBPACK_IMPORTED_MODULE_1__.Search; },\n/* harmony export */ SvgIcon: function() { return /* reexport safe */ _svgIcon__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ Table: function() { return /* reexport safe */ _table__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ Tree: function() { return /* reexport safe */ _tree__WEBPACK_IMPORTED_MODULE_5__.Tree; },\n/* harmony export */ Weather: function() { return /* reexport safe */ _weather__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _table__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./table */ \"./plugins/lib/table/index.js\");\n/* harmony import */ var _form__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./form */ \"./plugins/lib/form/index.js\");\n/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button */ \"./plugins/lib/button/index.js\");\n/* harmony import */ var _avatar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./avatar */ \"./plugins/lib/avatar/index.js\");\n/* harmony import */ var _svgIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./svgIcon */ \"./plugins/lib/svgIcon/index.js\");\n/* harmony import */ var _tree__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tree */ \"./plugins/lib/tree/index.js\");\n/* harmony import */ var _dateTime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dateTime */ \"./plugins/lib/dateTime/index.js\");\n/* harmony import */ var _weather__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./weather */ \"./plugins/lib/weather/index.js\");\n/* harmony import */ var _multiTab__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./multiTab */ \"./plugins/lib/multiTab/index.js\");\n/* harmony import */ var _iframe_index_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iframe/index.jsx */ \"./plugins/lib/iframe/index.jsx\");\n/* harmony import */ var _modal_index_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modal/index.jsx */ \"./plugins/lib/modal/index.jsx\");\n/* harmony import */ var _amap__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./amap */ \"./plugins/lib/amap/index.js\");\n/* harmony import */ var _browse_index_jsx__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./browse/index.jsx */ \"./plugins/lib/browse/index.jsx\");\n/* harmony import */ var _descriptions_index_jsx__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./descriptions/index.jsx */ \"./plugins/lib/descriptions/index.jsx\");\n/* harmony import */ var _chat__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./chat */ \"./plugins/lib/chat/index.js\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_amap__WEBPACK_IMPORTED_MODULE_11__]);\n_amap__WEBPACK_IMPORTED_MODULE_11__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n// 按需引入ant-design-vue必要指令组件\n// import './lazy_use'\n\n// 将组件库中定义的所有组件引入并导出\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/** Ai聊天组件 */\n\nconst components = {\n Table: _table__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n Model: _form__WEBPACK_IMPORTED_MODULE_1__.Model,\n Search: _form__WEBPACK_IMPORTED_MODULE_1__.Search,\n FormComp: _form__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Button: _button__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Avatar: _avatar__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n SvgIcon: _svgIcon__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n Tree: _tree__WEBPACK_IMPORTED_MODULE_5__.Tree,\n Directory: _tree__WEBPACK_IMPORTED_MODULE_5__.Directory,\n DateTime: _dateTime__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n Weather: _weather__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n MultiTab: _multiTab__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n IframePage: _iframe_index_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n Modal: _modal_index_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n AmapComp: _amap__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n AmapDraw: _amap__WEBPACK_IMPORTED_MODULE_11__.AmapDraw,\n Brower: _browse_index_jsx__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n DescriptionsList: _descriptions_index_jsx__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n Chat: _chat__WEBPACK_IMPORTED_MODULE_14__[\"default\"]\n};\nconst install = function (Vue) {\n if (install.installed) return;\n Object.keys(components).forEach(component => {\n Vue.component(components[component].name, components[component]);\n });\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n install,\n ...components\n});\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } });\n\n//# sourceURL=webpack://mui/./plugins/lib/index.js?");
|
|
9178
9189
|
|
|
9179
9190
|
/***/ }),
|
|
9180
9191
|
|
|
@@ -9321,6 +9332,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ind
|
|
|
9321
9332
|
|
|
9322
9333
|
/***/ }),
|
|
9323
9334
|
|
|
9335
|
+
/***/ "./plugins/method/AMap.js":
|
|
9336
|
+
/*!********************************!*\
|
|
9337
|
+
!*** ./plugins/method/AMap.js ***!
|
|
9338
|
+
\********************************/
|
|
9339
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9340
|
+
|
|
9341
|
+
"use strict";
|
|
9342
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getAMapInstance: function() { return /* binding */ getAMapInstance; },\n/* harmony export */ setAMapSecurity: function() { return /* binding */ setAMapSecurity; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _amap_amap_jsapi_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @amap/amap-jsapi-loader */ \"./node_modules/@amap/amap-jsapi-loader/dist/index.js\");\n/* harmony import */ var _amap_amap_jsapi_loader__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_amap_amap_jsapi_loader__WEBPACK_IMPORTED_MODULE_1__);\n\n// amap-plugin.js\n\nlet AMapKey = null;\nlet AMapStyle = null;\nlet AMapInstance = null;\n\n// 安全配置 / 地图样式配置\nconst setAMapSecurity = ({\n key,\n style,\n securityJsCode\n}) => {\n AMapKey = key;\n AMapStyle = style;\n /** 设置高德地图密钥 */\n window.forceWebGL = true;\n window._AMapSecurityConfig = {\n securityJsCode\n };\n};\n\n// 核心地图服务类\nclass AMapService {\n constructor(AMap) {\n this.AMap = AMap;\n this._iconCache = new Map(); // 图标缓存\n\n /** 常用覆盖物 */\n this.layers = {\n setIcon: this.setIcon.bind(this),\n setMarker: this.setMarker.bind(this),\n setInfoWindow: this._createInfoWindowHandler()\n };\n\n /** 抛出地图常用方法 */\n this.methods = {\n getMapAddress: this.getMapAddress.bind(this),\n getMapSearch: this.getMapSearch.bind(this),\n setMapDriving: this.setMapDriving.bind(this),\n drawMapAnimation,\n parseRouteToPath,\n getOverlayPos\n };\n }\n\n /** 初始化地图 */\n initMap(container, options = {}) {\n const map = new this.AMap.Map(container, {\n zoom: 13,\n zooms: [3, 20],\n pitch: 30,\n rotation: -15,\n viewMode: '3D',\n mapStyle: AMapStyle,\n ...options\n });\n options.zoomTool && map.addControl(new this.AMap.ToolBar());\n options.directionTool && map.addControl(new this.AMap.ControlBar());\n return map;\n }\n\n /** 格式化地图经纬度 */\n setLngLat(position) {\n return new this.AMap.LngLat(position[0], position[1]);\n }\n\n /** 创建信息窗口处理器(柯里化函数) */\n _createInfoWindowHandler() {\n return Vue => {\n if (!Vue || !Vue.extend) {\n throw new Error('必须传入有效的Vue构造函数');\n }\n return ({\n component,\n props,\n options = {}\n }) => {\n if (!component) throw new Error('component参数必填');\n const InfoWindowComponent = Vue.extend(component);\n const instance = new InfoWindowComponent({\n propsData: props\n }).$mount(document.createElement('div'));\n return new this.AMap.InfoWindow({\n isCustom: true,\n content: instance.$el,\n ...options\n });\n };\n };\n }\n\n /** 带缓存的图标创建方法 */\n async setIcon(iconUrl) {\n if (this._iconCache.has(iconUrl)) {\n return this._iconCache.get(iconUrl);\n }\n return new Promise((resolve, reject) => {\n const icon = new this.AMap.Icon({\n image: iconUrl,\n imageOffset: new this.AMap.Pixel(0, 0)\n });\n const img = new Image();\n img.onload = () => {\n const size = new this.AMap.Size(img.width, img.height);\n icon.setSize(size);\n icon.setImageSize(size);\n this._iconCache.set(iconUrl, icon);\n resolve(icon);\n };\n img.onerror = () => reject(new Error(`图标加载失败: ${iconUrl}`));\n img.src = iconUrl;\n });\n }\n\n /** 增强的标记点创建方法 */\n async setMarker(iconUrl, options = {}) {\n try {\n const icon = await this.setIcon(iconUrl);\n const marker = new this.AMap.Marker({\n anchor: 'bottom-center',\n ...options,\n icon\n });\n return marker;\n } catch (error) {\n console.error('创建标记点失败:', error);\n throw error;\n }\n }\n\n /** 地图逆地理编码 */\n getMapAddress({\n longitude,\n latitude\n }, callBack) {\n return new Promise((resolve, reject) => {\n const geocoder = new this.AMap.Geocoder({\n city: '全国',\n extensions: 'all'\n });\n geocoder.getAddress([longitude, latitude], (status, result) => {\n if (status === 'complete' && result.info === 'OK') {\n const {\n formattedAddress,\n pois\n } = result.regeocode;\n const {\n district,\n township\n } = result.regeocode.addressComponent;\n const division = township && formattedAddress.includes(township) ? formattedAddress.indexOf(township) + township.length : formattedAddress.indexOf(district) + district.length;\n const addressMsg = {\n address: formattedAddress.slice(0, division) + (pois[0]?.address || ''),\n addressInfo: result.regeocode.addressComponent\n };\n callBack?.(addressMsg);\n resolve(addressMsg);\n } else {\n reject(new Error('转换失败'));\n }\n });\n });\n }\n\n /** 根据地址搜索地图poi点及其他信息 */\n /**\r\n * \r\n * @param {*} keywords 根据关键字搜索\r\n * @param {*} callBack 查询成功后过滤信息及转换格式 传递回调函数 兼容老版本代码\r\n */\n getMapSearch(keywords, callBack) {\n return new Promise(resolve => {\n const placeSearch = new this.AMap.PlaceSearch();\n placeSearch.search(keywords, (status, searchList) => {\n const options = searchList?.poiList?.pois?.map(node => ({\n ...node,\n label: `${node.name}(${node.address})`\n })) || [];\n callBack?.(options);\n resolve(options);\n });\n });\n }\n\n /** 道路规划 */\n /**\r\n * \r\n * @param {*} AMapInit 当前地图实例\r\n * @param {*} paths 需查询的路径起始点及途径点集合\r\n * @param {*} roadOptions 路线规划的其他参数\r\n * { paths: 需查询的路径起始点及途径点集合, options: 为查询路线配置项 }\r\n * @param {*} callBack 查询成功后回调函数 兼容老版本代码\r\n */\n async setMapDriving(mapInstance, roadOptions, callBack) {\n const {\n paths,\n options = {}\n } = roadOptions;\n return new Promise(resolve => {\n mapInstance.plugin(\"AMap.Driving\", () => {\n const driving = new this.AMap.Driving({\n map: mapInstance,\n ...options\n });\n driving.search(this.setLngLat(paths[0]), this.setLngLat(paths[paths.length - 1]), {\n waypoints: paths.slice(1, -1).map(path => this.setLngLat(path))\n }, (status, {\n routes\n }) => status === 'complete' && (callBack?.(roadDriving, routes), resolve({\n driving,\n routes\n })));\n });\n });\n }\n\n // 其他方法保持类似改造...\n}\n\n// 获取AMap实例(组件内使用)\nconst getAMapInstance = async (options = {}) => {\n if (AMapInstance) return AMapInstance;\n try {\n const AMap = await _amap_amap_jsapi_loader__WEBPACK_IMPORTED_MODULE_1___default().load({\n key: AMapKey,\n version: '2.0',\n plugins: ['AMap.Geocoder', 'AMap.PlaceSearch',\n // 搜索\n 'AMap.MouseTool',\n // 鼠标\n 'AMap.ControlBar',\n // 方向盘\n 'AMap.ToolBar',\n // 缩放\n ...(options.plugins || [])]\n });\n AMapInstance = new AMapService(AMap);\n return AMapInstance;\n } catch (e) {\n throw new Error(`高德地图加载失败: ${e.message}`);\n }\n};\n\n// 在 Vue 插件中封装高德地图的初始化和常用方法 \n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n async install(Vue, options = {}) {\n const amap = await getAMapInstance(options);\n const {\n AMap,\n methods,\n layers\n } = amap;\n Vue.prototype.$amap = AMap;\n\n /** 初始化地图 */\n Vue.prototype.$initAMap = (mapOptions, callBack) => {\n const amapInit = amap.initMap(mapOptions.el, mapOptions.options || {});\n /** 兼容之前版本代码 */\n callBack?.(amapInit);\n return amapInit;\n };\n\n /** 地图加载完成 */\n Vue.prototype.$amapBus.$emit('onAMapMounted');\n\n /** 常用覆盖物 */\n Vue.prototype.$amapLayers = {\n ...layers,\n setInfoWindow: layers.setInfoWindow(Vue)\n };\n\n /** 抛出地图常用方法 */\n Vue.prototype.$amapMethods = methods || {};\n }\n});\n\n/** \r\n * 安全获取覆盖物坐标信息 \r\n * @param {AMap.Overlay} overlay 地图覆盖物实例\r\n * @returns {Array<Array<number>>} 坐标点数组\r\n */\nfunction getOverlayPos(overlay) {\n if (!overlay) throw new Error('覆盖物实例不存在');\n try {\n return overlay.type === 'AMap.Marker' ? [overlay.getPosition().lng, overlay.getPosition().lat] : overlay.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n } catch (e) {\n console.error('转换失败', e);\n return [];\n }\n}\n\n/**\r\n * 轨迹动画执行器\r\n * @param {AMap.Map} AMapInit 地图实例\r\n * @param {AMap.Marker} animationMarker 动画标记物\r\n * @param {Array<Array<number>>} paths 路径坐标数组\r\n * @param {Object} [options] 动画配置\r\n * @param {Function} [callBack] 动画完成回调\r\n */\nfunction drawMapAnimation(AMapInit, animationMarker, paths, options = {}, callBack) {\n if (!AMapInit || !animationMarker || !paths?.length) {\n return console.error('缺少参数信息');\n }\n AMapInit.plugin('AMap.MoveAnimation', () => {\n const defaultOptions = {\n duration: 500,\n autoRotation: true,\n ...options\n };\n animationMarker.moveAlong(paths, defaultOptions);\n callBack?.(animationMarker);\n });\n}\n\n/**\r\n * 转换导航路线为可绘制路径\r\n * @param {AMap.DrivingRoute} route 导航路线对象\r\n * @returns {{\r\n* path: Array<Array<number>>,\r\n* approachPoints: Array<number>\r\n* }}\r\n*/\nfunction parseRouteToPath(route) {\n if (!route?.steps) return {\n path: [],\n approachPoints: []\n };\n const result = {\n path: [],\n approachPoints: []\n };\n route.steps.forEach((step, stepIndex) => {\n step.path.forEach((point, pointIndex) => {\n result.path.push([point.lng, point.lat]);\n if (step.assistant_action === \"到达途经地\" && pointIndex === step.path.length - 1) {\n result.approachPoints.push(result.path.length - 1);\n }\n });\n });\n return result;\n}\n\n//# sourceURL=webpack://mui/./plugins/method/AMap.js?");
|
|
9343
|
+
|
|
9344
|
+
/***/ }),
|
|
9345
|
+
|
|
9324
9346
|
/***/ "./plugins/utils/Base64.js":
|
|
9325
9347
|
/*!*********************************!*\
|
|
9326
9348
|
!*** ./plugins/utils/Base64.js ***!
|
|
@@ -9349,7 +9371,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
9349
9371
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9350
9372
|
|
|
9351
9373
|
"use strict";
|
|
9352
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ filterTreeById: function() { return /* binding */ filterTreeById; },\n/* harmony export */ findCheckNodes: function() { return /* binding */ findCheckNodes; },\n/* harmony export */ getAllParents: function() { return /* binding */ getAllParents; },\n/* harmony export */
|
|
9374
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ filterTreeById: function() { return /* binding */ filterTreeById; },\n/* harmony export */ findCheckNodes: function() { return /* binding */ findCheckNodes; },\n/* harmony export */ getAllParents: function() { return /* binding */ getAllParents; },\n/* harmony export */ getTreeKey: function() { return /* binding */ getTreeKey; },\n/* harmony export */ joinTreeMessage: function() { return /* binding */ joinTreeMessage; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n\n/** 默认TreeData字段 */\nconst defaultReplaceFields = {\n key: 'id',\n title: 'title',\n children: 'children'\n};\n\n/**\r\n * 提取树形结构中的键值集合\r\n * @param {Array} nodes 树形数据\r\n * @param {boolean} [parent=false] 是否只提取父节点\r\n * @param {Object} [replaceFields={}] 字段映射配置\r\n * @param {string} [replaceFields.children='children'] 子节点字段名\r\n * @param {string} [replaceFields.key='id'] 键名字段名\r\n * @returns {Array} 提取的键值数组\r\n */\nfunction getTreeKey(nodes = [], parent = false, {\n children = 'children',\n key = 'id'\n} = {}) {\n const keys = [];\n function traverse(node) {\n const shouldCollect = !parent || node[children]?.length;\n if (shouldCollect) keys.push(node[key]);\n if (node[children]?.length) {\n node[children].forEach(traverse);\n }\n }\n nodes.forEach(traverse);\n return keys;\n}\n\n/**\r\n * 根据树子节点ID过滤出最后一级child\r\n * @param {array} dataSource 树形结构数据源\r\n * @param {array} nodeIds 需要过滤的数据集\r\n * @param {string} hasField 过滤包含属性(默认为children)\r\n * @param {string} searchField 查找属性(默认为id)\r\n */\n\nfunction findCheckNodes(dataSource, nodeIds, searchField = 'id', hasField = 'children') {\n let checkNodes = [];\n function traverse(node, nodeIds) {\n if (nodeIds.includes(node[searchField]) && !node.hasOwnProperty(hasField)) {\n checkNodes.push(node);\n return true;\n }\n node[hasField] && node[hasField].forEach(childNode => {\n if (traverse(childNode, nodeIds)) return true;\n });\n return false;\n }\n for (let i = 0; i < dataSource.length; i++) {\n if (traverse(dataSource[i], nodeIds)) {\n break;\n }\n }\n return checkNodes;\n}\n\n/**\r\n * 拼接树节点指定字段为字符串\r\n * @param {Array} nodes 树形数据\r\n * @param {Array} fields 需要拼接的字段数组\r\n * @param {string} replaceField 拼接后存储的字段名\r\n * @param {string} childNode 子节点字段名\r\n * @returns {Array} 处理后的树形数据\r\n */\nfunction joinTreeMessage(nodes = [], fields = [], replaceField = 'message', childNode = 'children') {\n if (!Array.isArray(nodes) || !Array.isArray(fields)) return nodes;\n const processNode = node => {\n node[replaceField] = fields.filter(field => node[field]).map(field => node[field]).join(' ');\n if (Array.isArray(node[childNode])) {\n node[childNode].forEach(processNode);\n }\n };\n nodes.forEach(processNode);\n return nodes;\n}\n\n/**\r\n * 获取树节点对应数据\r\n * @param {Array} tree 树形数据 \r\n * @param {string|number} key 目标节点Key\r\n * @param {Object} [replaceFields={}] 字段映射配置\r\n */\nfunction filterTreeById(tree, key, {\n children = 'children',\n key: idKey = 'id'\n} = {}) {\n for (const node of tree) {\n if (node[idKey] === key) return [node];\n if (node[children]?.length) {\n const result = filterTreeById(node[children], key, {\n children,\n key: idKey\n });\n if (result.length) return result;\n }\n }\n return [];\n}\n\n/**\r\n * 获取树节点所有父级路径\r\n * @param {Array} tree 树形数据 \r\n * @param {string|number} nodeId 目标节点ID\r\n * @param {Object} [replaceFields={}] 字段映射配置\r\n * @param {boolean} [returnObjects=false] 是否返回完整对象\r\n */\nfunction getAllParents(tree, nodeId, {\n children = 'children',\n key = 'id'\n} = {}, returnObjects = false) {\n if (!tree?.length) return [];\n\n // 创建节点映射表提升查找性能\n const nodeMap = new Map();\n const buildMap = (nodes, parentId) => {\n nodes.forEach(node => {\n // 使用WeakMap存储parentId避免污染原对象\n const metaInfo = new WeakMap();\n metaInfo.set(node, {\n parentId\n });\n nodeMap.set(node[key], {\n node,\n metaInfo\n });\n if (node[children]?.length) buildMap(node[children], node[key]);\n });\n };\n buildMap(tree);\n\n // 回溯构建路径\n const path = [];\n let current = nodeMap.get(nodeId);\n while (current) {\n if (returnObjects) {\n // 直接返回原对象\n path.unshift(current.node);\n } else {\n path.unshift(current.node[key]);\n }\n current = current.metaInfo.get(current.node).parentId ? nodeMap.get(current.metaInfo.get(current.node).parentId) : null;\n }\n\n // 对象集合则返回父级\n return returnObjects ? path[0] : path;\n}\n\n//# sourceURL=webpack://mui/./plugins/utils/Tree.js?");
|
|
9353
9375
|
|
|
9354
9376
|
/***/ }),
|
|
9355
9377
|
|
|
@@ -13464,6 +13486,75 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
13464
13486
|
/******/ __webpack_require__.m = __webpack_modules__;
|
|
13465
13487
|
/******/
|
|
13466
13488
|
/************************************************************************/
|
|
13489
|
+
/******/ /* webpack/runtime/async module */
|
|
13490
|
+
/******/ !function() {
|
|
13491
|
+
/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
|
|
13492
|
+
/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
|
|
13493
|
+
/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
|
|
13494
|
+
/******/ var resolveQueue = function(queue) {
|
|
13495
|
+
/******/ if(queue && queue.d < 1) {
|
|
13496
|
+
/******/ queue.d = 1;
|
|
13497
|
+
/******/ queue.forEach(function(fn) { fn.r--; });
|
|
13498
|
+
/******/ queue.forEach(function(fn) { fn.r-- ? fn.r++ : fn(); });
|
|
13499
|
+
/******/ }
|
|
13500
|
+
/******/ }
|
|
13501
|
+
/******/ var wrapDeps = function(deps) { return deps.map(function(dep) {
|
|
13502
|
+
/******/ if(dep !== null && typeof dep === "object") {
|
|
13503
|
+
/******/ if(dep[webpackQueues]) return dep;
|
|
13504
|
+
/******/ if(dep.then) {
|
|
13505
|
+
/******/ var queue = [];
|
|
13506
|
+
/******/ queue.d = 0;
|
|
13507
|
+
/******/ dep.then(function(r) {
|
|
13508
|
+
/******/ obj[webpackExports] = r;
|
|
13509
|
+
/******/ resolveQueue(queue);
|
|
13510
|
+
/******/ }, function(e) {
|
|
13511
|
+
/******/ obj[webpackError] = e;
|
|
13512
|
+
/******/ resolveQueue(queue);
|
|
13513
|
+
/******/ });
|
|
13514
|
+
/******/ var obj = {};
|
|
13515
|
+
/******/ obj[webpackQueues] = function(fn) { fn(queue); };
|
|
13516
|
+
/******/ return obj;
|
|
13517
|
+
/******/ }
|
|
13518
|
+
/******/ }
|
|
13519
|
+
/******/ var ret = {};
|
|
13520
|
+
/******/ ret[webpackQueues] = function() {};
|
|
13521
|
+
/******/ ret[webpackExports] = dep;
|
|
13522
|
+
/******/ return ret;
|
|
13523
|
+
/******/ }); };
|
|
13524
|
+
/******/ __webpack_require__.a = function(module, body, hasAwait) {
|
|
13525
|
+
/******/ var queue;
|
|
13526
|
+
/******/ hasAwait && ((queue = []).d = -1);
|
|
13527
|
+
/******/ var depQueues = new Set();
|
|
13528
|
+
/******/ var exports = module.exports;
|
|
13529
|
+
/******/ var currentDeps;
|
|
13530
|
+
/******/ var outerResolve;
|
|
13531
|
+
/******/ var reject;
|
|
13532
|
+
/******/ var promise = new Promise(function(resolve, rej) {
|
|
13533
|
+
/******/ reject = rej;
|
|
13534
|
+
/******/ outerResolve = resolve;
|
|
13535
|
+
/******/ });
|
|
13536
|
+
/******/ promise[webpackExports] = exports;
|
|
13537
|
+
/******/ promise[webpackQueues] = function(fn) { queue && fn(queue), depQueues.forEach(fn), promise["catch"](function() {}); };
|
|
13538
|
+
/******/ module.exports = promise;
|
|
13539
|
+
/******/ body(function(deps) {
|
|
13540
|
+
/******/ currentDeps = wrapDeps(deps);
|
|
13541
|
+
/******/ var fn;
|
|
13542
|
+
/******/ var getResult = function() { return currentDeps.map(function(d) {
|
|
13543
|
+
/******/ if(d[webpackError]) throw d[webpackError];
|
|
13544
|
+
/******/ return d[webpackExports];
|
|
13545
|
+
/******/ }); }
|
|
13546
|
+
/******/ var promise = new Promise(function(resolve) {
|
|
13547
|
+
/******/ fn = function() { resolve(getResult); };
|
|
13548
|
+
/******/ fn.r = 0;
|
|
13549
|
+
/******/ var fnQueue = function(q) { q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))); };
|
|
13550
|
+
/******/ currentDeps.map(function(dep) { dep[webpackQueues](fnQueue); });
|
|
13551
|
+
/******/ });
|
|
13552
|
+
/******/ return fn.r ? promise : getResult();
|
|
13553
|
+
/******/ }, function(err) { (err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue); });
|
|
13554
|
+
/******/ queue && queue.d < 0 && (queue.d = 0);
|
|
13555
|
+
/******/ };
|
|
13556
|
+
/******/ }();
|
|
13557
|
+
/******/
|
|
13467
13558
|
/******/ /* webpack/runtime/compat get default export */
|
|
13468
13559
|
/******/ !function() {
|
|
13469
13560
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|