瀏覽代碼

周边分析

CzRger 1 年之前
父節點
當前提交
3ec7cb1030

+ 13 - 6
src/store/modules/dictionary.ts

@@ -9,12 +9,12 @@ const state = {
 		{dictLabel: '缉私警', dictValue: 'jsj'},
 		{dictLabel: '网格员', dictValue: 'wgy'},
 		{dictLabel: '危险车辆', dictValue: 'wxcl'},
-		{dictLabel: '公安类设备', dictValue: 'gal'},
-		{dictLabel: '社会类设备', dictValue: 'shl'},
-		{dictLabel: '民用类设备', dictValue: 'myl'},
-		{dictLabel: '零关税自用进口生产设备', dictValue: 'lgszyjkscsb'},
-		{dictLabel: '加工增值免关税', dictValue: 'jgzzmgs'},
-		{dictLabel: '零关税进口原辅料', dictValue: 'lgsjkfzl'},
+		{dictLabel: '公安类设备', dictValue: 'gal', dictType: 'sb', geoType: 'mysqlGeo:gis_sb_gal'},
+		{dictLabel: '社会类设备', dictValue: 'shl', dictType: 'sb', geoType: 'mysqlGeo:gis_sb_shl'},
+		{dictLabel: '民用类设备', dictValue: 'myl', dictType: 'sb', geoType: 'mysqlGeo:gis_sb_myl'},
+		{dictLabel: '零关税自用进口生产设备', dictValue: 'lgszyjkscsb', dictType: 'qy', geoType: 'mysqlGeo:gis_qy_lgszyjkscsb'},
+		{dictLabel: '加工增值免关税', dictValue: 'jgzzmgs', dictType: 'qy', geoType: 'mysqlGeo:gis_qy_jgzzmgs'},
+		{dictLabel: '零关税进口原辅料', dictValue: 'lgsjkyfl', dictType: 'qy', geoType: 'mysqlGeo:gis_qy_lgsjkyfl'},
 		{dictLabel: '景区', dictValue: 'jq'},
 		{dictLabel: '旅馆', dictValue: 'lg'},
 		{dictLabel: '出租屋', dictValue: 'czw'},
@@ -36,6 +36,13 @@ const getters = {
 			map.set(v.dictValue, v.dictLabel)
 		})
 		return map
+	},
+	elementTypeMapGeo: (state) => {
+		const map = new Map()
+		state.elementTypeList.forEach(v => {
+			map.set(v.dictValue, v.geoType)
+		})
+		return map
 	}
 }
 

+ 151 - 50
src/store/modules/gis.ts

@@ -75,18 +75,18 @@ const state = {
         label: '设备资源',
         active: true,
         children: [
-          {label: '公安类设备', value: 'galsb', geoValue: 'gal', active: true, typeName: 'mysqlGeo:stg_view_deviceinfo_df_value1'},
-          {label: '社会类设备', value: 'shlsb', geoValue: 'shl', active: true, typeName: 'mysqlGeo:stg_view_deviceinfo_df_value2'},
-          {label: '民用类设备', value: 'mylsb', geoValue: 'myl', active: true, typeName: 'mysqlGeo:stg_view_deviceinfo_df_value3'},
+          {label: '公安类设备', value: 'gal', active: true},
+          {label: '社会类设备', value: 'shl', active: true},
+          {label: '民用类设备', value: 'myl', active: true},
         ]
       },
       {
         label: '企业',
         active: true,
         children: [
-          {label: '零关税自用进口生产设备', value: 'lgszyjkscsb', geoValue: 'lgszyjkscsb', active: true, typeName: 'mysqlGeo:lgsqy_typeValue1'},
-          {label: '加工增值免关税', value: 'jgzzmgs', geoValue: 'jgzzmgs', active: true, typeName: 'mysqlGeo:lgsqy_typeValue2'},
-          {label: '零关税进口原辅料', value: 'lgsjkyfl', geoValue: 'lgsjkfzl', active: true, typeName: 'mysqlGeo:lgsqy_typeValue3'},
+          {label: '零关税自用进口生产设备', value: 'lgszyjkscsb', active: true},
+          {label: '加工增值免关税', value: 'jgzzmgs', active: true},
+          {label: '零关税进口原辅料', value: 'lgsjkyfl', active: true},
         ]
       },
       // {
