web-component-gallery 1.1.48 → 1.1.49

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 CHANGED
@@ -8998,7 +8998,7 @@ eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source cod
8998
8998
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
8999
8999
 
9000
9000
  "use strict";
9001
- eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDrawProps: function() { return /* binding */ AmapDrawProps; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _AmapDraw_less__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AmapDraw.less */ \"./plugins/lib/amap/AmapDraw.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__]);\n_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst amap = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_2__.getAMapInstance)();\nconst {\n AMap,\n methods,\n layers\n} = amap;\n\nconst AmapDrawProps = {\n /** drawEl为地图容器实例名称 */\n drawEl: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('AmapDraw'),\n /** drawType为绘制类型\r\n * 可选值(point点 | line线 | polygon面)\r\n */\n drawType: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('point'),\n /** 绘制图标 (只在point类型下生效 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].any.def('http://qxfa.tpddns.cn:8090/poi/poi-marker-default.png'),\n /** drawCount为绘制物绘制个数 */\n drawCount: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].number.def(1),\n /** drawOptions为绘制物配置项 */\n drawOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** drawInfo为绘制物信息 */\n drawInfo: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].array]),\n /** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)\r\n * 格式: { point: ([]||{}), line: ([]||{}) }\r\n */\n drawInfoAll: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object,\n /** 限制区域 */\n drawLimitArea: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string]),\n /** 限制区域样式配置 */\n drawLimitAreaOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** 是否为纯地图展示数据 */\n isExhibition: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].bool.def(false)\n};\nconst AmapDraw = {\n name: 'AmapDraw',\n props: AmapDrawProps,\n data() {\n return {\n amap: null,\n drawArea: null,\n drawLayers: null,\n drawMouseTool: null,\n buttonProps: [],\n drawButtonProps: [{\n type: 'primary',\n text: '绘制',\n event: {\n click: this.AmapDraw\n }\n }, {\n text: '清除',\n event: {\n click: this.AmapDrawClear\n }\n }],\n saveButtonProps: [{\n type: 'primary',\n text: '保存',\n event: {\n click: this.AmapDrawSave\n }\n }, {\n text: '取消',\n event: {\n click: this.AmapDrawReset\n }\n }]\n };\n },\n computed: {\n drawLayersInfo: {\n get() {\n return this.drawInfo;\n },\n set(newValue) {\n this.$emit('getAMapLayersInfo', newValue);\n }\n }\n },\n watch: {\n drawInfo: {\n handler(newVal, oldVal) {\n const newValue = this.drawLayersInfo;\n newVal && this.echoDrawLayers(this.drawType);\n },\n deep: true\n },\n drawInfoAll(newValue) {\n newValue && this.echoDrawLayers();\n },\n drawOptions(newValue) {\n /** 检测options覆盖物配置是否更改,更改后要同步到地图上 */\n Object.keys(newValue).length && this.setOverlayOptions(newValue);\n },\n drawLimitArea(newValue) {\n newValue && this.setDrawLimitArea();\n }\n },\n mounted() {\n this.amap = amap.initMap({\n el: this.drawEl\n });\n this.buttonProps = [].concat(this.drawButtonProps);\n this.echoDrawLayers(this.drawType);\n /** 如果有限制区域,则描绘在地图上 */\n this.drawLimitArea && this.setDrawLimitArea();\n },\n destroyed() {\n this.AmapDrawClear();\n },\n methods: {\n /** 绘制 */\n AmapDraw() {\n this.buttonProps = [].concat(this.saveButtonProps);\n this.drawMouseTool = new AMap.MouseTool(this.amap);\n this.AmapDrawClear();\n this.setDrawLayers(this.drawType);\n this.drawMouseTool.on('draw', ({\n obj\n }) => {\n if (this.drawArea && !this[`is${this.drawType}InRing`](obj)) return this.amap.remove(obj), this.$message.error('未在范围内描绘!');\n /** 暂未支持一次性绘制多个 */\n this.drawCount > 1 ? (this.drawLayers = this.drawLayers || [], this.drawLayers.push(obj)) : this.drawLayers = obj;\n if (this.drawLayers && (this.drawLayers.length == this.drawCount || this.drawCount == 1)) {\n return this.drawMouseTool.close();\n }\n });\n },\n /** 清空绘制 / 清空搜索 */\n AmapDrawClear() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && this.amap.remove(layerItem));\n // this.amap.clearMap()\n this.drawLayers = null;\n this.drawLayersInfo = {};\n },\n /** 保存当前绘制 */\n AmapDrawSave() {\n this.assignDrawLayers(this.drawType);\n this.buttonProps = [].concat(this.drawButtonProps);\n },\n /** 取消当前绘制 */\n AmapDrawReset() {\n this.buttonProps = [].concat(this.drawButtonProps);\n this.AmapDrawClear();\n },\n /** 搜索地址 */\n searchChoose(searchMarker, searchInfo) {\n this.AmapDrawClear();\n searchMarker.setMap(this.amap);\n this.amap.setZoomAndCenter(15, searchMarker.getPosition());\n this.drawType == 'point' && (this.drawLayersInfo = searchInfo);\n // this.$emit('getAMapLayersInfo', this.drawLayersInfo)\n },\n /** 检测覆盖物配置信息并同步 */\n setOverlayOptions(options) {\n if (!this.drawLayers) return;\n this.drawCount > 1 ? this.drawLayers.forEach(drawItem => drawItem.setOptions(options)) : this.drawLayers.setOptions(options);\n },\n /** 绘制限定区域 */\n setDrawLimitArea() {\n let areaRange = [];\n try {\n areaRange = JSON.parse(this.drawLimitArea);\n } catch {\n areaRange = this.drawLimitArea;\n }\n this.drawArea && this.amap.remove(this.drawArea);\n /** 判断目前地图上存在的所绘制覆盖物是否在限制范围内 */\n this.setMapArea(areaRange);\n this.judgeOverlays();\n },\n /** 绘制地图区域范围 */\n setMapArea(jurisdictionRange) {\n this.drawArea = new AMap.Polygon({\n map: this.amap,\n path: jurisdictionRange,\n extData: 'Area',\n strokeWeight: 6,\n ...this.drawLimitAreaOptions\n });\n const {\n lng,\n lat\n } = this.drawArea.getBounds().getCenter();\n this.amap.setZoomAndCenter(15, [lng, lat]);\n },\n /** 判断一个线段是否在面内 */\n islineInRing(polyline) {\n const paths = polyline.getPath();\n return paths.every(pointItem => this.ispointInRing(pointItem));\n },\n /** 判断一个点是否在面内 */\n ispointInRing(point) {\n let position;\n try {\n position = point.getPosition();\n } catch {\n position = point;\n }\n return AMap.GeometryUtil.isPointInRing(position, this.drawArea.getPath());\n },\n /** 判断地图上所覆盖物是否在限制范围内 */\n judgeOverlays() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && !this[`is${this.drawType}InRing`](layerItem) && this.removeOverlay(layerItem));\n },\n /** 清除单个覆盖物(或 不符合区域范围的覆盖物 */\n removeOverlay(layerItem) {\n this.amap.remove(layerItem);\n this.$message.error('未在区域范围内,请重新描绘!');\n try {\n const i = this.drawLayers.findIndex(layer => layer.getExtData() == layerItem.getExtData());\n this.drawLayers.splice(i, 1);\n } catch {\n this.drawLayers = null;\n this.drawLayersInfo = {};\n }\n },\n /** 根据类型处理不同数据 */\n setDrawLayers(drawType) {\n const type = {\n point: 'marker',\n line: 'polyline',\n polygon: 'polygon'\n };\n\n /** 图层基础配置 */\n const drawOptions = drawType == 'point' ? {\n anchor: 'bottom-center',\n icon: layers.setIcon(this.drawIcon)\n } : {\n strokeWeight: 8\n };\n this.drawMouseTool[type[drawType]]({\n ...drawOptions,\n ...this.drawOptions\n });\n },\n /** 赋值不同图层数据 */\n assignDrawLayers(drawType) {\n if (drawType == 'point') {\n const {\n lng,\n lat\n } = this.drawLayers.getPosition();\n const position = {\n longitude: lng,\n latitude: lat\n };\n methods.getMapAddress(position, address => {\n this.drawLayersInfo = {\n ...position,\n ...address\n };\n });\n return;\n }\n const range = this.drawLayers.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n this.drawLayersInfo = {\n range\n };\n },\n /** 回显不同类型图层 */\n echoDrawLayers(drawType) {\n const drawLayersItem = (drawItem, type, i = 0) => {\n // && drawItem.latitude && drawItem.longitude 忘记当时为什么加这个了 后续在想\n if (drawItem && this.amap) {\n let layersItem = null;\n const {\n longitude,\n latitude,\n range\n } = drawItem;\n const setOptions = {\n extData: `draw${type}${i}`,\n ...this.drawOptions\n };\n if (type == 'point') {\n layersItem = layers.setMarker(this.drawIcon, {\n position: [longitude, latitude],\n ...setOptions\n });\n } else {\n const options = {\n path: range,\n strokeWeight: 8,\n ...setOptions\n };\n layersItem = type == 'line' ? new AMap.Polyline(options) : new AMap.Polygon(options);\n }\n layersItem.setMap(this.amap);\n this.amap.setFitView();\n }\n };\n if (!this.isExhibition) {\n drawLayersItem(this.drawLayersInfo, drawType);\n return;\n }\n if (this.drawInfoAll) {\n for (let key in this.drawInfoAll) {\n const isArray = Array.isArray(this.drawInfoAll[key]);\n isArray ? this.drawInfoAll[key].forEach((drawItem, i) => {\n drawLayersItem(drawItem, key, i);\n }) : drawLayersItem(this.drawInfoAll[key], key);\n }\n return;\n }\n drawLayersItem(this.drawLayersInfo, drawType);\n }\n },\n render(h) {\n const {\n drawEl,\n drawIcon,\n buttonProps,\n isExhibition,\n AmapDrawClear,\n searchChoose\n } = this;\n return h(\"div\", {\n \"class\": \"AmapDraw\"\n }, [!isExhibition && h(_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n \"props\": {\n ...{\n drawIcon,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose\n }\n }\n }), h(\"div\", {\n \"attrs\": {\n \"id\": drawEl\n }\n })]);\n }\n};\nAmapDraw.install = function (Vue) {\n Vue.component('AmapDraw', AmapDraw);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapDraw);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/AmapDraw.jsx?");
9001
+ eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDrawProps: function() { return /* binding */ AmapDrawProps; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _AmapDraw_less__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AmapDraw.less */ \"./plugins/lib/amap/AmapDraw.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__]);\n_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst amap = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_2__.getAMapInstance)();\nconst {\n AMap,\n methods,\n layers\n} = amap;\n\nconst AmapDrawProps = {\n /** drawEl为地图容器实例名称 */\n drawEl: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('AmapDraw'),\n /** drawType为绘制类型\r\n * 可选值(point点 | line线 | polygon面)\r\n */\n drawType: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('point'),\n /** 绘制图标 (只在point类型下生效 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].any.def('http://qxfa.tpddns.cn:8090/poi/poi-marker-default.png'),\n /** drawCount为绘制物绘制个数 */\n drawCount: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].number.def(1),\n /** drawOptions为绘制物配置项 */\n drawOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** drawInfo为绘制物信息 */\n drawInfo: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].array]),\n /** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)\r\n * 格式: { point: ([]||{}), line: ([]||{}) }\r\n */\n drawInfoAll: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object,\n /** 限制区域 */\n drawLimitArea: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string]),\n /** 限制区域样式配置 */\n drawLimitAreaOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** 是否为纯地图展示数据 */\n isExhibition: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].bool.def(false)\n};\nconst AmapDraw = {\n name: 'AmapDraw',\n props: AmapDrawProps,\n data() {\n return {\n amap: null,\n drawArea: null,\n drawLayers: null,\n drawMouseTool: null,\n buttonProps: [],\n drawButtonProps: [{\n type: 'primary',\n text: '绘制',\n event: {\n click: this.AmapDraw\n }\n }, {\n text: '清除',\n event: {\n click: this.AmapDrawClear\n }\n }],\n saveButtonProps: [{\n type: 'primary',\n text: '保存',\n event: {\n click: this.AmapDrawSave\n }\n }, {\n text: '取消',\n event: {\n click: this.AmapDrawReset\n }\n }]\n };\n },\n computed: {\n drawLayersInfo: {\n get() {\n return this.drawInfo;\n },\n set(newValue) {\n this.$emit('getAMapLayersInfo', newValue);\n }\n }\n },\n watch: {\n drawInfo: {\n handler(newVal, oldVal) {\n const newValue = this.drawLayersInfo;\n newVal && this.echoDrawLayers(this.drawType);\n },\n deep: true\n },\n drawInfoAll(newValue) {\n newValue && this.echoDrawLayers();\n },\n drawOptions(newValue) {\n /** 检测options覆盖物配置是否更改,更改后要同步到地图上 */\n Object.keys(newValue).length && this.setOverlayOptions(newValue);\n },\n drawLimitArea(newValue) {\n newValue && this.setDrawLimitArea();\n }\n },\n mounted() {\n this.amap = amap.initMap({\n el: this.drawEl\n });\n this.buttonProps = [].concat(this.drawButtonProps);\n this.echoDrawLayers(this.drawType);\n /** 如果有限制区域,则描绘在地图上 */\n this.drawLimitArea && this.setDrawLimitArea();\n },\n destroyed() {\n this.AmapDrawClear();\n },\n methods: {\n /** 绘制 */\n AmapDraw() {\n this.buttonProps = [].concat(this.saveButtonProps);\n this.drawMouseTool = new AMap.MouseTool(this.amap);\n this.AmapDrawClear();\n this.setDrawLayers(this.drawType);\n this.drawMouseTool.on('draw', ({\n obj\n }) => {\n if (this.drawArea && !this[`is${this.drawType}InRing`](obj)) return this.amap.remove(obj), this.$message.error('未在范围内描绘!');\n /** 暂未支持一次性绘制多个 */\n this.drawCount > 1 ? (this.drawLayers = this.drawLayers || [], this.drawLayers.push(obj)) : this.drawLayers = obj;\n if (this.drawLayers && (this.drawLayers.length == this.drawCount || this.drawCount == 1)) {\n return this.drawMouseTool.close();\n }\n });\n },\n /** 清空绘制 / 清空搜索 */\n AmapDrawClear() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && this.amap.remove(layerItem));\n // this.amap.clearMap()\n this.drawLayers = null;\n this.drawLayersInfo = {};\n },\n /** 保存当前绘制 */\n AmapDrawSave() {\n this.assignDrawLayers(this.drawType);\n this.buttonProps = [].concat(this.drawButtonProps);\n },\n /** 取消当前绘制 */\n AmapDrawReset() {\n this.buttonProps = [].concat(this.drawButtonProps);\n this.AmapDrawClear();\n },\n /** 搜索地址 */\n searchChoose(searchMarker, searchInfo) {\n this.AmapDrawClear();\n searchMarker.setMap(this.amap);\n this.amap.setZoomAndCenter(15, searchMarker.getPosition());\n this.drawType == 'point' && (this.drawLayersInfo = searchInfo);\n // this.$emit('getAMapLayersInfo', this.drawLayersInfo)\n },\n /** 检测覆盖物配置信息并同步 */\n setOverlayOptions(options) {\n if (!this.drawLayers) return;\n this.drawCount > 1 ? this.drawLayers.forEach(drawItem => drawItem.setOptions(options)) : this.drawLayers.setOptions(options);\n },\n /** 绘制限定区域 */\n setDrawLimitArea() {\n let areaRange = [];\n try {\n areaRange = JSON.parse(this.drawLimitArea);\n } catch {\n areaRange = this.drawLimitArea;\n }\n this.drawArea && this.amap.remove(this.drawArea);\n /** 判断目前地图上存在的所绘制覆盖物是否在限制范围内 */\n this.setMapArea(areaRange);\n this.judgeOverlays();\n },\n /** 绘制地图区域范围 */\n setMapArea(jurisdictionRange) {\n this.drawArea = new AMap.Polygon({\n map: this.amap,\n path: jurisdictionRange,\n extData: 'Area',\n strokeWeight: 6,\n ...this.drawLimitAreaOptions\n });\n const {\n lng,\n lat\n } = this.drawArea.getBounds().getCenter();\n this.amap.setZoomAndCenter(15, [lng, lat]);\n },\n /** 判断一个线段是否在面内 */\n islineInRing(polyline) {\n const paths = polyline.getPath();\n return paths.every(pointItem => this.ispointInRing(pointItem));\n },\n /** 判断一个点是否在面内 */\n ispointInRing(point) {\n let position;\n try {\n position = point.getPosition();\n } catch {\n position = point;\n }\n return AMap.GeometryUtil.isPointInRing(position, this.drawArea.getPath());\n },\n /** 判断地图上所覆盖物是否在限制范围内 */\n judgeOverlays() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && !this[`is${this.drawType}InRing`](layerItem) && this.removeOverlay(layerItem));\n },\n /** 清除单个覆盖物(或 不符合区域范围的覆盖物 */\n removeOverlay(layerItem) {\n this.amap.remove(layerItem);\n this.$message.error('未在区域范围内,请重新描绘!');\n try {\n const i = this.drawLayers.findIndex(layer => layer.getExtData() == layerItem.getExtData());\n this.drawLayers.splice(i, 1);\n } catch {\n this.drawLayers = null;\n this.drawLayersInfo = {};\n }\n },\n /** 根据类型处理不同数据 */\n setDrawLayers(drawType) {\n const type = {\n point: 'marker',\n line: 'polyline',\n polygon: 'polygon'\n };\n\n /** 图层基础配置 */\n const drawOptions = drawType == 'point' ? {\n anchor: 'bottom-center',\n icon: layers.setIcon(this.drawIcon)\n } : {\n strokeWeight: 8\n };\n this.drawMouseTool[type[drawType]]({\n ...drawOptions,\n ...this.drawOptions\n });\n },\n /** 赋值不同图层数据 */\n assignDrawLayers(drawType) {\n if (drawType == 'point') {\n const {\n lng,\n lat\n } = this.drawLayers.getPosition();\n const position = {\n longitude: lng,\n latitude: lat\n };\n methods.getMapAddress(position, address => {\n this.drawLayersInfo = {\n ...position,\n ...address\n };\n });\n return;\n }\n const range = this.drawLayers.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n this.drawLayersInfo = {\n range\n };\n },\n /** 回显不同类型图层 */\n echoDrawLayers(drawType) {\n const drawLayersItem = (drawItem, type, i = 0) => {\n // && drawItem.latitude && drawItem.longitude 忘记当时为什么加这个了 后续在想\n if (drawItem && this.amap) {\n let layersItem = null;\n const {\n longitude,\n latitude,\n range\n } = drawItem;\n const setOptions = {\n extData: `draw${type}${i}`,\n ...this.drawOptions\n };\n if (type == 'point') {\n layersItem = layers.setMarker(this.drawIcon, {\n position: [longitude, latitude],\n ...setOptions\n });\n } else {\n const options = {\n path: range,\n strokeWeight: 8,\n ...setOptions\n };\n layersItem = type == 'line' ? new AMap.Polyline(options) : new AMap.Polygon(options);\n }\n layersItem.setMap(this.amap);\n this.amap.setFitView();\n }\n };\n if (!this.isExhibition) {\n drawLayersItem(this.drawLayersInfo, drawType);\n return;\n }\n if (this.drawInfoAll) {\n for (let key in this.drawInfoAll) {\n const isArray = Array.isArray(this.drawInfoAll[key]);\n isArray ? this.drawInfoAll[key].forEach((drawItem, i) => {\n drawLayersItem(drawItem, key, i);\n }) : drawLayersItem(this.drawInfoAll[key], key);\n }\n return;\n }\n drawLayersItem(this.drawLayersInfo, drawType);\n }\n },\n render(h) {\n const {\n drawEl,\n drawIcon,\n buttonProps,\n isExhibition,\n AmapDrawClear,\n searchChoose\n } = this;\n return h(\"div\", {\n \"class\": \"AmapDraw\"\n }, [!isExhibition && h(_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n \"props\": {\n ...{\n drawIcon,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose\n }\n }\n }), h(\"div\", {\n \"attrs\": {\n \"id\": drawEl\n }\n })]);\n }\n};\nAmapDraw.install = function (Vue) {\n Vue.component('AmapDraw', AmapDraw);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapDraw);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/AmapDraw.jsx?");
9002
9002
 
