@zhangdali1996/lr-map-viewer 0.0.147 → 0.0.149

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/README.md CHANGED
@@ -391,10 +391,11 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
391
391
  - `setRangeSelection(center, options)`
392
392
  - `setRangeSelectionByCoordinate(center, options)`
393
393
  - `setRangeSelectionRadius(radius)`
394
- - `clearRangeSelection()`
395
- - `getRangeSelectionResult()`
396
- - `registerRangeSelectionChange(callback)`
397
- - `focusMonitorPoint(target)`
394
+ - `clearRangeSelection()`
395
+ - `getRangeSelectionResult()`
396
+ - `exportRangeSelectionPersons(options)`
397
+ - `registerRangeSelectionChange(callback)`
398
+ - `focusMonitorPoint(target)`
398
399
 
399
400
  说明:
400
401
 
@@ -402,11 +403,12 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
402
403
  - `cancelRangeSelection(options)` 用于取消当前范围选点,可通过 `options.preserveCurrentResult` 控制是否保留当前结果。
403
404
  - `setRangeSelection(center, options)` 用于直接传入三维坐标生成球形范围,适合业务系统通过外部坐标直接驱动范围选点。
404
405
  - `setRangeSelectionByCoordinate(center, options)` 用于通过外部接口传入坐标生成球形范围,内部复用 `setRangeSelection` 的范围绘制、测点过滤和回调链路。
405
- - `setRangeSelectionRadius(radius)` 用于更新当前范围半径;如果当前已完成选点,会同步更新球体和范围内测点。
406
- - `clearRangeSelection()` 用于清除当前范围球、选点标记和测点过滤结果。
407
- - `getRangeSelectionResult()` 返回当前范围选点结果,包含状态、半径、球心坐标、当前巷道信息和范围内测点列表。
408
- - `registerRangeSelectionChange(callback)` 会在开始选点、选点完成、半径变化、取消、清除时触发回调。
409
- - `focusMonitorPoint(target)` 用于定位并打开指定测点的信息窗,支持传测点 `id` 或测点对象。
406
+ - `setRangeSelectionRadius(radius)` 用于更新当前范围半径;如果当前已完成选点,会同步更新球体和范围内测点。
407
+ - `clearRangeSelection()` 用于清除当前范围球、选点标记和测点过滤结果。
408
+ - `getRangeSelectionResult()` 返回当前范围选点结果,包含状态、半径、球心坐标、当前巷道信息和范围内测点列表。
409
+ - `exportRangeSelectionPersons(options)` 用于将当前范围内人员定位对象的 `name` 和 `card_id` 导出为 JSON 文件,可通过 `options.filename` 指定文件名。
410
+ - `registerRangeSelectionChange(callback)` 会在开始选点、选点完成、半径变化、取消、清除时触发回调。
411
+ - `focusMonitorPoint(target)` 用于定位并打开指定测点的信息窗,支持传测点 `id` 或测点对象。
410
412
 
411
413
  ## 二维图纸配置说明
412
414
 
@@ -588,14 +590,18 @@ function clearRangeSelection() {
588
590
  viewerRef.value?.clearRangeSelection?.()
589
591
  }
590
592
 
591
- function focusFirstMonitorPoint() {
592
- const result = viewerRef.value?.getRangeSelectionResult?.()
593
- const firstMonitorPoint = result?.monitorPoints?.[0]
594
-
595
- if (firstMonitorPoint) {
596
- viewerRef.value?.focusMonitorPoint?.(firstMonitorPoint)
597
- }
598
- }
593
+ function focusFirstMonitorPoint() {
594
+ const result = viewerRef.value?.getRangeSelectionResult?.()
595
+ const firstMonitorPoint = result?.monitorPoints?.[0]
596
+
597
+ if (firstMonitorPoint) {
598
+ viewerRef.value?.focusMonitorPoint?.(firstMonitorPoint)
599
+ }
600
+ }
601
+
602
+ function exportRangeSelectionPersons() {
603
+ viewerRef.value?.exportRangeSelectionPersons?.()
604
+ }
599
605
 
600
606
  watch(
601
607
  viewerRef,
@@ -615,12 +621,13 @@ watch(
615
621
  <template>
616
622
  <div style="height: 100vh;">
617
623
  <button type="button" @click="startRangeSelection">开始范围选点</button>
618
- <button type="button" @click="setRangeSelectionByCoordinate">按坐标生成范围</button>
619
- <button type="button" @click="clearRangeSelection">清除范围</button>
620
- <button type="button" @click="focusFirstMonitorPoint">定位首个测点</button>
621
- <LrMapViewer ref="viewerRef" :lr3d-config="lr3dConfig" />
622
- </div>
623
- </template>
624
+ <button type="button" @click="setRangeSelectionByCoordinate">按坐标生成范围</button>
625
+ <button type="button" @click="clearRangeSelection">清除范围</button>
626
+ <button type="button" @click="focusFirstMonitorPoint">定位首个测点</button>
627
+ <button type="button" @click="exportRangeSelectionPersons">导出范围人员</button>
628
+ <LrMapViewer ref="viewerRef" :lr3d-config="lr3dConfig" />
629
+ </div>
630
+ </template>
624
631
  ```
625
632
 
626
633
  如果你需要切换二维与三维模式: