From 4d265afb3419bd5cedc6f31ab78d570f6917b520 Mon Sep 17 00:00:00 2001 From: seatonwan9 <seatonwan9@163.com> Date: 星期五, 21 五月 2021 14:30:44 +0800 Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop --- src/components/LayerController/logic/WasteWater.js | 51 +++++++++++++++++++++++++++++---------------------- 1 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js index 16c4f17..6203258 100644 --- a/src/components/LayerController/logic/WasteWater.js +++ b/src/components/LayerController/logic/WasteWater.js @@ -1,15 +1,19 @@ /** * 搴熸按 */ + +// 鍏叡鏂规硶 panTo() 寮曠敤 +const { setPanTo } = require('../../../utils/utils') + const AnimalService = require('../service/AnimalService').default const mapApi = require('../../../api/mapApi').default // 寮圭獥鏁版嵁寮曡繘 -const publicBounced = require('../../BaseNav/PublicBounced/PublicBounced').default +const WasteWaterIndex = require('@components/BaseNav/WasteWater/WasteWaterIndex').default -const NormalImg = '/assets/images/map/wastewater/fs_green.png' // 姝e父 +const NormalImg = '/assets/images/map/wastewater/fs_bright_green.png' // 姝e父 const OffImg = '/assets/images/map/wastewater/fs_gray.png' // 鍋滆繍 const AbnormalImg = '/assets/images/map/wastewater/fs_blue.png' // 寮傚父 -const MissImg = '/assets/images/map/wastewater/fs_yellow.png' // 缂哄け +const MissImg = '/assets/images/map/wastewater/fs_bright_green.png' // 缂哄け const AlarmImg = '/assets/images/map/wastewater/fs_red.png' // 鎶ヨ闂儊 const WarnImg = '/assets/images/map/wastewater/fs_orange.png' // 棰勮闂儊 @@ -24,9 +28,7 @@ layer: layer }) const res = await mapApi.getWasteWater() - console.log(res) - const data = res.Result.DataInfo - console.log(data) + const data = res.Result.DataInfo || {} for (let i = 0; i < data.length; i++) { // 缁忕含搴� 浣嶇疆 const positionX = data[i].Latitude @@ -35,12 +37,12 @@ // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁鐨勪笉鍚� const testValue = data[i].ContrLevel const iconUrl = this.differentTypes(testValue) - const marker = L.marker.magic([positionX, positionY], { - test: data[i], + const marker = L.marker([positionX, positionY], { + totransferData: data[i], icon: L.icon({ iconUrl: iconUrl, - iconSize: [50, 50], - iconAnchor: [25, 25] + iconSize: [35, 35], + iconAnchor: [15, 15] }) }) layer.addLayer(marker) @@ -48,21 +50,26 @@ } this.bindTooltip = (layer) => { - return layer.options.test.Name + return '<div class="company-bindTooltip-hover"><h3>澶╂触鐭冲寲</h3></div>' + layer.options.totransferData.Name } - this.clickListener = async (e) => { - // console.log(e) + this.clickListener = (e) => { this.animalService.pulseEffect(e.latlng) - const dataValue = { - StoragePlaceId: e.layer.options.test.StoragePlaceId - } - const result = await mapApi.getWasteWater(dataValue) - const PublicBounced = window.Vue.extend(publicBounced) - const instance = new PublicBounced() - instance.setData(result) - instance.$mount() - document.body.appendChild(instance.$el) + setPanTo(e.latlng, 200) + // 寮规鏍囬 + const title = e.layer.options.totransferData.Name + const res = e.layer.options.totransferData + window.$layer.open({ + content: { + comp: WasteWaterIndex, // 缁勪欢 + parent: this, // 鐖剁粍浠� + data: { // 浼犻�掔殑鍙傛暟 + // info: this.info + storagePlaceId: res + } + }, + title: '澶╂触鐭冲寲' + title // 鏍囬 + }) } // 鏍规嵁杩斿洖鍊肩殑涓嶅悓鏍囪涓嶅悓鍥剧墖 -- Gitblit v1.8.0