web-component-gallery 2.3.23 → 2.3.24

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.
@@ -78,8 +78,8 @@ export default {
78
78
  computed: {
79
79
  // 绘制图层信息的计算属性,用于获取和设置绘制结果
80
80
  drawLayersInfo: {
81
- get() { return transferData(this.drawInfo, 'Object') },
82
- set(newValue) {
81
+ get() { return transferData(this.drawInfo, 'Object') },
82
+ set(newValue) {
83
83
  // 触发外部事件,传递绘制的图层信息
84
84
  this.$emit('getAMapLayersInfo', this.initDrawInfo(newValue))
85
85
  }
@@ -89,7 +89,9 @@ export default {
89
89
  watch: {
90
90
  // 监听绘制信息变化,当变化时重新渲染对应类型的绘制图层
91
91
  drawInfo: {
92
- handler(newVal) { newVal && this.echoDrawLayers(this.drawType) },
92
+ handler(newVal) {
93
+ newVal && this.echoDrawLayers(this.drawType)
94
+ },
93
95
  deep: true
94
96
  },
95
97
  // 监听所有绘制信息变化,重新渲染全部绘制图层
@@ -194,7 +196,7 @@ export default {
194
196
  // 结束绘制流程
195
197
  finishDrawing() {
196
198
  // 关闭鼠标绘制工具
197
- this.drawMouseTool.close()
199
+ this.drawMouseTool?.close()
198
200
  // 恢复操作按钮状态
199
201
  this.updateDrawOperateState('primary')
200
202
  // 重置活跃操作索引
@@ -228,7 +230,7 @@ export default {
228
230
  // 如果没有绘制任何内容,则重置绘制状态
229
231
  if (!this.drawLayers) {
230
232
  return this.handleDrawReset()
231
- }
233
+ }
232
234
  // 分配绘制图层信息
233
235
  this.assignDrawLayers(this.drawType)
234
236
  },
@@ -245,10 +247,8 @@ export default {
245
247
  this.handleDrawClear()
246
248
  // 将选中的标记添加到地图
247
249
  searchMarker.setMap(this.amap)
248
- // 设置地图缩放级别和中心点
249
- this.amap.setZoomAndCenter(15, searchMarker.getPosition())
250
250
  // 如果是点类型绘制,则更新绘制信息
251
- this.drawType === 'point' && (this.drawLayersInfo = searchInfo)
251
+ this.drawType === 'point' && this.handleDrawComplete(searchMarker)
252
252
  },
253
253
 
254
254
  // 设置覆盖物的参数选项
@@ -442,13 +442,14 @@ export default {
442
442
  // 清理现有覆盖物
443
443
  this.cleanOverlays()
444
444
 
445
- // 根据是否有全部绘制信息决定渲染方式
446
- this.drawInfoAll ?
447
- this.renderAllDrawLayers() :
448
- this.renderSingleDrawLayer(drawType)
445
+ // 绘制多个类型覆盖物信息(如果存在)
446
+ this.drawInfoAll && this.renderAllDrawLayers()
447
+ // 绘制单个类型覆盖物信息(如果存在)
448
+ this.drawLayersInfo && this.renderSingleDrawLayer(drawType)
449
449
 
450
- // 如果没有活跃操作,则自动调整地图视野以适应所有图层
451
- if (this.activeOperateIndex === -1) setTimeout(this.amap.setFitView(), 0)
450
+ if (this.activeOperateIndex === -1) {
451
+ setTimeout(() => this.amap.setFitView(), 0)
452
+ }
452
453
  },
453
454
 
454
455
  // 清理地图上除限制区域外的所有覆盖物
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "2.3.23",
3
+ "version": "2.3.24",
4
4
  "description": "基础vue、antdvue、less实现的私有组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [