From 4783886d2dd9ca05bca014f2aad2a409e4ae33b5 Mon Sep 17 00:00:00 2001 From: chenzeping <ChenZeping02609@163.com> Date: 星期三, 31 三月 2021 16:20:30 +0800 Subject: [PATCH] 公共弹框表格修改 --- src/components/BaseNav/WasteWater/WasteWater.js | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/components/BaseNav/WasteWater/WasteWater.js b/src/components/BaseNav/WasteWater/WasteWater.js index af1d4fb..05f7b50 100644 --- a/src/components/BaseNav/WasteWater/WasteWater.js +++ b/src/components/BaseNav/WasteWater/WasteWater.js @@ -16,9 +16,10 @@ } // 璇锋眰鏁版嵁 data 涓哄弬鏁帮紝 璇锋眰鍚庡彴鏁版嵁鏃� 鎼哄甫data鍙傛暟 - requestData () { - requestWasteWater().then(res => { - this.DrawTheWasteWaterContent(res.Result.DataInfo) + requestData (data) { + requestWasteWater(data).then(res => { + console.log(res) + this.DrawWasteWaterContent(res.Result.DataInfo) // console.log(res) }).catch(err => { console.log(err) @@ -26,7 +27,7 @@ } // 鏍规嵁鑾峰彇鏁版嵁 鐢诲嚭 鍐呭 - DrawTheWasteWaterContent (data) { + DrawWasteWaterContent (data) { // 鍥炬爣鏍峰紡鎵╁睍 const WasteWaterIcon = this.WasteWaterIcon() @@ -36,8 +37,8 @@ } for (let i = 0; i < data.length; i++) { // 缁忕含搴� 浣嶇疆 - const positionX = data[i].positionX - const positionY = data[i].positionY + const positionX = data[i].Latitude + const positionY = data[i].Longitude // 鍒ゆ柇 缁忕含搴︿綅缃俊鎭槸鍚﹀瓨鍦� // if (positionX != null && positionY != null) { @@ -51,18 +52,19 @@ const Icon = new WasteWaterIcon({ iconUrl: iconUrl }) // let url = Icon.options.iconUrl - const marker = this.L.marker.magic([positionX, positionY], { icon: Icon, magic: 'vanishIn' }) + // const marker = this.L.marker.magic([positionX, positionY], { icon: Icon, magic: 'vanishIn' }) // 甯︽樉绀哄姩鐢� + const marker = this.L.marker([positionX, positionY], { icon: Icon }) - marker.bindPopup(() => { - return this.WasteWaterPopup.$el - }, { - className: 's-map-popup', - minWidth: 1000, - closeButton: true, - autoClose: false - }) + // marker.bindPopup(() => { + // return this.WasteWaterPopup.$el + // }, { + // className: 's-map-popup', + // minWidth: 1000, + // closeButton: true, + // autoClose: false + // }) // 鍒掕繃鍑虹幇 灞曠ず鏁版嵁 - marker.bindTooltip(data[i].StoragePlaceName, { + marker.bindTooltip(data[i].Name, { permanent: true, offset: [0, -16], direction: 'top', @@ -73,7 +75,8 @@ try { // console.log(e) this.EffectOfPulse(e.target.getLatLng()) - this.WasteWaterPopup.setDate(data[i]) + this.WasteWaterPopup.setData(data[i]) + return this.WasteWaterPopup.$el } catch (error) { console.log(error) } -- Gitblit v1.8.0