web-component-gallery 2.3.26 → 2.3.27

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.
@@ -40,7 +40,9 @@ export const AmapDrawProps = {
40
40
  // 是否为纯展示模式(不显示控制按钮)
41
41
  isExhibition: PropTypes.bool.def(false),
42
42
  // 自定义绘制操作按钮
43
- drawButtonOperate: PropTypes.array
43
+ drawButtonOperate: PropTypes.array,
44
+ // 绘制时是否清除地图上的覆盖物
45
+ clearOnDraw: PropTypes.bool.def(true)
44
46
  }
45
47
 
46
48
  export default {
@@ -90,8 +92,8 @@ export default {
90
92
  // 监听绘制信息变化,当变化时重新渲染对应类型的绘制图层
91
93
  drawInfo: {
92
94
  handler(newVal) {
93
- newVal && this.echoDrawLayers(this.drawType)
94
- },
95
+ newVal && this.echoDrawLayers(this.drawType)
96
+ },
95
97
  deep: true
96
98
  },
97
99
  // 监听所有绘制信息变化,重新渲染全部绘制图层
@@ -217,8 +219,11 @@ export default {
217
219
 
218
220
  // 清除当前绘制的所有图层
219
221
  handleDrawClear() {
220
- // 清理地图上的所有覆盖物
221
- this.cleanOverlays()
222
+ // 根据配置决定是否清除之前的绘制内容
223
+ if (this.clearOnDraw) {
224
+ this.cleanOverlays()
225
+ }
226
+
222
227
  // 重置绘制图层数组
223
228
  this.drawLayers = null
224
229
  // 重置绘制图层信息
@@ -233,12 +238,16 @@ export default {
233
238
  }
234
239
  // 分配绘制图层信息
235
240
  this.assignDrawLayers(this.drawType)
241
+ // 触发保存事件
242
+ this.$emit('drawSave')
236
243
  },
237
244
 
238
245
  // 取消绘制操作
239
246
  handleDrawReset() {
240
247
  // 直接调用清除方法
241
248
  this.handleDrawClear()
249
+ // 触发取消事件
250
+ this.$emit('drawCancel')
242
251
  },
243
252
 
244
253
  // 处理搜索结果选择
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "2.3.26",
3
+ "version": "2.3.27",
4
4
  "description": "基础vue、antdvue、less实现的私有组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [