派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-17 a2cf1dafa47139ef92135376db24ece72d2b51d2
src/components/panel/topicSearch/SewersSearch.vue
@@ -51,7 +51,6 @@
              :page-size=pageSize
              layout="prev, pager, next"
              :total=total
              :current-page=current
              class="warnPagination"
          >
          </el-pagination>
@@ -84,6 +83,7 @@
// 引入组件内容
import SewersAnalysis from '@components/panel/topicSearch/SewersSelect/SewersAnalysis'
import SewersHistory from '@components/panel/topicSearch/SewersSelect/SewersHistory'
import { fitBounds, highlight } from '../../helpers/LocateHelper'
export default {
  name: 'SewersSearch',
@@ -99,6 +99,7 @@
      list: [],
      items: [LayerPipeLines, LayerFsss, LayerHbss, LayerPk, LayerArea],
      subItems: LayerPipeLines.layers,
      pageSize: 10,
      total: 0,
      form: {
        pipelineType: '管线',
@@ -112,7 +113,8 @@
      facilitiesParameter: null,
      fuShuSheShiShow: true,
      fuShuSheShiPanelShow: true,
      activeNum: -1
      activeNum: -1,
      wfsHelper: null
    }
  },
  props: ['title'],
@@ -123,6 +125,10 @@
    },
    handleClick (tab, event) {
      console.log(tab, event)
    },
    handlePage (page) {
      this.wfsHelper.setPage(page)
      this.handleSearch()
    },
    // 设施类型筛选
    handlePipelineType (val) {
@@ -142,21 +148,26 @@
    async handleSearch () {
      // console.log(this.form.dataType.sname, this.form.keyword)
      this.list = []
      var wfsHelper = new WfsHelper()
      this.wfsHelper.clearFilter()
      // todo 现在管网还没区分开类型,后面改
      wfsHelper.addTypeName(this.form.dataType.sname)
      wfsHelper.addLike('name', this.form.keyword)
      this.wfsHelper.setTypeName([this.form.dataType.typeName])
      if (this.form.keyword) {
        this.wfsHelper.addLike('name', this.form.keyword)
      }
      // const _this = this
      const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {})
      console.log(res)
      const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {})
      if (res instanceof Object && Object.prototype.hasOwnProperty.call(res, 'features')) {
        this.total = res.totalFeatures
        this.list = res.features
      }
    },
    handleLocation (val, index) {
      console.log(this.form.dataType)
      // console.log(val)
      this.activeNum = index
      // layer && layer.openPopup()
      window.layerFactory.flyByFeature(val, this.form.dataType.code)
      fitBounds(val, this.form.dataType.code)
      highlight(val, this.form.dataType)
    },
    btnAffiliatedFacilities (val, index) {
      this.activeNum = index
@@ -167,8 +178,12 @@
      } else {
        this.fuShuSheShiShow = false
      }
      window.layerFactory.flyByFeature(val, this.form.dataType.code)
      fitBounds(val, this.form.dataType.code)
      highlight(val)
    }
  },
  mounted () {
    this.wfsHelper = new WfsHelper()
  }
}
</script>