From 3b1b5623e44135a8e693698cb7a30adf66d86964 Mon Sep 17 00:00:00 2001 From: 陈泽平 <chenzeping> Date: 星期二, 18 五月 2021 15:42:33 +0800 Subject: [PATCH] 管线问题修改 --- src/components/panel/topicSearch/SewersSearch.vue | 46 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/components/panel/topicSearch/SewersSearch.vue b/src/components/panel/topicSearch/SewersSearch.vue index f667fe9..8c40d1c 100644 --- a/src/components/panel/topicSearch/SewersSearch.vue +++ b/src/components/panel/topicSearch/SewersSearch.vue @@ -33,13 +33,16 @@ </el-form> </div> <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 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 btn00fff6" size="mini" style="margin-right: 0.04rem;" @click="btnAffiliatedFacilities(item,index)" >闄勫睘璁炬柦</el-button> + <p>鎵�灞炰紒涓氾細<span>{{ item.properties.orgname }}</span> + <p>璁炬柦绫诲瀷锛�<span>{{ item.properties.linenumtype }}</span> + <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 +54,6 @@ :page-size=pageSize layout="prev, pager, next" :total=total - :current-page=current class="warnPagination" > </el-pagination> @@ -84,6 +86,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 +102,7 @@ list: [], items: [LayerPipeLines, LayerFsss, LayerHbss, LayerPk, LayerArea], subItems: LayerPipeLines.layers, + pageSize: 10, total: 0, form: { pipelineType: '绠$嚎', @@ -112,7 +116,8 @@ facilitiesParameter: null, fuShuSheShiShow: true, fuShuSheShiPanelShow: true, - activeNum: -1 + activeNum: -1, + wfsHelper: null } }, props: ['title'], @@ -124,10 +129,13 @@ handleClick (tab, event) { console.log(tab, event) }, + handlePage (page) { + this.wfsHelper.setPage(page) + this.handleSearch() + }, // 璁炬柦绫诲瀷绛涢�� handlePipelineType (val) { this.list = [] - // debugger for (let i = 0; i < this.items.length; i++) { const item = this.items[i] if (val === item.name) { @@ -142,21 +150,27 @@ 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(), {}) + const res = await AjaxUtils.GetDataAsynByUrl(this.wfsHelper.getUrl(), {}) console.log(res) 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 +181,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> -- Gitblit v1.8.0