派生自 wuyushui/SewerAndRainNetwork

zhangshuaibao
2021-04-14 e6ac09332e92782446152e1ba0e031196272edd1
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>
@@ -165,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)
    }
  }
}