@@ -105,6 +105,7 @@ const state = {
     layer: null,
   },
   analysis: {
+    feature: null,
     source: null,
     layer: null,
     wkt: '',
@@ -237,7 +238,7 @@ const mutations = {
       ]
     });
     state.gisParams.qy.analysisCircle = new ol.Feature()
-    state.gisParams.qy.analysisCircle.set(featureTypeKey, 'analysisCircle')
+    state.gisParams.qy.analysisCircle.set(featureTypeKey, 'qyAnalysisCircle')
     state.map.addLayer(state.gisParams.qy.analysisLayer)
     state.gisParams.qy.analysisDeviceLayer = new layer.Tile({
       zIndex: 30
@@ -266,6 +267,8 @@ const mutations = {
       ]
     });
     state.analysis.layer.set('layerName', 'analysisDrawViewsLayer')
+    state.analysis.feature = new ol.Feature()
+    state.analysis.feature.set(featureTypeKey, 'analysisCircle')
     state.map.addLayer(state.analysis.layer)
     state.analysis.deviceLayer = new layer.Tile({
       zIndex: 30
@@ -285,7 +288,7 @@ const mutations = {
         state.gisParams.default.overlay.setPosition(undefined)
       }
     }
-    const clickAnalysisCircle = (e, feat) => {
+    const clickQyAnalysisCircle = (e, feat) => {
       const viewResolution = e.map.getView().getResolution()
       const url = state.gisParams.qy.analysisDeviceLayer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
         'INFO_FORMAT': 'application/json',
@@ -309,56 +312,115 @@ const mutations = {
         })
       }
     }
+    const handleTileClick = async (e) => {
+      let continueFlag = true
+      if (state.gisParams.qy.analysisWKT && continueFlag) {
+        const viewResolution = e.map.getView().getResolution()
+        const url = state.gisParams.qy.analysisDeviceLayer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
+          'INFO_FORMAT': 'application/json',
+          'FEATURE_COUNT': 10000
+        })
+        if (url) {
+          await axios.get(url).then(res => {
+            if (res.status === 200) {
+              const item = res.data?.features?.[res.data?.features?.length - 1]
+              if (item) {
+                continueFlag = false
+                console.log(item)
+                if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
+                  store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
+                  store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
+                    wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
+                    id: item.properties.dataId,
+                    info: item.properties
+                  })
+                }
+              }
+            }
+          })
+        }
+      }
+      if (state.analysis.wkt && continueFlag) {
+        const viewResolution = e.map.getView().getResolution()
+        const url = state.analysis.deviceLayer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
+          'INFO_FORMAT': 'application/json',
+          'FEATURE_COUNT': 10000
+        })
+        if (url) {
+          await axios.get(url).then(res => {
+            if (res.status === 200) {
+              const item = res.data?.features?.[res.data?.features?.length - 1]
+              if (item) {
+                console.log(item)
+                continueFlag = true
+                if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
+                  store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
+                  store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
+                    wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
+                    id: item.properties.dataId,
+                    info: item.properties
+                  })
+                }
+              }
+            }
+          })
+        }
+      }
+      if (store.getters['gis/elementActiveArr'].length > 0 && continueFlag) {
+        const viewResolution = e.map.getView().getResolution()
+        const url = state.element.layer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
+          'INFO_FORMAT': 'application/json',
+          'FEATURE_COUNT': 10000
+        })
+        if (url) {
+          await axios.get(url).then(res => {
+            if (res.status === 200) {
+              const item = res.data?.features?.[res.data?.features?.length - 1]
+              if (item) {
+                console.log(item)
+                continueFlag = true
+                if (['lgszyjkscsb', 'jgzzmgs', 'lgsjkyfl'].includes(item.properties.typeValue)) {
+                  store.commit('gis/SET_GIS_PARAMS_QY_RESET')
+                  store.commit('gis/SET_GIS_PARAMS_QY', {
+                    wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
+                    id: item.properties.dataId,
+                    info: item.properties
+                  })
+                } else if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
+                  store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
+                  store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
+                    wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
+                    id: item.properties.dataId,
+                    info: item.properties
+                  })
+                }
+              }
+            }
+          })
+        }
+      }
+    }
     state.map.on('singleclick', e => {
       let isFeature = false
       e.map.forEachFeatureAtPixel(e.pixel, (feature) => {
         if (!isFeature) {
+          isFeature = true
           switch (feature.get(featureTypeKey)) {
             case 'qy': clickQy(e, feature)
               break
             case 'sb': clickDefault(e, feature)
               break
-            case 'analysisCircle': clickAnalysisCircle(e, feature)
+            case 'qyAnalysisCircle': isFeature = false
+              break
+            case 'analysisCircle': isFeature = false
               break
           }
-          isFeature = true
         }
       }, {
         hitTolerance: 0,
       });
-      if (state.element.list.some(v => v.active)) {
-        if (!isFeature) {
-          const viewResolution = e.map.getView().getResolution()
-          const url = state.element.layer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
-            'INFO_FORMAT': 'application/json',
-            'FEATURE_COUNT': 10000
-          })
-          if (url) {
-            axios.get(url).then(res => {
-              if (res.status === 200) {
-                const item = res.data?.features?.[res.data?.features?.length - 1]
-                if (item) {
-                  console.log(item)
-                  if (['lgszyjkscsb', 'jgzzmgs', 'lgsjkfzl'].includes(item.properties.typeValue)) {
-                    store.commit('gis/SET_GIS_PARAMS_QY_RESET')
-                    store.commit('gis/SET_GIS_PARAMS_QY', {
-                      wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
-                      id: item.properties.dataId,
-                      info: item.properties
-                    })
-                  } else if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
-                    store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
-                    store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
-                      wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
-                      id: item.properties.dataId,
-                      info: item.properties
-                    })
-                  }
-                }
-              }
-            })
-          }
-        }
+      if (!isFeature) {
+        handleTileClick(e)
       }
     })
   },
