From ba4563c1fb843035e863ab5f170d950d9b8e1aaf Mon Sep 17 00:00:00 2001 From: chenzeping <ChenZeping02609@163.com> Date: 星期三, 14 四月 2021 15:54:21 +0800 Subject: [PATCH] 右侧管理查询定位 --- src/components/panel/topicSearch/GasWasteSearch.vue | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/panel/topicSearch/GasWasteSearch.vue b/src/components/panel/topicSearch/GasWasteSearch.vue index b95c164..1e0ac3b 100644 --- a/src/components/panel/topicSearch/GasWasteSearch.vue +++ b/src/components/panel/topicSearch/GasWasteSearch.vue @@ -64,7 +64,7 @@ </el-form> </div> <el-scrollbar style="height:264px"> - <div class="environmental-risk-list" ><!-- v-for="(item,index) in list" :key="index" --> + <div class="environmental-risk-list" v-for="(item,index) in list" :key="index" @click="handleLocation(item)"><!-- --> <i class="state"></i> <div> <h3>###鐐煎寲閮�</h3> @@ -97,8 +97,9 @@ </template> <script> -import WfsHelper from '@components/helpers/WfsHelper' -import AjaxUtils from '@utils/AjaxUtils' +import mapApi from '@/api/mapApi' + +// import WfsHelper from '@components/helpers/WfsHelper' export default { name: 'GasWasteSearch', data () { @@ -157,21 +158,22 @@ dataType: this.form.dataType } console.log(param) - var wfsHelper = new WfsHelper() - wfsHelper.addTypeName(this.form.query.layerName) - wfsHelper.addLike(this.form.query.key, this.form.keyword) + // var wfsHelper = new WfsHelper() + // wfsHelper.addTypeName(this.form.query.layerName) + // wfsHelper.addLike(this.form.query.key, this.form.keyword) // const _this = this - const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {}) - if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) { - this.list = res.data.features - } + // const res = await AjaxUtils.GetDataAsynByUrl(wfsHelper.getUrl(), {}) + const res = await mapApi.getWasteGas() + console.log(res) + this.list = res.Result.DataInfo + // if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) { + // this.list = res.data.features + // } }, handleLocation (val) { console.log(val) - const bound = this.L.geoJSON([val], {}).getBounds() - var layer = window.serviceLayerHelper.getByLayerId(val.id) - layer && layer.openPopup() - this.$store.state.map.map.flyToBounds(bound) + const pos = [val.Latitude, val.Longitude] + window.map.flyTo(pos, 17) } } } -- Gitblit v1.8.0