From 93a9b3228d214602a899791992726a01925c5ac4 Mon Sep 17 00:00:00 2001
From: ChenZeping02609 <chenzeping02609@163.com>
Date: 星期四, 13 五月 2021 14:20:07 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop
---
src/components/LayerController/logic/WasteWater.js | 145 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 116 insertions(+), 29 deletions(-)
diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js
index b862b44..3d9587e 100644
--- a/src/components/LayerController/logic/WasteWater.js
+++ b/src/components/LayerController/logic/WasteWater.js
@@ -1,49 +1,136 @@
/**
* 搴熸按
*/
-const AnimalService = require('../service/AnimalService').default
-const AjaxUtils = require('../../../utils/AjaxUtils').default
+// import WasteWater from "../../table/components/WasteWater";
-// const getWasteWater = require('../../../utils/axios').default
+const AnimalService = require('../service/AnimalService').default
+const mapApi = require('../../../api/mapApi').default
+// 寮圭獥鏁版嵁寮曡繘
+const WasteWaterIndex = require('@components/BaseNav/WasteWater/WasteWaterIndex').default
+// const publicBounced = require('../../BaseNav/PublicBounced/PublicBounced').default
+
+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_bright_green.png' // 缂哄け
+const AlarmImg = '/assets/images/map/wastewater/fs_red.png' // 鎶ヨ闂儊
+const WarnImg = '/assets/images/map/wastewater/fs_orange.png' // 棰勮闂儊
module.exports = function () {
/**
* 杩斿洖marker瀵硅薄鏁扮粍
* @param L leaflet瀵硅薄
*/
- this.init = (layer, L) => {
- this.animalService = new AnimalService({ L: L, layer: layer })
- AjaxUtils.get4JsonDataByUrl('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', {
- companyId: 3900100145,
- id: '',
- monType: 1,
- userCode: 'wenchun.deng',
- monDuration: '',
- epName: '',
- secdDeptId: '',
- contrLevel: '',
- dataStatus: '',
- dataFlag: '',
- runStatus: '',
- emissTypeId: ''
- }, function (res) {
- console.log(res)
- const data = res.data.Result.DataInfo
- for (let i = 0; i < data.length; i++) {
- // 缁忕含搴� 浣嶇疆
- const positionX = data[i].Latitude
- const positionY = data[i].Longitude
- layer.addLayer(L.marker([positionX, positionY], {}))
- }
+ this.init = async (layer, L) => {
+ this.animalService = new AnimalService({
+ L: L,
+ layer: layer
})
+ const res = await mapApi.getWasteWater()
+ const data = res.Result.DataInfo || {}
+ for (let i = 0; i < data.length; i++) {
+ // 缁忕含搴� 浣嶇疆
+ const positionX = data[i].Latitude
+ const positionY = data[i].Longitude
+
+ // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁鐨勪笉鍚�
+ const testValue = data[i].ContrLevel
+ const iconUrl = this.differentTypes(testValue)
+ const marker = L.marker([positionX, positionY], {
+ totransferData: data[i],
+ icon: L.icon({
+ iconUrl: iconUrl,
+ iconSize: [35, 35],
+ iconAnchor: [15, 15]
+ })
+ })
+ layer.addLayer(marker)
+ }
}
+ // 鍒嗗壊绾�-------------------------------------------------------------------------------
this.bindTooltip = (layer) => {
- return 'aaaa'
+ return '<div class="company-bindTooltip-hover"><h3>澶╂触鐭冲寲</h3></div>' + layer.options.totransferData.Name
}
this.clickListener = (e) => {
- console.log(e)
+ // 鐐瑰嚮marker鐨刾ulse()鍏夋尝
this.animalService.pulseEffect(e.latlng)
+ // 寮规鏍囬
+ const title = e.layer.options.totransferData.Name
+ const res = e.layer.options.totransferData
+ window.$layer.open({
+ content: {
+ content: WasteWaterIndex, // 缁勪欢
+ parent: this, // 鐖剁粍浠�
+ data: { // 浼犻�掔殑鍙傛暟
+ // info: this.info
+ storagePlaceId: res
+ }
+ },
+ title: title // 鏍囬
+ })
+ this.animalService.setPanTo(e.latlng, 150)
+ }
+ this.requestWasteWaterData = async (e) => {
+ // 鍩烘湰淇℃伅 鍜� 璇︾粏淇℃伅 灞曠ず鏁版嵁鎵�闇�鍙傛暟
+ // const dataValue = {
+ // StoragePlaceId: e.layer.options.test.StoragePlaceId
+ // }
+ // 寮规鏍囬
+ // const title = e.layer.options.totransferData.Name
+ // console.log(e.layer.options)
+ // 鍩烘湰淇℃伅 tabs
+ // const resultBasic = await mapApi.getWasteWater(dataValue)
+ // 鍥捐〃淇℃伅灞曠ず echarts
+ // 瀹炴椂鏁版嵁
+ // const resultReal = await mapApi.getDataItems(Value)
+ // 灏忔椂鏁版嵁 鍙� 鏄庣粏琛ㄦ暟鎹�
+ // const result = await mapApi.getQueryOnlineMonData(dataValue)
+ // 鏃ユ暟鎹� 鍙� 鏄庣粏琛ㄦ暟鎹�
+ // const result = await mapApi.getQueryOnlineMonData(dataValue)
+ // 浜哄伐鏁版嵁
+ // const resultEchart = await mapApi.getQueryLabMonData(dataValue)
+
+ // // 缁戝畾寮规瀹炰緥
+ // const PublicBounced = window.Vue.extend(publicBounced)
+ // const instance = new PublicBounced().$mount()
+ // document.body.appendChild(instance.$el)
+ // // document.body.removeChild(instance.$el)
+ // // 閫氳繃鏂规硶 鍚戠粦瀹氬脊妗嗕紶閫掓暟鎹�
+ // instance.setData(title, resultBasic.Result.DataInfo, resultDetailed.Result.DataInfo, 'gufei')
+ /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */
+ }
+
+ // 鏍规嵁杩斿洖鍊肩殑涓嶅悓鏍囪涓嶅悓鍥剧墖
+ this.differentTypes = (testValue) => {
+ let testChange
+ switch (testValue) {
+ case 1:
+ testChange = NormalImg
+ break
+ case 2:
+ testChange = OffImg
+ break
+ case 3:
+ testChange = AbnormalImg
+ break
+ case 4:
+ testChange = MissImg
+ break
+ case 5:
+ testChange = NormalImg
+ break
+ case 6:
+ testChange = AlarmImg
+ break
+ case 7:
+ testChange = AbnormalImg
+ break
+ case 8:
+ testChange = WarnImg
+ break
+ }
+ return testChange
}
}
--
Gitblit v1.8.0