派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-19 c6c504aeac112db2ee60f9af7a994a04b9fa4ed5
src/components/panel/topicSearch/EnterpriseEmergency/ResourcesQuery.vue
@@ -53,18 +53,22 @@
</template>
<script>
// wfs ajax
import WfsHelper from '@components/helpers/WfsHelper'
import AjaxUtils from '@utils/AjaxUtils'
// 图层控制选择的数据
import { LayerEmergencySource } from '../../../../conf/layers/LayerEmergencySource'
import { LayerSurroundings } from '../../../../conf/layers/LayerSurroundings'
// import { pulseEffect } from '../../../../utils/utils'
import { locate } from '../../../helpers/LocateHelper'
// 引入的方法
import { pulseEffect } from '../../../../utils/utils'
// import { locate } from '../../../helpers/LocateHelper'
// import { fitBounds, highlight, locate, openPropsPopup } from '../../../helpers/LocateHelper'
export default {
  name: 'ResourcesQuery',
  data () {
    return {
      // form 表单绑定数据
      form: {
        eventName: '',
        pipelineType: LayerEmergencySource.name,
@@ -75,11 +79,16 @@
          { name: '南京化学' }
        ]
      },
      // 搜索到的数据绑定的active的样式
      activeNum: -1,
      // 搜索到的数据进行存储的list
      list: [],
      // form表单绑定的图层数据
      items: [LayerEmergencySource, LayerSurroundings],
      subItems: LayerEmergencySource.layers || LayerSurroundings.layers,
      // wfs
      WfsHelper: null,
      // 应急 || 周边 的区分绑定数据
      changeAmount: '资源'
    }
  },
@@ -87,11 +96,13 @@
    this.wfsHelper = new WfsHelper()
  },
  methods: {
    // 搜索展示图片根据返回值展示
    getImgSrc (type) {
      // console.log(type)
      // const icon = this.form.dataType.icon
      return 'assets/images/map/sewers/' + type + '.png'
    },
    // form 表单选择数据数据选择分配
    handlePipelineType (val) {
      // console.log(val)
      this.list = []
@@ -110,10 +121,12 @@
        this.changeAmount = '环境'
      }
    },
    // 二级from表单选择数据清空 已有展示数据
    handleDataType (val) {
      // console.log(val)
      this.list = []
    },
    // 点击搜索事件
    async handleSearch () {
      this.list = []
      this.wfsHelper.clearFilter()
@@ -136,13 +149,13 @@
    },
    // 查询定位功能
    handleLocation (val, index) {
      console.log(val)
      // console.log(val)
      this.activeNum = index
      const config = this.form.dataType
      locate(val, config)
      // const positionArea = [val.properties.y, val.properties.x]
      // window.map.setView(positionArea, 17)
      // pulseEffect(positionArea)
      const positionArea = [val.properties.y, val.properties.x]
      window.map.setView(positionArea, 17)
      pulseEffect(positionArea)
      // const config = this.form.dataType
      // locate(val, config)
      // fitBounds(val, this.form.dataType.code)
      // highlight(val, this.form.dataType)
    }