Explorar el Código

互联网-社管一张图-清空标绘,点击工具栏“清空标绘”,未清空框选范围及框选数据,只是收起了框选页面

CzRger hace 1 año
padre
commit
c2f46e457d
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 4 1
      src/views/gis/layout/index.vue
  2. 1 1
      src/views/gis/layout/tools/select.vue

+ 4 - 1
src/views/gis/layout/index.vue

@@ -126,7 +126,8 @@ export default defineComponent({
       toolsCom: null,
       toolsParams: {
         element: null,
-        position: null
+        position: null,
+        select: null
       },
       videoLayout: {
         width: 640,
@@ -242,6 +243,8 @@ export default defineComponent({
         //  定位'layerName', 'positionLayer'
         state.map.getLayers().getArray().filter(v => v.get('layerName') === 'positionLayer')?.[0]?.getSource()?.clear()
         clearLocationDom()
+        //  框选清空
+        state.toolsParams.select?.clearFunc()
       } else {
         state.toolsCom = markRaw(item.com)
         state.toolsType = (state.toolsType === item.value ? '' : item.value)

+ 1 - 1
src/views/gis/layout/tools/select.vue

@@ -284,7 +284,7 @@ export default defineComponent({
       if (props.transfer) {
         state.cusTransfer = props.transfer
       } else {
-        emit('update:transfer', state.cusTransfer)
+        emit('update:transfer', Object.assign(state.cusTransfer, {clearFunc: mapClear}))
       }
       state.cusTransfer.result.form = JSON.parse(JSON.stringify(state.cusTransfer.result.tempForm))
       const realLayer = props.map?.getLayers().getArray().filter(v => v.get('layerName') === 'selectDrawLayer')?.[0]