From 1da76d05ebba28eeebef8af3832680143d5699c5 Mon Sep 17 00:00:00 2001 From: seatonwan9 <seatonwan9@163.com> Date: 星期一, 31 五月 2021 17:12:37 +0800 Subject: [PATCH] 查询条件补充,治理设施优化 --- src/components/LayerController/logic/WasteSolid.js | 51 ++++++++++++++++++--------------------------------- 1 files changed, 18 insertions(+), 33 deletions(-) diff --git a/src/components/LayerController/logic/WasteSolid.js b/src/components/LayerController/logic/WasteSolid.js index 977eaac..8bc83f9 100644 --- a/src/components/LayerController/logic/WasteSolid.js +++ b/src/components/LayerController/logic/WasteSolid.js @@ -1,11 +1,12 @@ /** * 鍥哄簾 */ -const WasteSolidIndex = require('@components/BaseNav/WasteSolid/WasteSolidIndex').default +const WasteSolidIndex = require('../../../components/base-page/WasteSolid/WasteSolidIndex.vue').default // 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img const defaultImg = '/assets/images/map/solidwaste/voc.png' const setting = '/assets/images/map/solidwaste/gf_green2.png' - +// 鍏叡鏂规硶 panTo() 寮曠敤 +const { setPanTo } = require('../../../utils/utils') // 璇锋眰鎺ュ彛鏁版嵁 const mapApi = require('../../../api/mapApi').default // 浣跨敤灏佽鏂规硶 @@ -46,14 +47,27 @@ } this.bindTooltip = (layer) => { + // '<div class="company-bindTooltip-hover"><h3>澶╂触鐭冲寲</h3></div>' + return layer.options.totransferData.Name } this.clickListener = (e) => { // 鐐瑰嚮marker鐨刾ulse()鍏夋尝 this.animalService.pulseEffect(e.latlng) - /* 鐐瑰嚮鏁版嵁鐨勬帴鍙h姹� */ - this.requestSolidWasteData(e).then(e) + /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */ + setPanTo(e.latlng, 200) + // 寮规鏍囬 + const title = e.layer.options.totransferData.Name + window.$layer.open({ + content: { + comp: WasteSolidIndex, // 缁勪欢 + parent: this, // 鐖剁粍浠� + data: { // 浼犻�掔殑鍙傛暟 + storagePlaceId: e.layer.options.totransferData.StoragePlaceId + } + }, + title: title // 鏍囬 + }) } // 涓嶅悓绫诲瀷鍥剧墖灏佽 @@ -65,34 +79,5 @@ effectOfChange = setting } return effectOfChange - } - - // 鏍规嵁鐐瑰嚮涓嶅悓鏁版嵁 杩涜鎺ュ彛鐨勬暟鎹姹� - this.requestSolidWasteData = async (e) => { - // 寮规鏍囬 - const title = e.layer.options.totransferData.Name - /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */ - this.setPanTo(e.latlng, 300) - - // console.log(e.layer.options.totransferData.StoragePlaceId) - window.$layer.open({ - content: { - content: WasteSolidIndex, // 缁勪欢 - parent: this, // 鐖剁粍浠� - data: { // 浼犻�掔殑鍙傛暟 - storagePlaceId: e.layer.options.totransferData.StoragePlaceId - } - }, - title: title // 鏍囬 - }) - } - - // flayTo() 寮规鐨勫彲婊戝姩浜嬩欢 - this.setPanTo = (pos, value) => { - var position = pos - position = window.map.latLngToLayerPoint(position) - position.y += value - position = window.map.layerPointToLatLng(position) - window.map.flyTo(position) } } -- Gitblit v1.8.0