@@ -398,7 +460,7 @@ const mutations = {
           type = 'lgszyjkscsb'
         } else if (info.typeValue === 'jgzzmgs') {
           type = 'jgzzmgs'
-        } else if (info.typeValue === 'lgsjkfzl') {
+        } else if (info.typeValue === 'lgsjkyfl') {
           type = 'lgsjkyfl'
         }
         newFeat.set('defaultStyle', QyStyle.qyStyle(type))
@@ -451,7 +513,7 @@ const mutations = {
     if (state.gisParams.qy.analysisDeviceLayer) {
       state.gisParams.qy.analysisWKT = formatPosition.cpnTwpn(state.gisParams.qy.analysisCircle.getGeometry().getCoordinates())
       store.commit('gis/SET_GIS_ELEMENT')
-      store.commit('gis/SET_GIS_ANALYSIS_ELEMENT')
+      store.commit('gis/SET_GIS_QY_ANALYSIS_ELEMENT')
       state.gisParams.qy.info['5'].tableData = []
       state.gisParams.qy.info['5'].loading = true
       axios({
@@ -461,7 +523,7 @@ const mutations = {
           service: 'WFS',
           version: '1.0.0',
           request: 'GetFeature',
-          typename: 'mysqlGeo:stg_view_deviceinfo_df_value1,mysqlGeo:stg_view_deviceinfo_df_value2,mysqlGeo:stg_view_deviceinfo_df_value3',
+          typename: store.state.dictionary.elementTypeList.filter(v => v.dictType === 'sb').map(v => v.geoType).join(','),
           srsName: 'EPSG:4326',
           outputFormat: 'application/json',
           CQL_FILTER: `INTERSECTS(location, ${state.gisParams.qy.analysisWKT})`
@@ -709,7 +771,7 @@ const mutations = {
   },
   SET_GIS_ELEMENT(state, activeArr: any = []) {
     const cql: any = ["(geoType = 2)"]
-    cql.push(`(typeValue in (${store.getters['gis/elementActiveArr'].length > 0 ? store.getters['gis/elementActiveArr'].map(v => `'${v.geoValue}'`).join(',') : -1}))`)
+    cql.push(`(typeValue in (${store.getters['gis/elementActiveArr'].length > 0 ? store.getters['gis/elementActiveArr'].map(v => `'${v.value}'`).join(',') : -1}))`)
     const notIds: Array<string> = []
     if (state.gisParams.default.feature) {
       notIds.push(`'${state.gisParams.default.feature.getId()}'`)
@@ -724,6 +786,9 @@ const mutations = {
     if (state.gisParams.qy.analysisWKT) {
       vp = `locationValue:${formatWkt(state.gisParams.qy.analysisWKT)}`
     }
+    if (state.analysis.wkt) {
+      vp = `locationValue:${formatWkt(state.analysis.wkt)}`
+    }
     const tileWMS = new source.TileWMS({
       url: `/${store.state.app.apiProxy.geoserverApi}/geoserver/mysqlGeo/wms`,
       params: {
@@ -731,7 +796,6 @@ const mutations = {
         'VERSION': '1.1.1',
         "exceptions": 'application/vnd.ogc.se_inimage',
         refresh: new Date().getTime(),
-        // LAYERS: 'mysqlGeo:gis-test',
         LAYERS: 'mysqlGeo:socialManagementElement',
         viewparams: vp,
         CQL_FILTER: `(${cql.join(' and ')})`
@@ -739,7 +803,7 @@ const mutations = {
     })
     state.element.layer.setSource(tileWMS)
   },
-  SET_GIS_ANALYSIS_ELEMENT(state) {
+  SET_GIS_QY_ANALYSIS_ELEMENT(state) {
     if (state.gisParams.qy.analysisWKT) {
       const cql: any = ["(geoType = 1)", "(typeValue in ('gal', 'shl', 'myl'))"]
       const notIds: Array<string> = []
@@ -768,11 +832,40 @@ const mutations = {
       state.gisParams.qy.analysisDeviceLayer.setSource(tileWMS)
     }
   },
+  SET_GIS_ANALYSIS_ELEMENT(state) {
+    if (state.analysis.wkt) {
+      const cql: any = ["(geoType = 1)", "(typeValue in ('gal', 'shl', 'myl'))"]
+      const notIds: Array<string> = []
+      if (state.gisParams.default.type === 'sb' && state.gisParams.default.feature) {
+        notIds.push(`'${state.gisParams.default.feature.getId()}'`)
+      }
+      if (notIds.length > 0) {
+        cql.push(`(dataId not in (${notIds.join(',')}))`)
+      }
+      const tileWMS = new source.TileWMS({
+        url: `/${store.state.app.apiProxy.geoserverApi}/geoserver/mysqlGeo/wms`,
+        params: {
+          'FORMAT': 'image/png8',
+          'VERSION': '1.1.1',
+          "exceptions": 'application/vnd.ogc.se_inimage',
+          refresh: new Date().getTime(),
+          LAYERS: 'mysqlGeo:socialManagementElement',
+          viewparams: `locationValue:${formatWkt(state.analysis.wkt)}`,
+          CQL_FILTER: `(${cql.join(' and ')})`
+        }
+      })
+      state.analysis.deviceLayer.setSource(tileWMS)
+    }
+  },
   SET_GIS_ANALYSIS(state, {wkt, center}) {
     state.analysis.wkt = wkt
+    store.commit('gis/SET_GIS_ELEMENT')
+    store.commit('gis/SET_GIS_ANALYSIS_ELEMENT')
     state.analysis.power = []
     state.analysis.device = []
     state.analysis.loading = true
+    state.analysis.source.clear()
+    state.analysis.source.addFeature(state.analysis.feature)
     axios({
       url: state.element.layer.getSource().getUrls()[0],
       method: 'get',
@@ -780,7 +873,7 @@ const mutations = {
         service: 'WFS',
         version: '1.0.0',
         request: 'GetFeature',
-        typename: 'mysqlGeo:stg_view_deviceinfo_df_value1,mysqlGeo:stg_view_deviceinfo_df_value2,mysqlGeo:stg_view_deviceinfo_df_value3',
+        typename: store.state.dictionary.elementTypeList.filter(v => v.dictType === 'sb').map(v => v.geoType).join(','),
         srsName: 'EPSG:4326',
         outputFormat: 'application/json',
         CQL_FILTER: `INTERSECTS(location, ${wkt})`
@@ -804,6 +897,14 @@ const mutations = {
     }).catch(() => {
       state.analysis.loading = false
     })
+  },
+  SET_GIS_ANALYSIS_RESET(state) {
+    state.analysis.wkt = ''
+    state.analysis.power = []
+    state.analysis.device = []
+    state.analysis.source.clear()
+    state.analysis.deviceLayer.setSource(null)
+    store.commit('gis/SET_GIS_ELEMENT')
   }
 }
 

+ 12 - 25
src/views/gis/business/enterprise/index.vue

@@ -44,11 +44,7 @@
             v-model:param="enterprise.tempForm.type"
             multiple
             collapse-tags
-            :options="[
-              {dictLabel: '零关税自用进口生产设备', dictValue: 'lgszyjkscsb'},
-              {dictLabel: '加工增值免关税', dictValue: 'jgzzmgs'},
-              {dictLabel: '零关税进口原辅料', dictValue: 'lgsjkyfl'},
-            ]"
+            :options="$store.state.dictionary.elementTypeList.filter(v => v.dictType === 'qy')"
         />
         <div class="form-two">
           <CusFormColumn
@@ -67,26 +63,26 @@
       <div class="table" v-loading="enterprise.table.loading">
         <div class="table-card">
           <template v-for="(item, index) in enterprise.table.data">
-            <div class="table-card-item __hover" :class="{active: item.id === $store.state.gis.activeQyId}" @click="handleClick(item)">
+            <div class="table-card-item __hover" :class="{active: item.dataId === $store.state.gis.gisParams.qy.feature?.getId()}" @click="handleClick(item)">
               <img src="@/assets/images/gis-business/enterprise_list-icon1.png" alt=""/>
               <div class="table-card-item-right">
                 <div class="table-card-item-right-top">
                   <CusEllipsis :value="`${(enterprise.table.pageNum - 1) * enterprise.table.pageSize + index + 1}.${item.qymc}`"/>
                 </div>
                 <div class="table-card-item-right-bottom">
-                  <template v-if="item.qykx === '零关税自用进口生产设备'">
+                  <template v-if="item.type_value === 'lgszyjkscsb'">
                     <img src="@/assets/images/gis-business/enterprise_list-icon3.png" alt=""/>
-                    <span style="color: #77E24D;">{{item.qykx}}</span>
+                    <span style="color: #77E24D;">{{$store.getters['dictionary/elementTypeMap'].get(item.type_value)}}</span>
                   </template>
-                  <template v-else-if="item.qykx === '加工增值免关税'">
+                  <template v-else-if="item.type_value === 'jgzzmgs'">
                     <img src="@/assets/images/gis-business/enterprise_list-icon2.png" alt=""/>
-                    <span style="color: #F67D61;">{{item.qykx}}</span>
+                    <span style="color: #F67D61;">{{$store.getters['dictionary/elementTypeMap'].get(item.type_value)}}</span>
                   </template>
-                  <template v-else-if="item.qykx === '零关税进口原辅料'">
+                  <template v-else-if="item.type_value === 'lgsjkyfl'">
                     <img src="@/assets/images/gis-business/enterprise_list-icon4.png" alt=""/>
-                    <span style="color: #E0C50D;">{{item.qykx}}</span>
+                    <span style="color: #E0C50D;">{{$store.getters['dictionary/elementTypeMap'].get(item.type_value)}}</span>
                   </template>
-                  <template v-else>{{item.qykx}}</template>
+                  <template v-else>{{item.type_value}}</template>
                 </div>
               </div>
             </div>
@@ -226,16 +222,7 @@ export default defineComponent({
       })
     }
     const handleClick = (item) => {
-      let dataId = ''
-      switch (item.type_value) {
-        case 'lgszyjkscsb': dataId = `1-${item.id}`
-              break
-        case 'jgzzmgs': dataId = `2-${item.id}`
-              break
-        case 'lgsjkfzl': dataId = `3-${item.id}`
-              break
-      }
-      if (dataId === store.state.gis.gisParams.qy.feature?.getId()) {
+      if (item.dataId === store.state.gis.gisParams.qy.feature?.getId()) {
         store.state.gis.gisParams.qy.overlay.setPosition(store.state.gis.gisParams.qy.feature.getGeometry().getCoordinates())
         store.state.gis.map.getView().animate({
           center: store.state.gis.gisParams.qy.feature.getGeometry().getCoordinates(),
@@ -249,10 +236,10 @@ export default defineComponent({
             service: 'WFS',
             version: '1.0.0',
             request: 'GetFeature',
-            typename: 'mysqlGeo:lgsqy_typeValue1,mysqlGeo:lgsqy_typeValue2,mysqlGeo:lgsqy_typeValue3',
+            typename: store.state.dictionary.elementTypeList.filter(v => v.dictType === 'qy').map(v => v.geoType).join(','),
             srsName: 'EPSG:4326',
             outputFormat: 'application/json',
-            CQL_FILTER: `dataId = '${dataId}'`
+            CQL_FILTER: `dataId = '${item.dataId}'`
           }
         }).then(res => {
           const item = res.data.features?.[0]

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

@@ -39,7 +39,7 @@
       <div class="gt-tools __box-shadow">
         <template v-for="(item, index) in ToolsMapper">
           <div class="tools-line" v-if="index > 0"/>
-          <div class="tools-item __hover" :class="{active: toolsType === item.value, disabled: item.disabled}" @click="item.disabled ? undefined : toolsHandleClick(item)">
+          <div class="tools-item __hover" :class="{active: toolsType === item.value, disabled: item.disabled || (item.value === 'analysis' && toolsType === item.value)}" @click="(item.disabled || (item.value === 'analysis' && toolsType === item.value)) ? undefined : toolsHandleClick(item)">
             {{item.label}}
           </div>
         </template>

+ 22 - 11
src/views/gis/layout/tools/analysis.vue

@@ -16,7 +16,7 @@
       </div>
       <div class="__cus-buttons-3">
         <div class="__cus-button-submit __hover" @click="initData">确定</div>
-        <div class="__cus-button-cancel __hover" @click="$emit('cancel')">取消</div>
+        <div class="__cus-button-cancel __hover" @click="onCancel">取消</div>
       </div>
     </div>
     <div class="content __box-shadow" v-if="cusTransfer.result.isInit" v-loading="$store.state.gis.analysis.loading">
@@ -138,7 +138,6 @@ export default defineComponent({
           radius: 5,
           wkt: ''
         },
-        analysisFeat: <any>null,
         analysisDraw: <any>null,
         switchType: 'power',
         result: {
@@ -241,7 +240,7 @@ export default defineComponent({
           props.map.removeInteraction(state.cusTransfer.analysisDraw);
           props.map.un('pointermove', pointerMoveHandler)
           state.cusTransfer.analysisDraw = null
-          state.cusTransfer.analysisFeat = evt.feature
+          store.state.gis.analysis.feature = evt.feature
           getCircleParams(evt.feature.getGeometry())
         }
         state.cusTransfer.analysisDraw.on('drawend', drawendHandle);
@@ -270,7 +269,8 @@ export default defineComponent({
     }
     const setCircle = () => {
       const circle = turf.circle(state.cusTransfer.draw.center, state.cusTransfer.draw.radius, {steps: 32, units: 'kilometers'})
-      state.cusTransfer.analysisFeat.setGeometry(new geom.Polygon(circle.geometry.coordinates))
+      store.state.gis.analysis.feature.setGeometry(new geom.Polygon(circle.geometry.coordinates))
+      state.cusTransfer.draw.wkt = that.$easyMap.formatPosition.cpnTwpn(store.state.gis.analysis.feature.getGeometry().getCoordinates())
     }
     const initData = () => {
       state.cusTransfer.result.isInit = true
@@ -278,7 +278,7 @@ export default defineComponent({
       state.cusTransfer.result.device.pageNum = 1
       store.commit('gis/SET_GIS_ANALYSIS', {
         center: state.cusTransfer.draw.center,
-        wkt: that.$easyMap.formatPosition.cpnTwpn(state.cusTransfer.analysisFeat.getGeometry().getCoordinates())
+        wkt: state.cusTransfer.draw.wkt
       })
     }
     const powerTableFilterCpt = computed(() => {
@@ -321,24 +321,34 @@ export default defineComponent({
       }
       onSearchDevice()
     }
+    const onCancel = () => {
+      emit('cancel')
+    }
     watch(() => state.cusTransfer, () => {
       emit('update:transfer', state.cusTransfer)
     }, { deep: true })
     onMounted(() => {
-      if (props.transfer) {
-        state.cusTransfer = props.transfer
+      if (store.state.gis.gisParams.qy.analysisWKT) {
+        emit('cancel')
+        ElMessage.warning('请先关闭企业周边设备!')
       } else {
-        emit('update:transfer', state.cusTransfer)
+        if (props.transfer) {
+          state.cusTransfer = props.transfer
+        } else {
+          emit('update:transfer', state.cusTransfer)
+        }
+        state.cusTransfer.result.power.form = JSON.parse(JSON.stringify(state.cusTransfer.result.power.tempForm))
+        state.cusTransfer.result.device.form = JSON.parse(JSON.stringify(state.cusTransfer.result.device.tempForm))
+        initLayer()
       }
-      state.cusTransfer.result.power.form = JSON.parse(JSON.stringify(state.cusTransfer.result.power.tempForm))
-      state.cusTransfer.result.device.form = JSON.parse(JSON.stringify(state.cusTransfer.result.device.tempForm))
-      initLayer()
     })
     onUnmounted(() => {
+      state.cusTransfer.result.isInit = false
       store.state.gis.analysis.layer.setVisible(false)
       if (state.cusTransfer.analysisDraw) {
         props.map.removeInteraction(state.cusTransfer.analysisDraw);
       }
+      store.commit('gis/SET_GIS_ANALYSIS_RESET')
     })
     return {
       ...toRefs(state),
@@ -355,6 +365,7 @@ export default defineComponent({
       handlePageDevice,
       onSearchDevice,
       onResetDevice,
+      onCancel
     }
   },
 })

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

@@ -163,7 +163,7 @@ export default defineComponent({
             service: 'WFS',
             version: '1.0.0',
             request: 'GetFeature',
-            typename: store.getters['gis/elementActiveArr'].map(v => v.typeName).join(','),
+            typename: store.getters['gis/elementActiveArr'].map(v => store.getters['dictionary/elementTypeMapGeo'].get(v.value)).join(','),
             srsName: 'EPSG:4326',
             outputFormat: 'application/json',
             CQL_FILTER: `INTERSECTS(location, ${state.cusTransfer.selectParams.wkt})`

+ 13 - 9
src/views/gis/map-info/overlay/qy/index.vue

@@ -114,15 +114,19 @@ export default defineComponent({
       store.state.gis.gisParams.qy.analysisCircle.setGeometry(new geom.Polygon(circle.geometry.coordinates))
     }
     const onRadiusSubmit = () => {
-      if (!qyInfoCpt.value['5'].radiusTips) {
-        store.state.gis.gisParams.qy.feature.set('isAnalysis', true)
-        store.state.gis.gisParams.qy.feature.get('resetStyle')()
-        store.state.gis.gisParams.default.feature?.set('isAnalysis', true)
-        store.state.gis.gisParams.default.feature?.get('resetStyle')()
-        store.state.gis.gisParams.qy.analysisSource.clear()
-        store.state.gis.gisParams.qy.analysisSource.addFeature(store.state.gis.gisParams.qy.analysisCircle)
-        setCircle()
-        store.commit('gis/SET_GIS_PARAMS_QY_ANALYSIS')
+      if (store.state.gis.analysis.wkt) {
+        ElMessage.warning('请先关闭周边分析!')
+      } else {
+        if (!qyInfoCpt.value['5'].radiusTips) {
+          store.state.gis.gisParams.qy.feature.set('isAnalysis', true)
+          store.state.gis.gisParams.qy.feature.get('resetStyle')()
+          store.state.gis.gisParams.default.feature?.set('isAnalysis', true)
+          store.state.gis.gisParams.default.feature?.get('resetStyle')()
+          store.state.gis.gisParams.qy.analysisSource.clear()
+          store.state.gis.gisParams.qy.analysisSource.addFeature(store.state.gis.gisParams.qy.analysisCircle)
+          setCircle()
+          store.commit('gis/SET_GIS_PARAMS_QY_ANALYSIS')
+        }
       }
     }
     const onRadiusReset = () => {