web-component-gallery 0.1.79 → 1.1.0
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 +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/layout.umd.js +1 -1
- package/lib/amap/AmapDraw.jsx +17 -9
- package/lib/amap/AmapDraw.less +12 -12
- package/lib/amap/components/AmapSearch/index.css +1 -1
- package/lib/amap/components/AmapSearch/index.jsx +9 -9
- package/lib/amap/components/AmapSearch/index.less +5 -5
- package/lib/layout/components/TopMenu/TopMenu.jsx +15 -18
- package/package.json +1 -1
- package/plugins/lib/amap/AmapDraw.jsx +17 -9
- package/plugins/lib/amap/AmapDraw.less +12 -12
- package/plugins/lib/amap/components/AmapSearch/index.jsx +9 -9
- package/plugins/lib/amap/components/AmapSearch/index.less +5 -5
- package/plugins/lib/layout/components/TopMenu/TopMenu.jsx +15 -18
- package/lib/table/style/index.css +0 -1
- package/utils/Postcss.js +0 -9
- package/utils/Storage.js +0 -73
- /package/plugins/utils/{autoFlexible.js → AutoFlexible.js} +0 -0
package/dist/amap.umd.js
CHANGED
|
@@ -8527,7 +8527,7 @@ eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source cod
|
|
|
8527
8527
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8528
8528
|
|
|
8529
8529
|
"use strict";
|
|
8530
|
-
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 model: {\n prop: 'drawInfo',\n event: 'getAMapLayersInfo'\n },\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 this.drawLayersInfo = newVal;\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 }, 60);\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' ? this.$amapLayers.setMarker(this.drawIcon).getOptions() : {\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 if (!drawItem || !Object.keys(drawItem).length || !this.amap) return;\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 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 props,\n drawEl,\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 ...props,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose: 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?");
|
|
8530
|
+
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 model: {\n prop: 'drawInfo',\n event: 'getAMapLayersInfo'\n },\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 this.drawLayersInfo = newVal;\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 }, 60);\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' ? this.$amapLayers.setMarker(this.drawIcon).getOptions() : {\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 if (!drawItem || !Object.keys(drawItem).length || !this.amap) return;\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 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?");
|
|
8531
8531
|
|
|
8532
8532
|
/***/ }),
|
|
8533
8533
|
|
|
@@ -8538,7 +8538,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8538
8538
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8539
8539
|
|
|
8540
8540
|
"use strict";
|
|
8541
|
-
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:
|
|
8541
|
+
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?");
|
|
8542
8542
|
|
|
8543
8543
|
/***/ }),
|
|
8544
8544
|
|
|
@@ -8780,7 +8780,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8780
8780
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8781
8781
|
|
|
8782
8782
|
"use strict";
|
|
8783
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TopMenuProps: function() { return /* binding */ TopMenuProps; }\n/* harmony export */ });\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\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 ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es/menu */ \"./node_modules/ant-design-vue/es/menu/index.js\");\n\n\n\nconst {\n Item: MenuItem,\n SubMenu\n} = ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst TopMenuProps = {\n menus: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array,\n theme: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string.def('dark'),\n i18nRender: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].func, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].bool]).def(false)\n};\nconst httpReg = /(http|https|ftp):\\/\\/([\\w.]+\\/?)\\S*/;\nconst renderMenu = (h, item, i18nRender, selectedKeys) => {\n if (item && !item.hidden) {\n const bool = item.children && !item.hideChildrenInMenu;\n return bool ? renderSubMenu(h, item, i18nRender, selectedKeys) : renderMenuItem(h, item, i18nRender);\n }\n return null;\n};\nconst renderSubMenu = (h, item, i18nRender, selectedKeys) => {\n const menuActive = item.children.find(children => selectedKeys.includes(children.path)) ?? item;\n return h(SubMenu, {\n \"key\": item.path,\n \"attrs\": {\n \"title\": h(\"span\", [renderTitle(h, menuActive.meta.title, i18nRender)])\n }\n }, [!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))]);\n};\nconst renderMenuItem = (h, item, i18nRender) => {\n const meta = Object.assign({}, item.meta);\n const target = meta.target || null;\n const hasRemoteUrl = httpReg.test(item.path);\n const CustomTag = target && 'a' || 'router-link';\n const props = {\n to: {\n name: item.name\n }\n };\n const attrs = hasRemoteUrl || target ? {\n href: item.path,\n target: target\n } : {};\n if (item.children && item.hideChildrenInMenu) {\n // 把有子菜单的 并且 父菜单是要隐藏子菜单的\n // 都给子菜单增加一个 hidden 属性\n // 用来给刷新页面时, selectedKeys 做控制用\n item.children.forEach(cd => {\n cd.meta = Object.assign(cd.meta || {}, {\n hidden: true\n });\n });\n }\n return h(MenuItem, {\n \"key\": item.path\n }, [h(CustomTag, {\n \"props\": {\n ...props\n },\n \"attrs\": {\n ...attrs\n }\n }, [renderTitle(h, meta.title, i18nRender)])]);\n};\nconst renderTitle = (h, title, i18nRender) => {\n return h(\"span\", [i18nRender && i18nRender(title) || title]);\n};\nconst TopMenu = {\n name: 'TopMenu',\n props: TopMenuProps,\n data() {\n return {\n openKeys: [],\n selectedKeys: [],\n cachedOpenKeys: [],\n cachedSelectedKeys: []\n };\n },\n render(h) {\n const {\n theme,\n menus,\n i18nRender\n } = this;\n const handleOpenChange = openKeys => {\n this.openKeys = openKeys;\n };\n const dynamicProps = {\n props: {\n mode: 'horizontal',\n theme,\n openKeys: this.openKeys,\n selectedKeys: this.selectedKeys\n },\n on: {\n select: menu => {\n this.$emit('select', menu);\n if (!httpReg.test(menu.key)) {\n this.selectedKeys = menu.selectedKeys;\n }\n },\n openChange: handleOpenChange\n }\n };\n const menuItems = menus.map(item => {\n if (item.hidden) {\n return null;\n }\n return renderMenu(h, item, i18nRender, this.selectedKeys);\n });\n return h(ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{}, dynamicProps]), [menuItems]);\n },\n methods: {\n updateMenu() {\n const routes = this.$route.matched.concat();\n const {\n hidden
|
|
8783
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TopMenuProps: function() { return /* binding */ TopMenuProps; }\n/* harmony export */ });\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\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 ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es/menu */ \"./node_modules/ant-design-vue/es/menu/index.js\");\n\n\n\nconst {\n Item: MenuItem,\n SubMenu\n} = ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst TopMenuProps = {\n menus: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array,\n theme: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string.def('dark'),\n i18nRender: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].func, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].bool]).def(false),\n popupClassName: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string\n};\nconst httpReg = /(http|https|ftp):\\/\\/([\\w.]+\\/?)\\S*/;\nconst renderMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {\n if (item && !item.hidden) {\n const bool = item.children && !item.hideChildrenInMenu;\n return bool ? renderSubMenu(h, item, i18nRender, selectedKeys, popupClassName) : renderMenuItem(h, item, i18nRender);\n }\n return null;\n};\nconst renderSubMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {\n const menuActive = item.children.find(children => selectedKeys.includes(children.path)) ?? item;\n return h(SubMenu, {\n \"key\": item.path,\n \"attrs\": {\n \"title\": h(\"span\", [renderTitle(h, menuActive.meta.title, i18nRender)])\n },\n \"props\": {\n ...{\n popupClassName\n }\n }\n }, [!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))]);\n};\nconst renderMenuItem = (h, item, i18nRender) => {\n const meta = Object.assign({}, item.meta);\n const target = meta.target || null;\n const hasRemoteUrl = httpReg.test(item.path);\n const CustomTag = target && 'a' || 'router-link';\n const props = {\n to: {\n name: item.name\n }\n };\n const attrs = hasRemoteUrl || target ? {\n href: item.path,\n target: target\n } : {};\n if (item.children && item.hideChildrenInMenu) {\n // 把有子菜单的 并且 父菜单是要隐藏子菜单的\n // 都给子菜单增加一个 hidden 属性\n // 用来给刷新页面时, selectedKeys 做控制用\n item.children.forEach(cd => {\n cd.meta = Object.assign(cd.meta || {}, {\n hidden: true\n });\n });\n }\n return h(MenuItem, {\n \"key\": item.path\n }, [h(CustomTag, {\n \"props\": {\n ...props\n },\n \"attrs\": {\n ...attrs\n }\n }, [renderTitle(h, meta.title, i18nRender)])]);\n};\nconst renderTitle = (h, title, i18nRender) => {\n return h(\"span\", [i18nRender && i18nRender(title) || title]);\n};\nconst TopMenu = {\n name: 'TopMenu',\n props: TopMenuProps,\n data() {\n return {\n openKeys: [],\n selectedKeys: [],\n cachedOpenKeys: [],\n cachedSelectedKeys: []\n };\n },\n render(h) {\n const {\n theme,\n menus,\n i18nRender,\n popupClassName\n } = this;\n const handleOpenChange = openKeys => {\n this.openKeys = openKeys;\n };\n const dynamicProps = {\n props: {\n mode: 'horizontal',\n theme,\n openKeys: this.openKeys,\n selectedKeys: this.selectedKeys\n },\n on: {\n select: menu => {\n this.$emit('select', menu);\n if (!httpReg.test(menu.key)) {\n this.selectedKeys = menu.selectedKeys;\n }\n },\n openChange: handleOpenChange\n }\n };\n const menuItems = menus.map(item => {\n if (item.hidden) {\n return null;\n }\n return renderMenu(h, item, i18nRender, this.selectedKeys, popupClassName);\n });\n return h(ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{}, dynamicProps]), [menuItems]);\n },\n methods: {\n updateMenu() {\n const routes = this.$route.matched.concat();\n const {\n hidden\n } = this.$route.meta;\n if (routes.length >= 3 && hidden) {\n routes.pop();\n this.selectedKeys = [routes[routes.length - 1].path];\n } else {\n this.selectedKeys = [routes.pop().path];\n }\n }\n },\n created() {\n this.$watch('$route', () => {\n this.updateMenu();\n });\n },\n mounted() {\n this.updateMenu();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (TopMenu);\n\n//# sourceURL=webpack://mui/./plugins/lib/layout/components/TopMenu/TopMenu.jsx?");
|
|
8784
8784
|
|
|
8785
8785
|
/***/ }),
|
|
8786
8786
|
|
|
@@ -9054,7 +9054,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
9054
9054
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9055
9055
|
|
|
9056
9056
|
"use strict";
|
|
9057
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".
|
|
9057
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".AmapDraw__Search {\\n display: flex;\\n align-items: center;\\n width: calc(100% - 16px);\\n}\\n.AmapDraw__Search .ASelectCustom {\\n width: 346px;\\n}\\n.AmapDraw__Search__Button {\\n flex: 1;\\n gap: 0 8px;\\n display: flex;\\n justify-content: flex-end;\\n}\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.less?./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use%5B2%5D");
|
|
9058
9058
|
|
|
9059
9059
|
/***/ }),
|
|
9060
9060
|
|
package/dist/index.umd.js
CHANGED
|
@@ -8527,7 +8527,7 @@ eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source cod
|
|
|
8527
8527
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8528
8528
|
|
|
8529
8529
|
"use strict";
|
|
8530
|
-
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 model: {\n prop: 'drawInfo',\n event: 'getAMapLayersInfo'\n },\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 this.drawLayersInfo = newVal;\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 }, 60);\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' ? this.$amapLayers.setMarker(this.drawIcon).getOptions() : {\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 if (!drawItem || !Object.keys(drawItem).length || !this.amap) return;\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 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 props,\n drawEl,\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 ...props,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose: 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?");
|
|
8530
|
+
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 model: {\n prop: 'drawInfo',\n event: 'getAMapLayersInfo'\n },\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 this.drawLayersInfo = newVal;\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 }, 60);\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' ? this.$amapLayers.setMarker(this.drawIcon).getOptions() : {\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 if (!drawItem || !Object.keys(drawItem).length || !this.amap) return;\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 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?");
|
|
8531
8531
|
|
|
8532
8532
|
/***/ }),
|
|
8533
8533
|
|
|
@@ -8538,7 +8538,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8538
8538
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8539
8539
|
|
|
8540
8540
|
"use strict";
|
|
8541
|
-
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:
|
|
8541
|
+
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?");
|
|
8542
8542
|
|
|
8543
8543
|
/***/ }),
|
|
8544
8544
|
|
|
@@ -8780,7 +8780,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8780
8780
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8781
8781
|
|
|
8782
8782
|
"use strict";
|
|
8783
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TopMenuProps: function() { return /* binding */ TopMenuProps; }\n/* harmony export */ });\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\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 ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es/menu */ \"./node_modules/ant-design-vue/es/menu/index.js\");\n\n\n\nconst {\n Item: MenuItem,\n SubMenu\n} = ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst TopMenuProps = {\n menus: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array,\n theme: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string.def('dark'),\n i18nRender: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].func, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].bool]).def(false)\n};\nconst httpReg = /(http|https|ftp):\\/\\/([\\w.]+\\/?)\\S*/;\nconst renderMenu = (h, item, i18nRender, selectedKeys) => {\n if (item && !item.hidden) {\n const bool = item.children && !item.hideChildrenInMenu;\n return bool ? renderSubMenu(h, item, i18nRender, selectedKeys) : renderMenuItem(h, item, i18nRender);\n }\n return null;\n};\nconst renderSubMenu = (h, item, i18nRender, selectedKeys) => {\n const menuActive = item.children.find(children => selectedKeys.includes(children.path)) ?? item;\n return h(SubMenu, {\n \"key\": item.path,\n \"attrs\": {\n \"title\": h(\"span\", [renderTitle(h, menuActive.meta.title, i18nRender)])\n }\n }, [!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))]);\n};\nconst renderMenuItem = (h, item, i18nRender) => {\n const meta = Object.assign({}, item.meta);\n const target = meta.target || null;\n const hasRemoteUrl = httpReg.test(item.path);\n const CustomTag = target && 'a' || 'router-link';\n const props = {\n to: {\n name: item.name\n }\n };\n const attrs = hasRemoteUrl || target ? {\n href: item.path,\n target: target\n } : {};\n if (item.children && item.hideChildrenInMenu) {\n // 把有子菜单的 并且 父菜单是要隐藏子菜单的\n // 都给子菜单增加一个 hidden 属性\n // 用来给刷新页面时, selectedKeys 做控制用\n item.children.forEach(cd => {\n cd.meta = Object.assign(cd.meta || {}, {\n hidden: true\n });\n });\n }\n return h(MenuItem, {\n \"key\": item.path\n }, [h(CustomTag, {\n \"props\": {\n ...props\n },\n \"attrs\": {\n ...attrs\n }\n }, [renderTitle(h, meta.title, i18nRender)])]);\n};\nconst renderTitle = (h, title, i18nRender) => {\n return h(\"span\", [i18nRender && i18nRender(title) || title]);\n};\nconst TopMenu = {\n name: 'TopMenu',\n props: TopMenuProps,\n data() {\n return {\n openKeys: [],\n selectedKeys: [],\n cachedOpenKeys: [],\n cachedSelectedKeys: []\n };\n },\n render(h) {\n const {\n theme,\n menus,\n i18nRender\n } = this;\n const handleOpenChange = openKeys => {\n this.openKeys = openKeys;\n };\n const dynamicProps = {\n props: {\n mode: 'horizontal',\n theme,\n openKeys: this.openKeys,\n selectedKeys: this.selectedKeys\n },\n on: {\n select: menu => {\n this.$emit('select', menu);\n if (!httpReg.test(menu.key)) {\n this.selectedKeys = menu.selectedKeys;\n }\n },\n openChange: handleOpenChange\n }\n };\n const menuItems = menus.map(item => {\n if (item.hidden) {\n return null;\n }\n return renderMenu(h, item, i18nRender, this.selectedKeys);\n });\n return h(ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{}, dynamicProps]), [menuItems]);\n },\n methods: {\n updateMenu() {\n const routes = this.$route.matched.concat();\n const {\n hidden
|
|
8783
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TopMenuProps: function() { return /* binding */ TopMenuProps; }\n/* harmony export */ });\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\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 ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es/menu */ \"./node_modules/ant-design-vue/es/menu/index.js\");\n\n\n\nconst {\n Item: MenuItem,\n SubMenu\n} = ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst TopMenuProps = {\n menus: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array,\n theme: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string.def('dark'),\n i18nRender: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].func, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].bool]).def(false),\n popupClassName: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string\n};\nconst httpReg = /(http|https|ftp):\\/\\/([\\w.]+\\/?)\\S*/;\nconst renderMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {\n if (item && !item.hidden) {\n const bool = item.children && !item.hideChildrenInMenu;\n return bool ? renderSubMenu(h, item, i18nRender, selectedKeys, popupClassName) : renderMenuItem(h, item, i18nRender);\n }\n return null;\n};\nconst renderSubMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {\n const menuActive = item.children.find(children => selectedKeys.includes(children.path)) ?? item;\n return h(SubMenu, {\n \"key\": item.path,\n \"attrs\": {\n \"title\": h(\"span\", [renderTitle(h, menuActive.meta.title, i18nRender)])\n },\n \"props\": {\n ...{\n popupClassName\n }\n }\n }, [!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))]);\n};\nconst renderMenuItem = (h, item, i18nRender) => {\n const meta = Object.assign({}, item.meta);\n const target = meta.target || null;\n const hasRemoteUrl = httpReg.test(item.path);\n const CustomTag = target && 'a' || 'router-link';\n const props = {\n to: {\n name: item.name\n }\n };\n const attrs = hasRemoteUrl || target ? {\n href: item.path,\n target: target\n } : {};\n if (item.children && item.hideChildrenInMenu) {\n // 把有子菜单的 并且 父菜单是要隐藏子菜单的\n // 都给子菜单增加一个 hidden 属性\n // 用来给刷新页面时, selectedKeys 做控制用\n item.children.forEach(cd => {\n cd.meta = Object.assign(cd.meta || {}, {\n hidden: true\n });\n });\n }\n return h(MenuItem, {\n \"key\": item.path\n }, [h(CustomTag, {\n \"props\": {\n ...props\n },\n \"attrs\": {\n ...attrs\n }\n }, [renderTitle(h, meta.title, i18nRender)])]);\n};\nconst renderTitle = (h, title, i18nRender) => {\n return h(\"span\", [i18nRender && i18nRender(title) || title]);\n};\nconst TopMenu = {\n name: 'TopMenu',\n props: TopMenuProps,\n data() {\n return {\n openKeys: [],\n selectedKeys: [],\n cachedOpenKeys: [],\n cachedSelectedKeys: []\n };\n },\n render(h) {\n const {\n theme,\n menus,\n i18nRender,\n popupClassName\n } = this;\n const handleOpenChange = openKeys => {\n this.openKeys = openKeys;\n };\n const dynamicProps = {\n props: {\n mode: 'horizontal',\n theme,\n openKeys: this.openKeys,\n selectedKeys: this.selectedKeys\n },\n on: {\n select: menu => {\n this.$emit('select', menu);\n if (!httpReg.test(menu.key)) {\n this.selectedKeys = menu.selectedKeys;\n }\n },\n openChange: handleOpenChange\n }\n };\n const menuItems = menus.map(item => {\n if (item.hidden) {\n return null;\n }\n return renderMenu(h, item, i18nRender, this.selectedKeys, popupClassName);\n });\n return h(ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{}, dynamicProps]), [menuItems]);\n },\n methods: {\n updateMenu() {\n const routes = this.$route.matched.concat();\n const {\n hidden\n } = this.$route.meta;\n if (routes.length >= 3 && hidden) {\n routes.pop();\n this.selectedKeys = [routes[routes.length - 1].path];\n } else {\n this.selectedKeys = [routes.pop().path];\n }\n }\n },\n created() {\n this.$watch('$route', () => {\n this.updateMenu();\n });\n },\n mounted() {\n this.updateMenu();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (TopMenu);\n\n//# sourceURL=webpack://mui/./plugins/lib/layout/components/TopMenu/TopMenu.jsx?");
|
|
8784
8784
|
|
|
8785
8785
|
/***/ }),
|
|
8786
8786
|
|
|
@@ -9054,7 +9054,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
9054
9054
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9055
9055
|
|
|
9056
9056
|
"use strict";
|
|
9057
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".
|
|
9057
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".AmapDraw__Search {\\n display: flex;\\n align-items: center;\\n width: calc(100% - 16px);\\n}\\n.AmapDraw__Search .ASelectCustom {\\n width: 346px;\\n}\\n.AmapDraw__Search__Button {\\n flex: 1;\\n gap: 0 8px;\\n display: flex;\\n justify-content: flex-end;\\n}\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.less?./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use%5B2%5D");
|
|
9058
9058
|
|
|
9059
9059
|
/***/ }),
|
|
9060
9060
|
|
package/dist/layout.umd.js
CHANGED
|
@@ -3053,7 +3053,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
3053
3053
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
3054
3054
|
|
|
3055
3055
|
"use strict";
|
|
3056
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TopMenuProps: function() { return /* binding */ TopMenuProps; }\n/* harmony export */ });\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\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 ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es/menu */ \"./node_modules/ant-design-vue/es/menu/index.js\");\n\n\n\nconst {\n Item: MenuItem,\n SubMenu\n} = ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst TopMenuProps = {\n menus: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array,\n theme: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string.def('dark'),\n i18nRender: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].func, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].bool]).def(false)\n};\nconst httpReg = /(http|https|ftp):\\/\\/([\\w.]+\\/?)\\S*/;\nconst renderMenu = (h, item, i18nRender, selectedKeys) => {\n if (item && !item.hidden) {\n const bool = item.children && !item.hideChildrenInMenu;\n return bool ? renderSubMenu(h, item, i18nRender, selectedKeys) : renderMenuItem(h, item, i18nRender);\n }\n return null;\n};\nconst renderSubMenu = (h, item, i18nRender, selectedKeys) => {\n const menuActive = item.children.find(children => selectedKeys.includes(children.path)) ?? item;\n return h(SubMenu, {\n \"key\": item.path,\n \"attrs\": {\n \"title\": h(\"span\", [renderTitle(h, menuActive.meta.title, i18nRender)])\n }\n }, [!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))]);\n};\nconst renderMenuItem = (h, item, i18nRender) => {\n const meta = Object.assign({}, item.meta);\n const target = meta.target || null;\n const hasRemoteUrl = httpReg.test(item.path);\n const CustomTag = target && 'a' || 'router-link';\n const props = {\n to: {\n name: item.name\n }\n };\n const attrs = hasRemoteUrl || target ? {\n href: item.path,\n target: target\n } : {};\n if (item.children && item.hideChildrenInMenu) {\n // 把有子菜单的 并且 父菜单是要隐藏子菜单的\n // 都给子菜单增加一个 hidden 属性\n // 用来给刷新页面时, selectedKeys 做控制用\n item.children.forEach(cd => {\n cd.meta = Object.assign(cd.meta || {}, {\n hidden: true\n });\n });\n }\n return h(MenuItem, {\n \"key\": item.path\n }, [h(CustomTag, {\n \"props\": {\n ...props\n },\n \"attrs\": {\n ...attrs\n }\n }, [renderTitle(h, meta.title, i18nRender)])]);\n};\nconst renderTitle = (h, title, i18nRender) => {\n return h(\"span\", [i18nRender && i18nRender(title) || title]);\n};\nconst TopMenu = {\n name: 'TopMenu',\n props: TopMenuProps,\n data() {\n return {\n openKeys: [],\n selectedKeys: [],\n cachedOpenKeys: [],\n cachedSelectedKeys: []\n };\n },\n render(h) {\n const {\n theme,\n menus,\n i18nRender\n } = this;\n const handleOpenChange = openKeys => {\n this.openKeys = openKeys;\n };\n const dynamicProps = {\n props: {\n mode: 'horizontal',\n theme,\n openKeys: this.openKeys,\n selectedKeys: this.selectedKeys\n },\n on: {\n select: menu => {\n this.$emit('select', menu);\n if (!httpReg.test(menu.key)) {\n this.selectedKeys = menu.selectedKeys;\n }\n },\n openChange: handleOpenChange\n }\n };\n const menuItems = menus.map(item => {\n if (item.hidden) {\n return null;\n }\n return renderMenu(h, item, i18nRender, this.selectedKeys);\n });\n return h(ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{}, dynamicProps]), [menuItems]);\n },\n methods: {\n updateMenu() {\n const routes = this.$route.matched.concat();\n const {\n hidden
|
|
3056
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TopMenuProps: function() { return /* binding */ TopMenuProps; }\n/* harmony export */ });\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @vue/babel-helper-vue-jsx-merge-props */ \"./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js\");\n/* harmony import */ var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__);\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 ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ant-design-vue/es/menu */ \"./node_modules/ant-design-vue/es/menu/index.js\");\n\n\n\nconst {\n Item: MenuItem,\n SubMenu\n} = ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nconst TopMenuProps = {\n menus: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].array,\n theme: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string.def('dark'),\n i18nRender: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].func, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].bool]).def(false),\n popupClassName: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_2__[\"default\"].string\n};\nconst httpReg = /(http|https|ftp):\\/\\/([\\w.]+\\/?)\\S*/;\nconst renderMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {\n if (item && !item.hidden) {\n const bool = item.children && !item.hideChildrenInMenu;\n return bool ? renderSubMenu(h, item, i18nRender, selectedKeys, popupClassName) : renderMenuItem(h, item, i18nRender);\n }\n return null;\n};\nconst renderSubMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {\n const menuActive = item.children.find(children => selectedKeys.includes(children.path)) ?? item;\n return h(SubMenu, {\n \"key\": item.path,\n \"attrs\": {\n \"title\": h(\"span\", [renderTitle(h, menuActive.meta.title, i18nRender)])\n },\n \"props\": {\n ...{\n popupClassName\n }\n }\n }, [!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))]);\n};\nconst renderMenuItem = (h, item, i18nRender) => {\n const meta = Object.assign({}, item.meta);\n const target = meta.target || null;\n const hasRemoteUrl = httpReg.test(item.path);\n const CustomTag = target && 'a' || 'router-link';\n const props = {\n to: {\n name: item.name\n }\n };\n const attrs = hasRemoteUrl || target ? {\n href: item.path,\n target: target\n } : {};\n if (item.children && item.hideChildrenInMenu) {\n // 把有子菜单的 并且 父菜单是要隐藏子菜单的\n // 都给子菜单增加一个 hidden 属性\n // 用来给刷新页面时, selectedKeys 做控制用\n item.children.forEach(cd => {\n cd.meta = Object.assign(cd.meta || {}, {\n hidden: true\n });\n });\n }\n return h(MenuItem, {\n \"key\": item.path\n }, [h(CustomTag, {\n \"props\": {\n ...props\n },\n \"attrs\": {\n ...attrs\n }\n }, [renderTitle(h, meta.title, i18nRender)])]);\n};\nconst renderTitle = (h, title, i18nRender) => {\n return h(\"span\", [i18nRender && i18nRender(title) || title]);\n};\nconst TopMenu = {\n name: 'TopMenu',\n props: TopMenuProps,\n data() {\n return {\n openKeys: [],\n selectedKeys: [],\n cachedOpenKeys: [],\n cachedSelectedKeys: []\n };\n },\n render(h) {\n const {\n theme,\n menus,\n i18nRender,\n popupClassName\n } = this;\n const handleOpenChange = openKeys => {\n this.openKeys = openKeys;\n };\n const dynamicProps = {\n props: {\n mode: 'horizontal',\n theme,\n openKeys: this.openKeys,\n selectedKeys: this.selectedKeys\n },\n on: {\n select: menu => {\n this.$emit('select', menu);\n if (!httpReg.test(menu.key)) {\n this.selectedKeys = menu.selectedKeys;\n }\n },\n openChange: handleOpenChange\n }\n };\n const menuItems = menus.map(item => {\n if (item.hidden) {\n return null;\n }\n return renderMenu(h, item, i18nRender, this.selectedKeys, popupClassName);\n });\n return h(ant_design_vue_es_menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{}, dynamicProps]), [menuItems]);\n },\n methods: {\n updateMenu() {\n const routes = this.$route.matched.concat();\n const {\n hidden\n } = this.$route.meta;\n if (routes.length >= 3 && hidden) {\n routes.pop();\n this.selectedKeys = [routes[routes.length - 1].path];\n } else {\n this.selectedKeys = [routes.pop().path];\n }\n }\n },\n created() {\n this.$watch('$route', () => {\n this.updateMenu();\n });\n },\n mounted() {\n this.updateMenu();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (TopMenu);\n\n//# sourceURL=webpack://mui/./plugins/lib/layout/components/TopMenu/TopMenu.jsx?");
|
|
3057
3057
|
|
|
3058
3058
|
/***/ }),
|
|
3059
3059
|
|
package/lib/amap/AmapDraw.jsx
CHANGED
|
@@ -18,7 +18,7 @@ export const AmapDrawProps = {
|
|
|
18
18
|
drawOptions: PropTypes.object.def({}),
|
|
19
19
|
/** drawInfo为绘制物信息 */
|
|
20
20
|
drawInfo: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
21
|
-
/** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)
|
|
21
|
+
/** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)
|
|
22
22
|
* 格式: { point: ([]||{}), line: ([]||{}) }
|
|
23
23
|
*/
|
|
24
24
|
drawInfoAll: PropTypes.object,
|
|
@@ -95,8 +95,8 @@ const AmapDraw = {
|
|
|
95
95
|
})
|
|
96
96
|
}, 60 )
|
|
97
97
|
},
|
|
98
|
-
destroyed() {
|
|
99
|
-
this.AmapDrawClear()
|
|
98
|
+
destroyed() {
|
|
99
|
+
this.AmapDrawClear()
|
|
100
100
|
},
|
|
101
101
|
methods: {
|
|
102
102
|
/** 绘制 */
|
|
@@ -111,7 +111,7 @@ const AmapDraw = {
|
|
|
111
111
|
if(this.drawArea && !this[`is${this.drawType}InRing`](obj)) return (
|
|
112
112
|
this.amap.remove(obj),
|
|
113
113
|
this.$message.error('未在范围内描绘!')
|
|
114
|
-
)
|
|
114
|
+
)
|
|
115
115
|
/** 暂未支持一次性绘制多个 */
|
|
116
116
|
this.drawCount > 1 ? (
|
|
117
117
|
this.drawLayers = this.drawLayers || [],
|
|
@@ -121,7 +121,7 @@ const AmapDraw = {
|
|
|
121
121
|
(this.drawLayers.length == this.drawCount ||
|
|
122
122
|
this.drawCount == 1 )) {
|
|
123
123
|
return this.drawMouseTool.close()
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
})
|
|
126
126
|
},
|
|
127
127
|
/** 清空绘制 / 清空搜索 */
|
|
@@ -148,7 +148,7 @@ const AmapDraw = {
|
|
|
148
148
|
this.AmapDrawClear()
|
|
149
149
|
searchMarker.setMap(this.amap)
|
|
150
150
|
this.amap.setZoomAndCenter( 15, searchMarker.getPosition() )
|
|
151
|
-
this.drawType == 'point' && (this.drawLayersInfo = searchInfo)
|
|
151
|
+
this.drawType == 'point' && (this.drawLayersInfo = searchInfo)
|
|
152
152
|
// this.$emit('getAMapLayersInfo', this.drawLayersInfo)
|
|
153
153
|
},
|
|
154
154
|
/** 检测覆盖物配置信息并同步 */
|
|
@@ -179,7 +179,7 @@ const AmapDraw = {
|
|
|
179
179
|
})
|
|
180
180
|
const {lng,lat} = this.drawArea.getBounds().getCenter()
|
|
181
181
|
this.amap.setZoomAndCenter( 15, [lng,lat] )
|
|
182
|
-
},
|
|
182
|
+
},
|
|
183
183
|
/** 判断一个线段是否在面内 */
|
|
184
184
|
islineInRing(polyline) {
|
|
185
185
|
const paths = polyline.getPath()
|
|
@@ -307,14 +307,22 @@ const AmapDraw = {
|
|
|
307
307
|
}
|
|
308
308
|
},
|
|
309
309
|
render (h) {
|
|
310
|
-
|
|
310
|
+
|
|
311
|
+
const {
|
|
312
|
+
drawEl,
|
|
313
|
+
drawIcon,
|
|
314
|
+
buttonProps,
|
|
315
|
+
isExhibition,
|
|
316
|
+
AmapDrawClear,
|
|
317
|
+
searchChoose
|
|
318
|
+
} = this
|
|
311
319
|
|
|
312
320
|
return (
|
|
313
321
|
<div class="AmapDraw">
|
|
314
322
|
{
|
|
315
323
|
!isExhibition &&
|
|
316
324
|
<AmapSearch
|
|
317
|
-
{ ...{ props: {
|
|
325
|
+
{ ...{ props: { drawIcon, buttonProps }, on: { searchReset: AmapDrawClear, searchChoose } } }
|
|
318
326
|
/>
|
|
319
327
|
}
|
|
320
328
|
<div id={drawEl} />
|
package/lib/amap/AmapDraw.less
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
.AmapDraw {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
&__Search {
|
|
5
|
-
top: 8px;
|
|
6
|
-
left: 8px;
|
|
7
|
-
z-index: 1;
|
|
8
|
-
position: absolute;
|
|
9
|
-
}
|
|
2
|
+
position: relative;
|
|
10
3
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
&__Search {
|
|
5
|
+
top: 8px;
|
|
6
|
+
left: 8px;
|
|
7
|
+
z-index: 1;
|
|
8
|
+
position: absolute;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#AmapDraw {
|
|
12
|
+
width: 100%;
|
|
13
|
+
min-height: 304px;
|
|
14
|
+
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.AmapDraw__Search{display:flex;align-items:center;width:calc(100% - 16px)}.AmapDraw__Search .ASelectCustom{width:346px}.AmapDraw__Search__Button{flex:1;gap:0 8px;display:flex;justify-content:flex-end}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FormComp, Button} from '../../../index'
|
|
1
|
+
import {FormComp, Button} from '../../../index'
|
|
2
2
|
import PropTypes from 'ant-design-vue/es/_util/vue-types'
|
|
3
3
|
|
|
4
4
|
import './index.less'
|
|
@@ -17,7 +17,7 @@ const AmapSearch = {
|
|
|
17
17
|
data () {
|
|
18
18
|
return {
|
|
19
19
|
searchMarker: null,
|
|
20
|
-
addressValue:
|
|
20
|
+
addressValue: undefined,
|
|
21
21
|
selectOptions: []
|
|
22
22
|
}
|
|
23
23
|
},
|
|
@@ -35,12 +35,12 @@ const AmapSearch = {
|
|
|
35
35
|
latitude: location.lat,
|
|
36
36
|
address: label
|
|
37
37
|
}
|
|
38
|
-
this.searchMarker = this.$amapLayers.setMarker(
|
|
38
|
+
this.searchMarker = this.$amapLayers.setMarker(
|
|
39
39
|
this.drawIcon,
|
|
40
40
|
{ position: [location.lng, location.lat] }
|
|
41
41
|
)
|
|
42
42
|
this.$emit('searchChoose', this.searchMarker, searchInfo)
|
|
43
|
-
},
|
|
43
|
+
},
|
|
44
44
|
/** 根据搜索框搜索地址 */
|
|
45
45
|
searchHandle(keyword) {
|
|
46
46
|
this.$amapMethods.getMapSearch(keyword, addressOptions => {
|
|
@@ -60,14 +60,14 @@ const AmapSearch = {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<div class="
|
|
63
|
+
<div class="AmapDraw__Search">
|
|
64
64
|
<ASelectCustom
|
|
65
|
-
v-model={this.addressValue}
|
|
65
|
+
v-model={this.addressValue}
|
|
66
66
|
{...{ props, on: { change: changeHandle, search: searchHandle } }}
|
|
67
|
-
/>
|
|
68
|
-
{
|
|
67
|
+
/>
|
|
68
|
+
{
|
|
69
69
|
buttonProps &&
|
|
70
|
-
<Button buttonProps={buttonProps} class="
|
|
70
|
+
<Button buttonProps={buttonProps} class="AmapDraw__Search__Button" />
|
|
71
71
|
}
|
|
72
72
|
</div>
|
|
73
73
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.
|
|
1
|
+
.AmapDraw__Search {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
width: calc(
|
|
4
|
+
width: calc(100% - 16px);
|
|
5
5
|
|
|
6
6
|
.ASelectCustom {
|
|
7
|
-
width: 346px;
|
|
7
|
+
width: 346px;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
&__Button {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
gap: 0 8px;
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: flex-end;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -10,28 +10,29 @@ const {
|
|
|
10
10
|
export const TopMenuProps = {
|
|
11
11
|
menus: PropTypes.array,
|
|
12
12
|
theme: PropTypes.string.def('dark'),
|
|
13
|
-
i18nRender: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]).def(false)
|
|
14
|
-
|
|
13
|
+
i18nRender: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]).def(false),
|
|
14
|
+
popupClassName: PropTypes.string
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
const httpReg = /(http|https|ftp):\/\/([\w.]+\/?)\S*/
|
|
17
18
|
|
|
18
|
-
const renderMenu = (h, item, i18nRender, selectedKeys) => {
|
|
19
|
+
const renderMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {
|
|
19
20
|
if (item && !item.hidden) {
|
|
20
21
|
const bool = item.children && !item.hideChildrenInMenu
|
|
21
|
-
return bool ? renderSubMenu(h, item, i18nRender, selectedKeys) : renderMenuItem(h, item, i18nRender)
|
|
22
|
+
return bool ? renderSubMenu(h, item, i18nRender, selectedKeys, popupClassName) : renderMenuItem(h, item, i18nRender)
|
|
22
23
|
}
|
|
23
24
|
return null
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
const renderSubMenu = (h, item, i18nRender, selectedKeys) => {
|
|
27
|
+
const renderSubMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {
|
|
27
28
|
const menuActive = item.children.find(children => selectedKeys.includes(children.path) ) ?? item
|
|
28
29
|
return (
|
|
29
30
|
<SubMenu key={item.path} title={(
|
|
30
31
|
<span>{renderTitle(h, menuActive.meta.title, i18nRender)}</span>
|
|
31
|
-
)}>
|
|
32
|
+
)} { ...{props: { popupClassName }} }>
|
|
32
33
|
{!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))}
|
|
33
|
-
</SubMenu>
|
|
34
|
-
)
|
|
34
|
+
</SubMenu>
|
|
35
|
+
)
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
const renderMenuItem = (h, item, i18nRender) => {
|
|
@@ -74,7 +75,7 @@ const TopMenu = {
|
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
77
|
render (h) {
|
|
77
|
-
const { theme, menus, i18nRender } = this
|
|
78
|
+
const { theme, menus, i18nRender, popupClassName } = this
|
|
78
79
|
|
|
79
80
|
const handleOpenChange = (openKeys) => {
|
|
80
81
|
this.openKeys = openKeys
|
|
@@ -102,19 +103,15 @@ const TopMenu = {
|
|
|
102
103
|
if (item.hidden) {
|
|
103
104
|
return null
|
|
104
105
|
}
|
|
105
|
-
return renderMenu(h, item, i18nRender, this.selectedKeys)
|
|
106
|
+
return renderMenu(h, item, i18nRender, this.selectedKeys, popupClassName)
|
|
106
107
|
})
|
|
107
|
-
return <Menu {...dynamicProps}>{menuItems}</Menu>
|
|
108
|
+
return <Menu {...dynamicProps}>{menuItems}</Menu>
|
|
108
109
|
},
|
|
109
110
|
methods: {
|
|
110
111
|
updateMenu () {
|
|
111
112
|
const routes = this.$route.matched.concat()
|
|
112
|
-
const { hidden
|
|
113
|
-
|
|
114
|
-
/** 不确定是否能正确适用 */
|
|
115
|
-
this.selectedKeys = [routes[1].path]
|
|
116
|
-
return
|
|
117
|
-
}
|
|
113
|
+
const { hidden } = this.$route.meta
|
|
114
|
+
|
|
118
115
|
if (routes.length >= 3 && hidden) {
|
|
119
116
|
routes.pop()
|
|
120
117
|
this.selectedKeys = [routes[routes.length - 1].path]
|
|
@@ -126,7 +123,7 @@ const TopMenu = {
|
|
|
126
123
|
created () {
|
|
127
124
|
this.$watch('$route', () => {
|
|
128
125
|
this.updateMenu()
|
|
129
|
-
})
|
|
126
|
+
})
|
|
130
127
|
},
|
|
131
128
|
mounted () {
|
|
132
129
|
this.updateMenu()
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ export const AmapDrawProps = {
|
|
|
18
18
|
drawOptions: PropTypes.object.def({}),
|
|
19
19
|
/** drawInfo为绘制物信息 */
|
|
20
20
|
drawInfo: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
21
|
-
/** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)
|
|
21
|
+
/** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)
|
|
22
22
|
* 格式: { point: ([]||{}), line: ([]||{}) }
|
|
23
23
|
*/
|
|
24
24
|
drawInfoAll: PropTypes.object,
|
|
@@ -95,8 +95,8 @@ const AmapDraw = {
|
|
|
95
95
|
})
|
|
96
96
|
}, 60 )
|
|
97
97
|
},
|
|
98
|
-
destroyed() {
|
|
99
|
-
this.AmapDrawClear()
|
|
98
|
+
destroyed() {
|
|
99
|
+
this.AmapDrawClear()
|
|
100
100
|
},
|
|
101
101
|
methods: {
|
|
102
102
|
/** 绘制 */
|
|
@@ -111,7 +111,7 @@ const AmapDraw = {
|
|
|
111
111
|
if(this.drawArea && !this[`is${this.drawType}InRing`](obj)) return (
|
|
112
112
|
this.amap.remove(obj),
|
|
113
113
|
this.$message.error('未在范围内描绘!')
|
|
114
|
-
)
|
|
114
|
+
)
|
|
115
115
|
/** 暂未支持一次性绘制多个 */
|
|
116
116
|
this.drawCount > 1 ? (
|
|
117
117
|
this.drawLayers = this.drawLayers || [],
|
|
@@ -121,7 +121,7 @@ const AmapDraw = {
|
|
|
121
121
|
(this.drawLayers.length == this.drawCount ||
|
|
122
122
|
this.drawCount == 1 )) {
|
|
123
123
|
return this.drawMouseTool.close()
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
})
|
|
126
126
|
},
|
|
127
127
|
/** 清空绘制 / 清空搜索 */
|
|
@@ -148,7 +148,7 @@ const AmapDraw = {
|
|
|
148
148
|
this.AmapDrawClear()
|
|
149
149
|
searchMarker.setMap(this.amap)
|
|
150
150
|
this.amap.setZoomAndCenter( 15, searchMarker.getPosition() )
|
|
151
|
-
this.drawType == 'point' && (this.drawLayersInfo = searchInfo)
|
|
151
|
+
this.drawType == 'point' && (this.drawLayersInfo = searchInfo)
|
|
152
152
|
// this.$emit('getAMapLayersInfo', this.drawLayersInfo)
|
|
153
153
|
},
|
|
154
154
|
/** 检测覆盖物配置信息并同步 */
|
|
@@ -179,7 +179,7 @@ const AmapDraw = {
|
|
|
179
179
|
})
|
|
180
180
|
const {lng,lat} = this.drawArea.getBounds().getCenter()
|
|
181
181
|
this.amap.setZoomAndCenter( 15, [lng,lat] )
|
|
182
|
-
},
|
|
182
|
+
},
|
|
183
183
|
/** 判断一个线段是否在面内 */
|
|
184
184
|
islineInRing(polyline) {
|
|
185
185
|
const paths = polyline.getPath()
|
|
@@ -307,14 +307,22 @@ const AmapDraw = {
|
|
|
307
307
|
}
|
|
308
308
|
},
|
|
309
309
|
render (h) {
|
|
310
|
-
|
|
310
|
+
|
|
311
|
+
const {
|
|
312
|
+
drawEl,
|
|
313
|
+
drawIcon,
|
|
314
|
+
buttonProps,
|
|
315
|
+
isExhibition,
|
|
316
|
+
AmapDrawClear,
|
|
317
|
+
searchChoose
|
|
318
|
+
} = this
|
|
311
319
|
|
|
312
320
|
return (
|
|
313
321
|
<div class="AmapDraw">
|
|
314
322
|
{
|
|
315
323
|
!isExhibition &&
|
|
316
324
|
<AmapSearch
|
|
317
|
-
{ ...{ props: {
|
|
325
|
+
{ ...{ props: { drawIcon, buttonProps }, on: { searchReset: AmapDrawClear, searchChoose } } }
|
|
318
326
|
/>
|
|
319
327
|
}
|
|
320
328
|
<div id={drawEl} />
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
.AmapDraw {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
&__Search {
|
|
5
|
-
top: 8px;
|
|
6
|
-
left: 8px;
|
|
7
|
-
z-index: 1;
|
|
8
|
-
position: absolute;
|
|
9
|
-
}
|
|
2
|
+
position: relative;
|
|
10
3
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
&__Search {
|
|
5
|
+
top: 8px;
|
|
6
|
+
left: 8px;
|
|
7
|
+
z-index: 1;
|
|
8
|
+
position: absolute;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#AmapDraw {
|
|
12
|
+
width: 100%;
|
|
13
|
+
min-height: 304px;
|
|
14
|
+
}
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FormComp, Button} from '../../../index'
|
|
1
|
+
import {FormComp, Button} from '../../../index'
|
|
2
2
|
import PropTypes from 'ant-design-vue/es/_util/vue-types'
|
|
3
3
|
|
|
4
4
|
import './index.less'
|
|
@@ -17,7 +17,7 @@ const AmapSearch = {
|
|
|
17
17
|
data () {
|
|
18
18
|
return {
|
|
19
19
|
searchMarker: null,
|
|
20
|
-
addressValue:
|
|
20
|
+
addressValue: undefined,
|
|
21
21
|
selectOptions: []
|
|
22
22
|
}
|
|
23
23
|
},
|
|
@@ -35,12 +35,12 @@ const AmapSearch = {
|
|
|
35
35
|
latitude: location.lat,
|
|
36
36
|
address: label
|
|
37
37
|
}
|
|
38
|
-
this.searchMarker = this.$amapLayers.setMarker(
|
|
38
|
+
this.searchMarker = this.$amapLayers.setMarker(
|
|
39
39
|
this.drawIcon,
|
|
40
40
|
{ position: [location.lng, location.lat] }
|
|
41
41
|
)
|
|
42
42
|
this.$emit('searchChoose', this.searchMarker, searchInfo)
|
|
43
|
-
},
|
|
43
|
+
},
|
|
44
44
|
/** 根据搜索框搜索地址 */
|
|
45
45
|
searchHandle(keyword) {
|
|
46
46
|
this.$amapMethods.getMapSearch(keyword, addressOptions => {
|
|
@@ -60,14 +60,14 @@ const AmapSearch = {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<div class="
|
|
63
|
+
<div class="AmapDraw__Search">
|
|
64
64
|
<ASelectCustom
|
|
65
|
-
v-model={this.addressValue}
|
|
65
|
+
v-model={this.addressValue}
|
|
66
66
|
{...{ props, on: { change: changeHandle, search: searchHandle } }}
|
|
67
|
-
/>
|
|
68
|
-
{
|
|
67
|
+
/>
|
|
68
|
+
{
|
|
69
69
|
buttonProps &&
|
|
70
|
-
<Button buttonProps={buttonProps} class="
|
|
70
|
+
<Button buttonProps={buttonProps} class="AmapDraw__Search__Button" />
|
|
71
71
|
}
|
|
72
72
|
</div>
|
|
73
73
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.
|
|
1
|
+
.AmapDraw__Search {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
width: calc(
|
|
4
|
+
width: calc(100% - 16px);
|
|
5
5
|
|
|
6
6
|
.ASelectCustom {
|
|
7
|
-
width: 346px;
|
|
7
|
+
width: 346px;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
&__Button {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
gap: 0 8px;
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: flex-end;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -10,28 +10,29 @@ const {
|
|
|
10
10
|
export const TopMenuProps = {
|
|
11
11
|
menus: PropTypes.array,
|
|
12
12
|
theme: PropTypes.string.def('dark'),
|
|
13
|
-
i18nRender: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]).def(false)
|
|
14
|
-
|
|
13
|
+
i18nRender: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]).def(false),
|
|
14
|
+
popupClassName: PropTypes.string
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
const httpReg = /(http|https|ftp):\/\/([\w.]+\/?)\S*/
|
|
17
18
|
|
|
18
|
-
const renderMenu = (h, item, i18nRender, selectedKeys) => {
|
|
19
|
+
const renderMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {
|
|
19
20
|
if (item && !item.hidden) {
|
|
20
21
|
const bool = item.children && !item.hideChildrenInMenu
|
|
21
|
-
return bool ? renderSubMenu(h, item, i18nRender, selectedKeys) : renderMenuItem(h, item, i18nRender)
|
|
22
|
+
return bool ? renderSubMenu(h, item, i18nRender, selectedKeys, popupClassName) : renderMenuItem(h, item, i18nRender)
|
|
22
23
|
}
|
|
23
24
|
return null
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
const renderSubMenu = (h, item, i18nRender, selectedKeys) => {
|
|
27
|
+
const renderSubMenu = (h, item, i18nRender, selectedKeys, popupClassName) => {
|
|
27
28
|
const menuActive = item.children.find(children => selectedKeys.includes(children.path) ) ?? item
|
|
28
29
|
return (
|
|
29
30
|
<SubMenu key={item.path} title={(
|
|
30
31
|
<span>{renderTitle(h, menuActive.meta.title, i18nRender)}</span>
|
|
31
|
-
)}>
|
|
32
|
+
)} { ...{props: { popupClassName }} }>
|
|
32
33
|
{!item.hideChildrenInMenu && item.children.map(cd => renderMenu(h, cd, i18nRender, selectedKeys))}
|
|
33
|
-
</SubMenu>
|
|
34
|
-
)
|
|
34
|
+
</SubMenu>
|
|
35
|
+
)
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
const renderMenuItem = (h, item, i18nRender) => {
|
|
@@ -74,7 +75,7 @@ const TopMenu = {
|
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
77
|
render (h) {
|
|
77
|
-
const { theme, menus, i18nRender } = this
|
|
78
|
+
const { theme, menus, i18nRender, popupClassName } = this
|
|
78
79
|
|
|
79
80
|
const handleOpenChange = (openKeys) => {
|
|
80
81
|
this.openKeys = openKeys
|
|
@@ -102,19 +103,15 @@ const TopMenu = {
|
|
|
102
103
|
if (item.hidden) {
|
|
103
104
|
return null
|
|
104
105
|
}
|
|
105
|
-
return renderMenu(h, item, i18nRender, this.selectedKeys)
|
|
106
|
+
return renderMenu(h, item, i18nRender, this.selectedKeys, popupClassName)
|
|
106
107
|
})
|
|
107
|
-
return <Menu {...dynamicProps}>{menuItems}</Menu>
|
|
108
|
+
return <Menu {...dynamicProps}>{menuItems}</Menu>
|
|
108
109
|
},
|
|
109
110
|
methods: {
|
|
110
111
|
updateMenu () {
|
|
111
112
|
const routes = this.$route.matched.concat()
|
|
112
|
-
const { hidden
|
|
113
|
-
|
|
114
|
-
/** 不确定是否能正确适用 */
|
|
115
|
-
this.selectedKeys = [routes[1].path]
|
|
116
|
-
return
|
|
117
|
-
}
|
|
113
|
+
const { hidden } = this.$route.meta
|
|
114
|
+
|
|
118
115
|
if (routes.length >= 3 && hidden) {
|
|
119
116
|
routes.pop()
|
|
120
117
|
this.selectedKeys = [routes[routes.length - 1].path]
|
|
@@ -126,7 +123,7 @@ const TopMenu = {
|
|
|
126
123
|
created () {
|
|
127
124
|
this.$watch('$route', () => {
|
|
128
125
|
this.updateMenu()
|
|
129
|
-
})
|
|
126
|
+
})
|
|
130
127
|
},
|
|
131
128
|
mounted () {
|
|
132
129
|
this.updateMenu()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.WebComponentTable{width:100%;height:100%;display:flex;gap:16px 0;flex-direction:column}.WebComponentTable__List__Empty{height:120px;display:flex;gap:0;flex-direction:column;flex-wrap:wrap;align-items:center;justify-content:center}.WebComponentTable__List__Empty i{font-size:80px}.WebComponentTable__Pagination{display:flex;justify-content:flex-end}
|
package/utils/Postcss.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
module.exports.postcss = {
|
|
2
|
-
rootValue: 14, // 基准字体大小,通常是 16 或 37.5
|
|
3
|
-
propList: ['*'], // 需要转换的属性,* 表示全部属性都转换
|
|
4
|
-
unitPrecision: 5, // 允许 REM 单位增长到的十进制数
|
|
5
|
-
selectorBlackList: [], // 忽略转换的选择器
|
|
6
|
-
replace: true, // 替换包含 `px` 的规则,而不是添加替换后的副本
|
|
7
|
-
mediaQuery: false, // 不允许在媒体查询中转换 `px`
|
|
8
|
-
minPixelValue: 0 // 设置要替换的最小像素值
|
|
9
|
-
}
|
package/utils/Storage.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import Cookies from 'js-cookie'
|
|
2
|
-
|
|
3
|
-
const local = {
|
|
4
|
-
|
|
5
|
-
set(key, value) {
|
|
6
|
-
localStorage.setItem(key, value)
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
setJson( key, value ){
|
|
10
|
-
localStorage.setItem(key, JSON.stringify( value ))
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
get( key ){
|
|
14
|
-
return localStorage.getItem(key)
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
getJson( key ){
|
|
18
|
-
|
|
19
|
-
const content = localStorage.getItem( key )
|
|
20
|
-
|
|
21
|
-
if( !content ) return null
|
|
22
|
-
|
|
23
|
-
return JSON.parse( content )
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
remove( key ){
|
|
27
|
-
localStorage.removeItem(key)
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
clear(){
|
|
31
|
-
localStorage.clear()
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const cookies = {
|
|
36
|
-
|
|
37
|
-
set(key, value) {
|
|
38
|
-
Cookies.set(key, value)
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
setJson( key, value ){
|
|
42
|
-
Cookies.set(key, JSON.stringify( value ))
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
get( key ){
|
|
46
|
-
return Cookies.get(key)
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
getJson( key ){
|
|
50
|
-
|
|
51
|
-
const content = Cookies.get( key )
|
|
52
|
-
|
|
53
|
-
if( !content ) return null
|
|
54
|
-
|
|
55
|
-
return JSON.parse( content )
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
remove( key ){
|
|
59
|
-
Cookies.remove(key)
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
clear(){
|
|
63
|
-
const cookies = Cookies.get()
|
|
64
|
-
for (const cookieName in cookies) {
|
|
65
|
-
if (cookies.hasOwnProperty(cookieName)) Cookies.remove(cookieName)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default {
|
|
71
|
-
local,
|
|
72
|
-
cookies
|
|
73
|
-
}
|
|
File without changes
|