From 90bd1d10df12f458eb2e64e8de2b225f45d02153 Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期三, 14 四月 2021 17:34:08 +0800
Subject: [PATCH] 管网、环保设施、附属设施搜索定位

---
 src/components/panel/topicSearch/GasWasteSearch.vue |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/src/components/panel/topicSearch/GasWasteSearch.vue b/src/components/panel/topicSearch/GasWasteSearch.vue
index c852889..1e0ac3b 100644
--- a/src/components/panel/topicSearch/GasWasteSearch.vue
+++ b/src/components/panel/topicSearch/GasWasteSearch.vue
@@ -64,7 +64,7 @@
       </el-form>
     </div>
     <el-scrollbar style="height:264px">
-      <div class="environmental-risk-list" ><!-- v-for="(item,index) in list" :key="index" -->
+      <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" @click="handleLocation(item)"><!--  -->
         <i class="state"></i>
         <div>
           <h3>###鐐煎寲閮�</h3>
@@ -97,24 +97,15 @@
 </template>
 
 <script>
-<<<<<<< HEAD
-import WfsHelper from '@components/helpers/WfsHelper'
-import AjaxUtils from '@utils/AjaxUtils'
-=======
 import mapApi from '@/api/mapApi'
 
 // import WfsHelper from '@components/helpers/WfsHelper'
->>>>>>> d838248f54e3bcacf9c2a54f7dc692525af3c051
 export default {
   name: 'GasWasteSearch',
   data () {
     return {
       gdVisible: true,
       list: [],
-<<<<<<< HEAD
-=======
-      // labelList: PipelineTypeOptions[0].labelList,
->>>>>>> d838248f54e3bcacf9c2a54f7dc692525af3c051
       total: 0,
       inareaTypeOptions: [],
       enterpriseTypeOptions: [],
@@ -174,16 +165,15 @@
       // const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {})
       const res = await mapApi.getWasteGas()
       console.log(res)
-      if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) {
-        this.list = res.data.features
-      }
+      this.list = res.Result.DataInfo
+      // if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) {
+      //   this.list = res.data.features
+      // }
     },
     handleLocation (val) {
       console.log(val)
-      const bound = this.L.geoJSON([val], {}).getBounds()
-      var layer = window.serviceLayerHelper.getByLayerId(val.id)
-      layer && layer.openPopup()
-      this.$store.state.map.map.flyToBounds(bound)
+      const pos = [val.Latitude, val.Longitude]
+      window.map.flyTo(pos, 17)
     }
   }
 }

--
Gitblit v1.8.0