From 945d71b3bc4b42e28cdca08ce7acf59e45923308 Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期五, 16 四月 2021 14:38:08 +0800
Subject: [PATCH] 弹框组件
---
src/components/LayerController/logic/WasteWater.js | 43 +++++++++++++++++++++++++++++++++++--------
1 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js
index 0be9e1a..2ed9ee0 100644
--- a/src/components/LayerController/logic/WasteWater.js
+++ b/src/components/LayerController/logic/WasteWater.js
@@ -6,10 +6,10 @@
// 寮圭獥鏁版嵁寮曡繘
const publicBounced = require('../../BaseNav/PublicBounced/PublicBounced').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' // 棰勮闂儊
@@ -33,18 +33,20 @@
// 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁鐨勪笉鍚�
const testValue = data[i].ContrLevel
const iconUrl = this.differentTypes(testValue)
- const marker = L.marker.magic([positionX, positionY], {
+ const marker = L.marker([positionX, positionY], {
test: data[i],
icon: L.icon({
iconUrl: iconUrl,
- iconSize: [50, 50],
- iconAnchor: [25, 25]
+ iconSize: [35, 35],
+ iconAnchor: [18, 18]
})
})
layer.addLayer(marker)
}
}
+ // 鍒嗗壊绾�-------------------------------------------------------------------------------
+ // this.
this.bindTooltip = (layer) => {
return layer.options.test.Name
}
@@ -55,13 +57,31 @@
const dataValue = {
StoragePlaceId: e.layer.options.test.StoragePlaceId
}
- const result = await mapApi.getWasteWater(dataValue)
- // console.log(result)
+ const hourValue = {
+ onLineMonEmissPointId: '23',
+ monItemId: '28,31',
+ beginTime: '2020-04-06 15:13:20',
+ endTime: '2020-04-07 15:13:20',
+ dataType: '2'
+ }
+ const dateValue = {
+ onLineMonEmissPointId: '23',
+ monItemId: '28,31',
+ beginTime: '2020-04-06',
+ endTime: '2020-04-07',
+ dataType: '1'
+ }
+ const detailData = await mapApi.getWasteWaterMonitoringDetails(dataValue) // 鏄庣粏琛ㄨ繑鍥炴暟鎹�
+ const hourData = await mapApi.getQueryOnlineMonData(hourValue) // 灏忔椂鏁版嵁
+ const dateData = await mapApi.getQueryOnlineMonData(dateValue) // 鏃ユ暟鎹�
+ // const drawback = await mapApi.getWasteWaterMonitoring()
const PublicBounced = window.Vue.extend(publicBounced)
const instance = new PublicBounced()
- instance.setGasData(result, 'feishui')
+ instance.setWaterData(e.layer.options.test, detailData.Result.DataInfo, hourData.Result.DataInfo, dateData.Result.DataInfo, 'feishui')
+ // console.log(e.layer.options.test)
instance.$mount()
document.body.appendChild(instance.$el)
+ this.setPanTo(e.latlng, 80)
}
// 鏍规嵁杩斿洖鍊肩殑涓嶅悓鏍囪涓嶅悓鍥剧墖
@@ -95,4 +115,11 @@
}
return testChange
}
+ 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