派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-18 3b1b5623e44135a8e693698cb7a30adf66d86964
src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue
@@ -43,8 +43,8 @@
            <div class="environmental-risk-list" v-for="(item,index) in list" :key="index"
                 :class="activeNum===index?'hover':''" @click="handleLocation(item,index)">
                <img class="state" :src="getImgSrc(item.properties.type)" style="background: none"/>
                <h3>资源类型:{{item.properties.adminzonename}}</h3>
                <h5>资源名称:{{item.properties.type}}</h5>
                <h3>{{changeAmount}}类型:{{item.properties.type}}</h3>
                <h5>{{changeAmount}}名称:{{item.properties.name}}</h5>
                <p>负责人:<span>{{item.properties.resperson}}</span></p>
                <p>电话:<span>{{item.properties.telephone}}</span></p>
            </div>
@@ -55,11 +55,11 @@
<script>
import WfsHelper from '@components/helpers/WfsHelper'
import AjaxUtils from '@utils/AjaxUtils'
// import { LayerEmergency } from '../../../../../conf/LayerEmergency'
import { LayerEmergencySource } from '../../../../conf/layers/LayerEmergencySource'
import { LayerSurroundings } from '../../../../conf/layers/LayerSurroundings'
import AnimalService from '../../../../components/LayerController/service/AnimalService'
import { pulseEffect } from '../../../../utils/utils'
import { openPopup } from '../../../helpers/LocateHelper'
// import { fitBounds, highlight } from '../../../helpers/LocateHelper'
export default {
  name: 'ResourcesQuery',
@@ -79,7 +79,8 @@
      list: [],
      items: [LayerEmergencySource, LayerSurroundings],
      subItems: LayerEmergencySource.layers || LayerSurroundings.layers,
      WfsHelper: null
      WfsHelper: null,
      changeAmount: '资源'
    }
  },
  mounted () {
@@ -103,8 +104,10 @@
      }
      if (this.form.pipelineType === '应急资源') {
        this.subItems = LayerEmergencySource.layers
        this.changeAmount = '资源'
      } else if (this.form.pipelineType === '周边环境') {
        this.subItems = LayerSurroundings.layers
        this.changeAmount = '环境'
      }
    },
    handleDataType (val) {
@@ -126,17 +129,21 @@
        this.wfsHelper.addLike('name', this.form.keyword)
      }
      const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
      // console.log(res)
      if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
        this.list = res.features
      }
    },
    // 查询定位功能
    handleLocation (val, index) {
      // console.log(val)
      this.activeNum = index
      window.map.setView([val.properties.y, val.properties.x], 16)
      this.animalService = new AnimalService({
        L: window.L,
        layer: window.layer
      })
      const positionArea = [val.properties.y, val.properties.x]
      window.map.setView(positionArea, 17)
      pulseEffect(positionArea)
      openPopup(positionArea, val.id)
      // fitBounds(val, this.form.dataType.code)
      // highlight(val, this.form.dataType)
    }
  }
}