9003
9003
  /***/ }),
9004
9004
 
@@ -9009,7 +9009,7 @@ eval("__webpack_require__.a(module, async function (__webpack_handle_async_depen
9009
9009
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9010
9010
 
9011
9011
  "use strict";
9012
- eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapSearchProps: function() { return /* binding */ AmapSearchProps; }\n/* harmony export */ });\n/* harmony import */ var 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 _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../index */ \"./plugins/lib/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.less */ \"./plugins/lib/amap/components/AmapSearch/index.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index__WEBPACK_IMPORTED_MODULE_0__]);\n_index__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst {\n ASelectCustom\n} = _index__WEBPACK_IMPORTED_MODULE_0__.FormComp;\nconst {\n methods,\n layers\n} = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_1__.getAMapInstance)();\nconst AmapSearchProps = {\n /** 搜索后绘制图标 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].any,\n buttonProps: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"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 = layers.setMarker(this.drawIcon, {\n position: [location.lng, location.lat]\n });\n this.$emit('searchChoose', this.searchMarker, searchInfo);\n },\n /** 根据搜索框搜索地址 */\n searchHandle(keyword) {\n methods.getMapSearch(keyword, addressOptions => {\n this.selectOptions = addressOptions;\n });\n }\n },\n render(h) {\n const {\n selectOptions,\n changeHandle,\n searchHandle,\n buttonProps\n } = this;\n const props = {\n valueKey: 'id',\n labelKey: 'label',\n options: selectOptions,\n placeholder: '请输入目的地进行搜索'\n };\n return h(\"div\", {\n \"class\": \"AmapDraw__Search\"\n }, [h(ASelectCustom, {\n \"props\": {\n ...props\n },\n \"on\": {\n ...{\n change: changeHandle,\n search: searchHandle\n }\n },\n \"model\": {\n value: this.addressValue,\n callback: $$v => {\n this.addressValue = $$v;\n }\n }\n }), buttonProps && h(_index__WEBPACK_IMPORTED_MODULE_0__.Button, {\n \"attrs\": {\n \"buttonProps\": buttonProps\n },\n \"class\": \"AmapDraw__Search__Button\"\n })]);\n }\n};\nAmapSearch.install = function (Vue) {\n Vue.component('AmapSearch', AmapSearch);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapSearch);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.jsx?");
9012
+ eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapSearchProps: function() { return /* binding */ AmapSearchProps; }\n/* harmony export */ });\n/* harmony import */ var 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 _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../index */ \"./plugins/lib/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.less */ \"./plugins/lib/amap/components/AmapSearch/index.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index__WEBPACK_IMPORTED_MODULE_0__]);\n_index__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst {\n ASelectCustom\n} = _index__WEBPACK_IMPORTED_MODULE_0__.FormComp;\nconst {\n methods,\n layers\n} = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_1__.getAMapInstance)();\nconst AmapSearchProps = {\n /** 搜索后绘制图标 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].any,\n buttonProps: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"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 = layers.setMarker(this.drawIcon, {\n position: [location.lng, location.lat]\n });\n this.$emit('searchChoose', this.searchMarker, searchInfo);\n },\n /** 根据搜索框搜索地址 */\n searchHandle(keyword) {\n methods.getMapSearch(keyword, addressOptions => {\n this.selectOptions = addressOptions;\n });\n }\n },\n render(h) {\n const {\n selectOptions,\n changeHandle,\n searchHandle,\n buttonProps\n } = this;\n const props = {\n valueKey: 'id',\n labelKey: 'label',\n options: selectOptions,\n placeholder: '请输入目的地进行搜索'\n };\n return h(\"div\", {\n \"class\": \"AmapDraw__Search\"\n }, [h(ASelectCustom, {\n \"props\": {\n ...props\n },\n \"on\": {\n ...{\n change: changeHandle,\n search: searchHandle\n }\n },\n \"model\": {\n value: this.addressValue,\n callback: $$v => {\n this.addressValue = $$v;\n }\n }\n }), buttonProps && h(_index__WEBPACK_IMPORTED_MODULE_0__.Button, {\n \"attrs\": {\n \"buttonProps\": buttonProps\n },\n \"class\": \"AmapDraw__Search__Button\"\n })]);\n }\n};\nAmapSearch.install = function (Vue) {\n Vue.component('AmapSearch', AmapSearch);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapSearch);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.jsx?");
9013
9013
 
9014
9014
  /***/ }),
