From 4adfa4774e09f3b388335bb8dee5dea518856e5b Mon Sep 17 00:00:00 2001
From: yangdelong <828900aaa>
Date: 星期日, 30 五月 2021 19:23:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/develop' into develop

---
 src/components/LayerController/logic/WasteWater.js |   89 ++++++++++++++++++++++++++++++++++++--------
 1 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/src/components/LayerController/logic/WasteWater.js b/src/components/LayerController/logic/WasteWater.js
index a5ca19f..01cd150 100644
--- a/src/components/LayerController/logic/WasteWater.js
+++ b/src/components/LayerController/logic/WasteWater.js
@@ -1,11 +1,21 @@
 /**
  * 搴熸按
  */
+
+// 鍏叡鏂规硶 panTo() 寮曠敤
+const { setPanTo } = require('../../../utils/utils')
+
 const AnimalService = require('../service/AnimalService').default
 const mapApi = require('../../../api/mapApi').default
+// 寮圭獥鏁版嵁寮曡繘
+const WasteWaterIndex = require('@components/base-page/WasteWater/WasteWaterIndex').default
 
-const testValue1 = '/assets/images/map/wastewater/fs_green.png'
-const testValue2 = '/assets/images/map/wastewater/fs_yellow.png'
+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 () {
   /**
@@ -17,10 +27,22 @@
       L: L,
       layer: layer
     })
-    const res = await mapApi.getWasteWater()
-    console.log(res)
-    const data = res.Result.DataInfo
-    console.log(data)
+    const param = {
+      companyId: 3900100145, // 浼佷笟缂栫爜
+      id: '',
+      monType: 1, // 搴熸按
+      userCode: 'wenchun.deng', // 鐢ㄦ埛鍚嶇О
+      monDuration: '',
+      epName: '',
+      secdDeptId: '',
+      contrLevel: '',
+      dataStatus: '',
+      dataFlag: '',
+      runStatus: '',
+      emissTypeId: ''
+    }
+    const res = await mapApi.getWasteWater(param)
+    const data = res.Result.DataInfo || {}
     for (let i = 0; i < data.length; i++) {
       // 缁忕含搴� 浣嶇疆
       const positionX = data[i].Latitude
@@ -29,11 +51,12 @@
       // 瀹氫箟绫诲瀷 鐢ㄦ潵鍖哄垎鏁版嵁鐨勪笉鍚�
       const testValue = data[i].ContrLevel
       const iconUrl = this.differentTypes(testValue)
-      const marker = L.marker.magic([positionX, positionY], {
+      const marker = L.marker([positionX, positionY], {
+        totransferData: data[i],
         icon: L.icon({
           iconUrl: iconUrl,
-          iconSize: [50, 50],
-          iconAnchor: [25, 25]
+          iconSize: [30, 30],
+          iconAnchor: [15, 15]
         })
       })
       layer.addLayer(marker)
@@ -41,22 +64,56 @@
   }
 
   this.bindTooltip = (layer) => {
-    return '娴嬭瘯搴熸按'
+    return '<div class="company-bindTooltip-hover"><h3>澶╂触鐭冲寲</h3></div>' + layer.options.totransferData.Name
   }
 
   this.clickListener = (e) => {
-    // console.log(e)
     this.animalService.pulseEffect(e.latlng)
-    return this.PublicBounced.$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 // 鏍囬
+    })
   }
 
   // 鏍规嵁杩斿洖鍊肩殑涓嶅悓鏍囪涓嶅悓鍥剧墖
   this.differentTypes = (testValue) => {
     let testChange
-    if (testValue === 1) {
-      testChange = testValue1
-    } else {
-      testChange = testValue2
+    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