派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-13 d610d8743c112be221399d18c14a93fb956cd6d2
src/components/panel/topicSearch/SewersSelect/EnterpriseEmergency/ResourcesQuery.vue
@@ -89,7 +89,16 @@
      const icon = this.form.dataType.icon
      return icon ? 'assets/images/map/' + icon : ''
    },
    handlePipelineType () {
    handlePipelineType (val) {
      console.log(val)
      this.list = []
      for (let i = 0; i < this.items.length; i++) {
        const item = this.items[i].name
        if (val === item.name) {
          this.subItems = item
          return
        }
      }
      // console.log('item')
      if (this.form.pipelineType === '应急资源') {
        this.form.pipelineType = '资源类型'
@@ -98,8 +107,9 @@
        this.subItems = this.subItemsT
      }
    },
    handleDataType () {
      console.log('item')
    handleDataType (val) {
      console.log(val)
      this.list = []
    },
    async handleSearch () {
      this.list = []
@@ -107,25 +117,30 @@
      // todo 现在企业应急还没区分开类型,后面改
      // this.wfsHelper.setTypeName([this.form.dataType.typeName])
      this.wfsHelper.setTypeName(['sewer:emergency'])
      if (this.form.dataType) {
        if (this.form.dataType === '全部环境' || this.form.dataType === '全部资源' || this.form.dataType === '') {
        } else {
          this.wfsHelper.addEquals('type', '\'' + this.form.dataType + '\'')
        }
      }
      if (this.form.keyword) {
        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
      // layer && layer.openPopup()
      // window.layerFactory.flyByFeature(val, this.form.dataType.code)
      window.map.flyTo([val.properties.y, val.properties.x], 15)
    }
  }
}
</script>
<style scoped>
<style lang="less" scoped>
</style>