From 90bd1d10df12f458eb2e64e8de2b225f45d02153 Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期三, 14 四月 2021 17:34:08 +0800
Subject: [PATCH] 管网、环保设施、附属设施搜索定位
---
src/components/panel/topicSearch/GasWasteSearch.vue | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/components/panel/topicSearch/GasWasteSearch.vue b/src/components/panel/topicSearch/GasWasteSearch.vue
index 80c2f12..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,17 +97,15 @@
</template>
<script>
-import { PipelineTypeOptions } from '@/conf/layers/LayerSewers'
+import mapApi from '@/api/mapApi'
-import WfsHelper from '@components/helpers/WfsHelper'
-import AjaxUtils from '@utils/AjaxUtils'
+// import WfsHelper from '@components/helpers/WfsHelper'
export default {
name: 'GasWasteSearch',
data () {
return {
gdVisible: true,
list: [],
- labelList: PipelineTypeOptions[0].labelList,
total: 0,
inareaTypeOptions: [],
enterpriseTypeOptions: [],
@@ -160,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