9015
9015
 
package/dist/index.umd.js CHANGED
@@ -8998,7 +8998,7 @@ eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source cod
8998
8998
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
8999
8999
 
9000
9000
  "use strict";
9001
- eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDrawProps: function() { return /* binding */ AmapDrawProps; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _AmapDraw_less__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AmapDraw.less */ \"./plugins/lib/amap/AmapDraw.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__]);\n_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst amap = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_2__.getAMapInstance)();\nconst {\n AMap,\n methods,\n layers\n} = amap;\n\nconst AmapDrawProps = {\n /** drawEl为地图容器实例名称 */\n drawEl: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('AmapDraw'),\n /** drawType为绘制类型\r\n * 可选值(point点 | line线 | polygon面)\r\n */\n drawType: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('point'),\n /** 绘制图标 (只在point类型下生效 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].any.def('http://qxfa.tpddns.cn:8090/poi/poi-marker-default.png'),\n /** drawCount为绘制物绘制个数 */\n drawCount: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].number.def(1),\n /** drawOptions为绘制物配置项 */\n drawOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** drawInfo为绘制物信息 */\n drawInfo: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].array]),\n /** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)\r\n * 格式: { point: ([]||{}), line: ([]||{}) }\r\n */\n drawInfoAll: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object,\n /** 限制区域 */\n drawLimitArea: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string]),\n /** 限制区域样式配置 */\n drawLimitAreaOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** 是否为纯地图展示数据 */\n isExhibition: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].bool.def(false)\n};\nconst AmapDraw = {\n name: 'AmapDraw',\n props: AmapDrawProps,\n data() {\n return {\n amap: null,\n drawArea: null,\n drawLayers: null,\n drawMouseTool: null,\n buttonProps: [],\n drawButtonProps: [{\n type: 'primary',\n text: '绘制',\n event: {\n click: this.AmapDraw\n }\n }, {\n text: '清除',\n event: {\n click: this.AmapDrawClear\n }\n }],\n saveButtonProps: [{\n type: 'primary',\n text: '保存',\n event: {\n click: this.AmapDrawSave\n }\n }, {\n text: '取消',\n event: {\n click: this.AmapDrawReset\n }\n }]\n };\n },\n computed: {\n drawLayersInfo: {\n get() {\n return this.drawInfo;\n },\n set(newValue) {\n this.$emit('getAMapLayersInfo', newValue);\n }\n }\n },\n watch: {\n drawInfo: {\n handler(newVal, oldVal) {\n const newValue = this.drawLayersInfo;\n newVal && this.echoDrawLayers(this.drawType);\n },\n deep: true\n },\n drawInfoAll(newValue) {\n newValue && this.echoDrawLayers();\n },\n drawOptions(newValue) {\n /** 检测options覆盖物配置是否更改,更改后要同步到地图上 */\n Object.keys(newValue).length && this.setOverlayOptions(newValue);\n },\n drawLimitArea(newValue) {\n newValue && this.setDrawLimitArea();\n }\n },\n mounted() {\n this.amap = amap.initMap({\n el: this.drawEl\n });\n this.buttonProps = [].concat(this.drawButtonProps);\n this.echoDrawLayers(this.drawType);\n /** 如果有限制区域,则描绘在地图上 */\n this.drawLimitArea && this.setDrawLimitArea();\n },\n destroyed() {\n this.AmapDrawClear();\n },\n methods: {\n /** 绘制 */\n AmapDraw() {\n this.buttonProps = [].concat(this.saveButtonProps);\n this.drawMouseTool = new AMap.MouseTool(this.amap);\n this.AmapDrawClear();\n this.setDrawLayers(this.drawType);\n this.drawMouseTool.on('draw', ({\n obj\n }) => {\n if (this.drawArea && !this[`is${this.drawType}InRing`](obj)) return this.amap.remove(obj), this.$message.error('未在范围内描绘!');\n /** 暂未支持一次性绘制多个 */\n this.drawCount > 1 ? (this.drawLayers = this.drawLayers || [], this.drawLayers.push(obj)) : this.drawLayers = obj;\n if (this.drawLayers && (this.drawLayers.length == this.drawCount || this.drawCount == 1)) {\n return this.drawMouseTool.close();\n }\n });\n },\n /** 清空绘制 / 清空搜索 */\n AmapDrawClear() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && this.amap.remove(layerItem));\n // this.amap.clearMap()\n this.drawLayers = null;\n this.drawLayersInfo = {};\n },\n /** 保存当前绘制 */\n AmapDrawSave() {\n this.assignDrawLayers(this.drawType);\n this.buttonProps = [].concat(this.drawButtonProps);\n },\n /** 取消当前绘制 */\n AmapDrawReset() {\n this.buttonProps = [].concat(this.drawButtonProps);\n this.AmapDrawClear();\n },\n /** 搜索地址 */\n searchChoose(searchMarker, searchInfo) {\n this.AmapDrawClear();\n searchMarker.setMap(this.amap);\n this.amap.setZoomAndCenter(15, searchMarker.getPosition());\n this.drawType == 'point' && (this.drawLayersInfo = searchInfo);\n // this.$emit('getAMapLayersInfo', this.drawLayersInfo)\n },\n /** 检测覆盖物配置信息并同步 */\n setOverlayOptions(options) {\n if (!this.drawLayers) return;\n this.drawCount > 1 ? this.drawLayers.forEach(drawItem => drawItem.setOptions(options)) : this.drawLayers.setOptions(options);\n },\n /** 绘制限定区域 */\n setDrawLimitArea() {\n let areaRange = [];\n try {\n areaRange = JSON.parse(this.drawLimitArea);\n } catch {\n areaRange = this.drawLimitArea;\n }\n this.drawArea && this.amap.remove(this.drawArea);\n /** 判断目前地图上存在的所绘制覆盖物是否在限制范围内 */\n this.setMapArea(areaRange);\n this.judgeOverlays();\n },\n /** 绘制地图区域范围 */\n setMapArea(jurisdictionRange) {\n this.drawArea = new AMap.Polygon({\n map: this.amap,\n path: jurisdictionRange,\n extData: 'Area',\n strokeWeight: 6,\n ...this.drawLimitAreaOptions\n });\n const {\n lng,\n lat\n } = this.drawArea.getBounds().getCenter();\n this.amap.setZoomAndCenter(15, [lng, lat]);\n },\n /** 判断一个线段是否在面内 */\n islineInRing(polyline) {\n const paths = polyline.getPath();\n return paths.every(pointItem => this.ispointInRing(pointItem));\n },\n /** 判断一个点是否在面内 */\n ispointInRing(point) {\n let position;\n try {\n position = point.getPosition();\n } catch {\n position = point;\n }\n return AMap.GeometryUtil.isPointInRing(position, this.drawArea.getPath());\n },\n /** 判断地图上所覆盖物是否在限制范围内 */\n judgeOverlays() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && !this[`is${this.drawType}InRing`](layerItem) && this.removeOverlay(layerItem));\n },\n /** 清除单个覆盖物(或 不符合区域范围的覆盖物 */\n removeOverlay(layerItem) {\n this.amap.remove(layerItem);\n this.$message.error('未在区域范围内,请重新描绘!');\n try {\n const i = this.drawLayers.findIndex(layer => layer.getExtData() == layerItem.getExtData());\n this.drawLayers.splice(i, 1);\n } catch {\n this.drawLayers = null;\n this.drawLayersInfo = {};\n }\n },\n /** 根据类型处理不同数据 */\n setDrawLayers(drawType) {\n const type = {\n point: 'marker',\n line: 'polyline',\n polygon: 'polygon'\n };\n\n /** 图层基础配置 */\n const drawOptions = drawType == 'point' ? {\n anchor: 'bottom-center',\n icon: layers.setIcon(this.drawIcon)\n } : {\n strokeWeight: 8\n };\n this.drawMouseTool[type[drawType]]({\n ...drawOptions,\n ...this.drawOptions\n });\n },\n /** 赋值不同图层数据 */\n assignDrawLayers(drawType) {\n if (drawType == 'point') {\n const {\n lng,\n lat\n } = this.drawLayers.getPosition();\n const position = {\n longitude: lng,\n latitude: lat\n };\n methods.getMapAddress(position, address => {\n this.drawLayersInfo = {\n ...position,\n ...address\n };\n });\n return;\n }\n const range = this.drawLayers.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n this.drawLayersInfo = {\n range\n };\n },\n /** 回显不同类型图层 */\n echoDrawLayers(drawType) {\n const drawLayersItem = (drawItem, type, i = 0) => {\n // && drawItem.latitude && drawItem.longitude 忘记当时为什么加这个了 后续在想\n if (drawItem && this.amap) {\n let layersItem = null;\n const {\n longitude,\n latitude,\n range\n } = drawItem;\n const setOptions = {\n extData: `draw${type}${i}`,\n ...this.drawOptions\n };\n if (type == 'point') {\n layersItem = layers.setMarker(this.drawIcon, {\n position: [longitude, latitude],\n ...setOptions\n });\n } else {\n const options = {\n path: range,\n strokeWeight: 8,\n ...setOptions\n };\n layersItem = type == 'line' ? new AMap.Polyline(options) : new AMap.Polygon(options);\n }\n layersItem.setMap(this.amap);\n this.amap.setFitView();\n }\n };\n if (!this.isExhibition) {\n drawLayersItem(this.drawLayersInfo, drawType);\n return;\n }\n if (this.drawInfoAll) {\n for (let key in this.drawInfoAll) {\n const isArray = Array.isArray(this.drawInfoAll[key]);\n isArray ? this.drawInfoAll[key].forEach((drawItem, i) => {\n drawLayersItem(drawItem, key, i);\n }) : drawLayersItem(this.drawInfoAll[key], key);\n }\n return;\n }\n drawLayersItem(this.drawLayersInfo, drawType);\n }\n },\n render(h) {\n const {\n drawEl,\n drawIcon,\n buttonProps,\n isExhibition,\n AmapDrawClear,\n searchChoose\n } = this;\n return h(\"div\", {\n \"class\": \"AmapDraw\"\n }, [!isExhibition && h(_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n \"props\": {\n ...{\n drawIcon,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose\n }\n }\n }), h(\"div\", {\n \"attrs\": {\n \"id\": drawEl\n }\n })]);\n }\n};\nAmapDraw.install = function (Vue) {\n Vue.component('AmapDraw', AmapDraw);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapDraw);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/AmapDraw.jsx?");
9001
+ eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapDrawProps: function() { return /* binding */ AmapDrawProps; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/AmapSearch/index.jsx */ \"./plugins/lib/amap/components/AmapSearch/index.jsx\");\n/* harmony import */ var ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ant-design-vue/es/_util/vue-types */ \"./node_modules/ant-design-vue/es/_util/vue-types/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _AmapDraw_less__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AmapDraw.less */ \"./plugins/lib/amap/AmapDraw.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__]);\n_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst amap = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_2__.getAMapInstance)();\nconst {\n AMap,\n methods,\n layers\n} = amap;\n\nconst AmapDrawProps = {\n /** drawEl为地图容器实例名称 */\n drawEl: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('AmapDraw'),\n /** drawType为绘制类型\r\n * 可选值(point点 | line线 | polygon面)\r\n */\n drawType: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string.def('point'),\n /** 绘制图标 (只在point类型下生效 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].any.def('http://qxfa.tpddns.cn:8090/poi/poi-marker-default.png'),\n /** drawCount为绘制物绘制个数 */\n drawCount: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].number.def(1),\n /** drawOptions为绘制物配置项 */\n drawOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** drawInfo为绘制物信息 */\n drawInfo: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].array]),\n /** drawInfoAll为所有不同类型绘制物信息(用于回显地图图层)\r\n * 格式: { point: ([]||{}), line: ([]||{}) }\r\n */\n drawInfoAll: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object,\n /** 限制区域 */\n drawLimitArea: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].oneOfType([ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object, ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].string]),\n /** 限制区域样式配置 */\n drawLimitAreaOptions: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].object.def({}),\n /** 是否为纯地图展示数据 */\n isExhibition: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_4__[\"default\"].bool.def(false)\n};\nconst AmapDraw = {\n name: 'AmapDraw',\n props: AmapDrawProps,\n data() {\n return {\n amap: null,\n drawArea: null,\n drawLayers: null,\n drawMouseTool: null,\n buttonProps: [],\n drawButtonProps: [{\n type: 'primary',\n text: '绘制',\n event: {\n click: this.AmapDraw\n }\n }, {\n text: '清除',\n event: {\n click: this.AmapDrawClear\n }\n }],\n saveButtonProps: [{\n type: 'primary',\n text: '保存',\n event: {\n click: this.AmapDrawSave\n }\n }, {\n text: '取消',\n event: {\n click: this.AmapDrawReset\n }\n }]\n };\n },\n computed: {\n drawLayersInfo: {\n get() {\n return this.drawInfo;\n },\n set(newValue) {\n this.$emit('getAMapLayersInfo', newValue);\n }\n }\n },\n watch: {\n drawInfo: {\n handler(newVal, oldVal) {\n const newValue = this.drawLayersInfo;\n newVal && this.echoDrawLayers(this.drawType);\n },\n deep: true\n },\n drawInfoAll(newValue) {\n newValue && this.echoDrawLayers();\n },\n drawOptions(newValue) {\n /** 检测options覆盖物配置是否更改,更改后要同步到地图上 */\n Object.keys(newValue).length && this.setOverlayOptions(newValue);\n },\n drawLimitArea(newValue) {\n newValue && this.setDrawLimitArea();\n }\n },\n mounted() {\n this.amap = amap.initMap({\n el: this.drawEl\n });\n this.buttonProps = [].concat(this.drawButtonProps);\n this.echoDrawLayers(this.drawType);\n /** 如果有限制区域,则描绘在地图上 */\n this.drawLimitArea && this.setDrawLimitArea();\n },\n destroyed() {\n this.AmapDrawClear();\n },\n methods: {\n /** 绘制 */\n AmapDraw() {\n this.buttonProps = [].concat(this.saveButtonProps);\n this.drawMouseTool = new AMap.MouseTool(this.amap);\n this.AmapDrawClear();\n this.setDrawLayers(this.drawType);\n this.drawMouseTool.on('draw', ({\n obj\n }) => {\n if (this.drawArea && !this[`is${this.drawType}InRing`](obj)) return this.amap.remove(obj), this.$message.error('未在范围内描绘!');\n /** 暂未支持一次性绘制多个 */\n this.drawCount > 1 ? (this.drawLayers = this.drawLayers || [], this.drawLayers.push(obj)) : this.drawLayers = obj;\n if (this.drawLayers && (this.drawLayers.length == this.drawCount || this.drawCount == 1)) {\n return this.drawMouseTool.close();\n }\n });\n },\n /** 清空绘制 / 清空搜索 */\n AmapDrawClear() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && this.amap.remove(layerItem));\n // this.amap.clearMap()\n this.drawLayers = null;\n this.drawLayersInfo = {};\n },\n /** 保存当前绘制 */\n AmapDrawSave() {\n this.assignDrawLayers(this.drawType);\n this.buttonProps = [].concat(this.drawButtonProps);\n },\n /** 取消当前绘制 */\n AmapDrawReset() {\n this.buttonProps = [].concat(this.drawButtonProps);\n this.AmapDrawClear();\n },\n /** 搜索地址 */\n searchChoose(searchMarker, searchInfo) {\n this.AmapDrawClear();\n searchMarker.setMap(this.amap);\n this.amap.setZoomAndCenter(15, searchMarker.getPosition());\n this.drawType == 'point' && (this.drawLayersInfo = searchInfo);\n // this.$emit('getAMapLayersInfo', this.drawLayersInfo)\n },\n /** 检测覆盖物配置信息并同步 */\n setOverlayOptions(options) {\n if (!this.drawLayers) return;\n this.drawCount > 1 ? this.drawLayers.forEach(drawItem => drawItem.setOptions(options)) : this.drawLayers.setOptions(options);\n },\n /** 绘制限定区域 */\n setDrawLimitArea() {\n let areaRange = [];\n try {\n areaRange = JSON.parse(this.drawLimitArea);\n } catch {\n areaRange = this.drawLimitArea;\n }\n this.drawArea && this.amap.remove(this.drawArea);\n /** 判断目前地图上存在的所绘制覆盖物是否在限制范围内 */\n this.setMapArea(areaRange);\n this.judgeOverlays();\n },\n /** 绘制地图区域范围 */\n setMapArea(jurisdictionRange) {\n this.drawArea = new AMap.Polygon({\n map: this.amap,\n path: jurisdictionRange,\n extData: 'Area',\n strokeWeight: 6,\n ...this.drawLimitAreaOptions\n });\n const {\n lng,\n lat\n } = this.drawArea.getBounds().getCenter();\n this.amap.setZoomAndCenter(15, [lng, lat]);\n },\n /** 判断一个线段是否在面内 */\n islineInRing(polyline) {\n const paths = polyline.getPath();\n return paths.every(pointItem => this.ispointInRing(pointItem));\n },\n /** 判断一个点是否在面内 */\n ispointInRing(point) {\n let position;\n try {\n position = point.getPosition();\n } catch {\n position = point;\n }\n return AMap.GeometryUtil.isPointInRing(position, this.drawArea.getPath());\n },\n /** 判断地图上所覆盖物是否在限制范围内 */\n judgeOverlays() {\n this.amap.getAllOverlays().forEach(layerItem => layerItem.getExtData() != 'Area' && !this[`is${this.drawType}InRing`](layerItem) && this.removeOverlay(layerItem));\n },\n /** 清除单个覆盖物(或 不符合区域范围的覆盖物 */\n removeOverlay(layerItem) {\n this.amap.remove(layerItem);\n this.$message.error('未在区域范围内,请重新描绘!');\n try {\n const i = this.drawLayers.findIndex(layer => layer.getExtData() == layerItem.getExtData());\n this.drawLayers.splice(i, 1);\n } catch {\n this.drawLayers = null;\n this.drawLayersInfo = {};\n }\n },\n /** 根据类型处理不同数据 */\n setDrawLayers(drawType) {\n const type = {\n point: 'marker',\n line: 'polyline',\n polygon: 'polygon'\n };\n\n /** 图层基础配置 */\n const drawOptions = drawType == 'point' ? {\n anchor: 'bottom-center',\n icon: layers.setIcon(this.drawIcon)\n } : {\n strokeWeight: 8\n };\n this.drawMouseTool[type[drawType]]({\n ...drawOptions,\n ...this.drawOptions\n });\n },\n /** 赋值不同图层数据 */\n assignDrawLayers(drawType) {\n if (drawType == 'point') {\n const {\n lng,\n lat\n } = this.drawLayers.getPosition();\n const position = {\n longitude: lng,\n latitude: lat\n };\n methods.getMapAddress(position, address => {\n this.drawLayersInfo = {\n ...position,\n ...address\n };\n });\n return;\n }\n const range = this.drawLayers.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n this.drawLayersInfo = {\n range\n };\n },\n /** 回显不同类型图层 */\n echoDrawLayers(drawType) {\n const drawLayersItem = (drawItem, type, i = 0) => {\n // && drawItem.latitude && drawItem.longitude 忘记当时为什么加这个了 后续在想\n if (drawItem && this.amap) {\n let layersItem = null;\n const {\n longitude,\n latitude,\n range\n } = drawItem;\n const setOptions = {\n extData: `draw${type}${i}`,\n ...this.drawOptions\n };\n if (type == 'point') {\n layersItem = layers.setMarker(this.drawIcon, {\n position: [longitude, latitude],\n ...setOptions\n });\n } else {\n const options = {\n path: range,\n strokeWeight: 8,\n ...setOptions\n };\n layersItem = type == 'line' ? new AMap.Polyline(options) : new AMap.Polygon(options);\n }\n layersItem.setMap(this.amap);\n this.amap.setFitView();\n }\n };\n if (!this.isExhibition) {\n drawLayersItem(this.drawLayersInfo, drawType);\n return;\n }\n if (this.drawInfoAll) {\n for (let key in this.drawInfoAll) {\n const isArray = Array.isArray(this.drawInfoAll[key]);\n isArray ? this.drawInfoAll[key].forEach((drawItem, i) => {\n drawLayersItem(drawItem, key, i);\n }) : drawLayersItem(this.drawInfoAll[key], key);\n }\n return;\n }\n drawLayersItem(this.drawLayersInfo, drawType);\n }\n },\n render(h) {\n const {\n drawEl,\n drawIcon,\n buttonProps,\n isExhibition,\n AmapDrawClear,\n searchChoose\n } = this;\n return h(\"div\", {\n \"class\": \"AmapDraw\"\n }, [!isExhibition && h(_components_AmapSearch_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n \"props\": {\n ...{\n drawIcon,\n buttonProps\n }\n },\n \"on\": {\n ...{\n searchReset: AmapDrawClear,\n searchChoose\n }\n }\n }), h(\"div\", {\n \"attrs\": {\n \"id\": drawEl\n }\n })]);\n }\n};\nAmapDraw.install = function (Vue) {\n Vue.component('AmapDraw', AmapDraw);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapDraw);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/AmapDraw.jsx?");
9002
9002
 
