From dd9af28934e9b34f74a58cf3f92a472b898d738e Mon Sep 17 00:00:00 2001 From: seatonwan9 <seatonwan9@163.com> Date: 星期五, 28 五月 2021 19:39:51 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue new file mode 100644 index 0000000..ba23015 --- /dev/null +++ b/src/components/base-page/enterprise-emergency/events-reported/ReportLocationSearch.vue @@ -0,0 +1,82 @@ +<template> + <div class="click-location"> + <el-row> + <el-input type="text" v-model="clickLocation" clearable @change="focusLocation"></el-input> + </el-row> + <el-row> + <el-button type="primary" @click="confirm" style="text-align: right">纭</el-button> + </el-row> + </div> +</template> + +<script> + +import { reportLocationSearch } from '../../../../api/request' +import { pulseEffect } from '../../../../utils/utils' +export default { + name: 'ReportLocationSearch', + data () { + return { + // 鐐瑰嚮瀹氫綅缁戝畾鏁版嵁 + clickLocation: '' + } + }, + methods: { + // 鑾峰緱鐒︾偣 杩涜瀹氫綅 + focusLocation () { + // console.log(this.clickLocation) + // console.log(window.map.getZoom()) + // console.log(window.map.getBounds()) + const getBoundsData = '' + window.map.getBounds()._southWest.lng + ',' + window.map.getBounds()._southWest.lat + ',' + window.map.getBounds()._northEast.lng + ',' + window.map.getBounds()._northEast.lat + const data = { + postStr: { + keyWord: this.clickLocation, + level: window.map.getZoom(), + mapBound: getBoundsData, + queryType: 7, + count: 14, + start: 0, + queryTerminal: 10000 + }, + type: 'query' + } + // console.log(data) + reportLocationSearch(data).then(res => { + console.log(res) + // const as = res.pois[0].lonlat.trim().split(' ') + // window.map.setView([as[1], as[0]], 17) + // pulseEffect([as[1], as[0]]) + for (let i = 0; i < res.pois.length; i++) { + const as = res.pois[i].lonlat.trim().split(' ') + if (res.pois[i].name.indexOf(this.clickLocation) >= 0) { + window.map.setView([as[1], as[0]], 17) + pulseEffect([as[1], as[0]]) + } + } + }) + }, + // 鐐瑰嚮纭鎸夐挳浜嬩欢 + confirm () { + // 閫氳繃瀛愮粍浠跺悜鐖剁粍浠朵紶閫掓暟鎹� + this.$emit('locationClick', this.LongLatPos) + console.log('鎼滅储瀹氫綅') + } + } +} +</script> + +<style lang="less" scoped> + .click-location { + margin: 0 auto; + text-align: center; + + .el-input { + width: 80%; + margin: 15px auto; + } + + .el-button { + margin: 15px auto; + } + } +</style> -- Gitblit v1.8.0