派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-13 223558670632644a19aa4fb0238100708fca3ab7
src/components/panel/topicSearch/SewersSearch.vue
@@ -32,14 +32,14 @@
            </div>
          </el-form>
        </div>
        <el-scrollbar style="height:380.44px;">
        <el-scrollbar style="height:413px;">
          <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" :class="activeNum==index?'hover':''">
            <img class="state" :src="getImgSrc()" style="background: none"/>
            <div>
              <h3 @click="handleLocation(item,index)">{{ item.properties.pipename }}</h3>
              <p>所属企业:<span>{{ item.properties.orgcode }}</span>
              <p>设施类型:<span>{{ item.properties.teetype }}</span>
              <!--  <el-button v-if="fuShuSheShiShow" class="rt" size="mini" style="margin-right: 0.04rem" @click="btnAffiliatedFacilities(item)" >附属设施</el-button> -->
               <el-button v-if="fuShuSheShiShow" class="rt btn00fff6" size="mini" style="margin-right: 0.04rem;" @click="btnAffiliatedFacilities(item,index)" >附属设施</el-button>
              </p>
            </div>
          </div>
@@ -51,7 +51,6 @@
              :page-size=pageSize
              layout="prev, pager, next"
              :total=total
              :current-page=current
              class="warnPagination"
          >
          </el-pagination>
@@ -65,7 +64,7 @@
      </el-tab-pane>
    </el-tabs>
    <!-- 附属设施面板 -->
    <affiliated-facilities :facilitiesParameter="facilitiesParameter" :fuShuSheShiSubItems="fuShuSheShiSubItems" ></affiliated-facilities>
    <affiliated-facilities :facilitiesParameter="facilitiesParameter"  v-if="fuShuSheShiShow" ></affiliated-facilities>
  </div>
</template>
@@ -99,9 +98,10 @@
      list: [],
      items: [LayerPipeLines, LayerFsss, LayerHbss, LayerPk, LayerArea],
      subItems: LayerPipeLines.layers,
      pageSize: 10,
      total: 0,
      form: {
        pipelineType: '管网',
        pipelineType: '管线',
        dataType: '',
        keyword: ''
      },
@@ -110,9 +110,10 @@
      isWaybillHover: true,
      isRouteHover: false,
      facilitiesParameter: null,
      //  fuShuSheShiShow: false,
      activeNum: -1
      fuShuSheShiShow: true,
      fuShuSheShiPanelShow: true,
      activeNum: -1,
      wfsHelper: null
    }
  },
  props: ['title'],
@@ -123,6 +124,10 @@
    },
    handleClick (tab, event) {
      console.log(tab, event)
    },
    handlePage (page) {
      this.wfsHelper.setPage(page)
      this.handleSearch()
    },
    // 设施类型筛选
    handlePipelineType (val) {
@@ -142,34 +147,40 @@
    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(val)
      // console.log(val)
      this.activeNum = index
      this.facilitiesParameter = val
      // layer && layer.openPopup()
      window.layerFactory.flyByFeature(val, this.form.dataType.code)
    },
    btnAffiliatedFacilities (val, index) {
      this.activeNum = index
      this.facilitiesParameter = val
      // 判断选择是否是管线,如果是则显示《附属设施》弹框
      /* if (this.form.pipelineType === '管线') {
        for (let i = 0; i < this.items.length; i++) {
          const item = this.items[i]
          if (item.name === '附属设施') {
            this.fuShuSheShiSubItems = item.layers
            // console.log(this.fuShuSheShiSubItems)
          }
        }
      } */
      if (this.form.pipelineType === '管线') {
        this.fuShuSheShiShow = true
      } else {
        this.fuShuSheShiShow = false
      }
      window.layerFactory.flyByFeature(val, this.form.dataType.code)
    }
  },
  mounted () {
    this.wfsHelper = new WfsHelper()
  }
}
</script>