9003
9003
  /***/ }),
9004
9004
 
@@ -9009,7 +9009,7 @@ eval("__webpack_require__.a(module, async function (__webpack_handle_async_depen
9009
9009
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9010
9010
 
9011
9011
  "use strict";
9012
- eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapSearchProps: function() { return /* binding */ AmapSearchProps; }\n/* harmony export */ });\n/* harmony import */ var 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 _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../index */ \"./plugins/lib/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.less */ \"./plugins/lib/amap/components/AmapSearch/index.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index__WEBPACK_IMPORTED_MODULE_0__]);\n_index__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst {\n ASelectCustom\n} = _index__WEBPACK_IMPORTED_MODULE_0__.FormComp;\nconst {\n methods,\n layers\n} = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_1__.getAMapInstance)();\nconst AmapSearchProps = {\n /** 搜索后绘制图标 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].any,\n buttonProps: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"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 = layers.setMarker(this.drawIcon, {\n position: [location.lng, location.lat]\n });\n this.$emit('searchChoose', this.searchMarker, searchInfo);\n },\n /** 根据搜索框搜索地址 */\n searchHandle(keyword) {\n methods.getMapSearch(keyword, addressOptions => {\n this.selectOptions = addressOptions;\n });\n }\n },\n render(h) {\n const {\n selectOptions,\n changeHandle,\n searchHandle,\n buttonProps\n } = this;\n const props = {\n valueKey: 'id',\n labelKey: 'label',\n options: selectOptions,\n placeholder: '请输入目的地进行搜索'\n };\n return h(\"div\", {\n \"class\": \"AmapDraw__Search\"\n }, [h(ASelectCustom, {\n \"props\": {\n ...props\n },\n \"on\": {\n ...{\n change: changeHandle,\n search: searchHandle\n }\n },\n \"model\": {\n value: this.addressValue,\n callback: $$v => {\n this.addressValue = $$v;\n }\n }\n }), buttonProps && h(_index__WEBPACK_IMPORTED_MODULE_0__.Button, {\n \"attrs\": {\n \"buttonProps\": buttonProps\n },\n \"class\": \"AmapDraw__Search__Button\"\n })]);\n }\n};\nAmapSearch.install = function (Vue) {\n Vue.component('AmapSearch', AmapSearch);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapSearch);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.jsx?");
9012
+ eval("__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AmapSearchProps: function() { return /* binding */ AmapSearchProps; }\n/* harmony export */ });\n/* harmony import */ var 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 _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../index */ \"./plugins/lib/index.js\");\n/* harmony import */ var _method_AMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/method/AMap.js */ \"./plugins/method/AMap.js\");\n/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.less */ \"./plugins/lib/amap/components/AmapSearch/index.less\");\nvar __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index__WEBPACK_IMPORTED_MODULE_0__]);\n_index__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];\n\n\n\n\nconst {\n ASelectCustom\n} = _index__WEBPACK_IMPORTED_MODULE_0__.FormComp;\nconst {\n methods,\n layers\n} = await (0,_method_AMap_js__WEBPACK_IMPORTED_MODULE_1__.getAMapInstance)();\nconst AmapSearchProps = {\n /** 搜索后绘制图标 */\n drawIcon: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"default\"].any,\n buttonProps: ant_design_vue_es_util_vue_types__WEBPACK_IMPORTED_MODULE_3__[\"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 = layers.setMarker(this.drawIcon, {\n position: [location.lng, location.lat]\n });\n this.$emit('searchChoose', this.searchMarker, searchInfo);\n },\n /** 根据搜索框搜索地址 */\n searchHandle(keyword) {\n methods.getMapSearch(keyword, addressOptions => {\n this.selectOptions = addressOptions;\n });\n }\n },\n render(h) {\n const {\n selectOptions,\n changeHandle,\n searchHandle,\n buttonProps\n } = this;\n const props = {\n valueKey: 'id',\n labelKey: 'label',\n options: selectOptions,\n placeholder: '请输入目的地进行搜索'\n };\n return h(\"div\", {\n \"class\": \"AmapDraw__Search\"\n }, [h(ASelectCustom, {\n \"props\": {\n ...props\n },\n \"on\": {\n ...{\n change: changeHandle,\n search: searchHandle\n }\n },\n \"model\": {\n value: this.addressValue,\n callback: $$v => {\n this.addressValue = $$v;\n }\n }\n }), buttonProps && h(_index__WEBPACK_IMPORTED_MODULE_0__.Button, {\n \"attrs\": {\n \"buttonProps\": buttonProps\n },\n \"class\": \"AmapDraw__Search__Button\"\n })]);\n }\n};\nAmapSearch.install = function (Vue) {\n Vue.component('AmapSearch', AmapSearch);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (AmapSearch);\n__webpack_async_result__();\n} catch(e) { __webpack_async_result__(e); } }, 1);\n\n//# sourceURL=webpack://mui/./plugins/lib/amap/components/AmapSearch/index.jsx?");
9013
9013
 
9014
9014
  /***/ }),
9015
9015
 
@@ -1,6 +1,6 @@
1
1
  import AmapSearch from './components/AmapSearch/index.jsx'
2
2
  import PropTypes from 'ant-design-vue/es/_util/vue-types'
3
- import { getAMapInstance } from '../../method/AMap.js'
3
+ import { getAMapInstance } from '@/method/AMap.js'
4
4
 
5
5
  const amap = await getAMapInstance()
6
6
  const { AMap, methods, layers } = amap
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'ant-design-vue/es/_util/vue-types'
2
2
  import {FormComp, Button} from '../../../index'
3
- import {getAMapInstance} from '../../../../method/AMap.js'
3
+ import {getAMapInstance} from '@/method/AMap.js'
4
4
 
5
5
  import './index.less'
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "1.1.48",
3
+ "version": "1.1.49",
4
4
  "description": "vue-library-ui组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  import AmapSearch from './components/AmapSearch/index.jsx'
2
2
  import PropTypes from 'ant-design-vue/es/_util/vue-types'
3
- import { getAMapInstance } from '../../method/AMap.js'
3
+ import { getAMapInstance } from '@/method/AMap.js'
4
4
 
5
5
  const amap = await getAMapInstance()
6
6
  const { AMap, methods, layers } = amap
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'ant-design-vue/es/_util/vue-types'
2
2
  import {FormComp, Button} from '../../../index'
3
- import {getAMapInstance} from '../../../../method/AMap.js'
3
+ import {getAMapInstance} from '@/method/AMap.js'
4
4
 
5
5
  import './index.less'
6
6