From 4df0471b7dff0494625ff09969b1a13b5359a26e Mon Sep 17 00:00:00 2001
From: XingChuan <m17600301067@163.com>
Date: 星期一, 31 五月 2021 22:41:47 +0800
Subject: [PATCH] 统计表弹框UI优化;增加点击企业名称缩放至企业;二级表展示功能优化。

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

diff --git a/src/components/LayerController/logic/PipeLineAnimal.js b/src/components/LayerController/logic/PipeLineAnimal.js
index 585147b..11c54ef 100644
--- a/src/components/LayerController/logic/PipeLineAnimal.js
+++ b/src/components/LayerController/logic/PipeLineAnimal.js
@@ -1,28 +1,69 @@
+
 /**
  *  绠$嚎鍔ㄧ敾鎺у埗閫昏緫
  */
-const layerPipeLines = require('../../../conf/layers/LayerPipeLines').LayerPipeLines
+const LayerPipeLines = require('../../../conf/layers/LayerPipeLines').LayerPipeLines
+const STYLES = require('../../../conf/Constants').STYLES
 
 module.exports = function () {
-  this.init = (layer, L) => {
-    console.log('sssssss')
-    const layers = layerPipeLines.layers
+  this.init = () => {
+  }
+
+  this.start = () => {
+    const layers = LayerPipeLines.layers
     for (var i = 0; i < layers.length; i++) {
       const config = layers[i]
       const code = config.code
+      const styles = config.styles
+      // window.layerFactory.show(config)
       const layer = window.layerFactory.layers[code]
-      layer.setStyle({
-        FILL: true,
-        WEIGHT: 3,
-        FILL_COLOR: '#73b2ff',
-        COLOR: '#73b2ff',
-        FILL_OPACITY: 0.2,
-        OPACITY: 1,
-        DASH_ARRAY: '4,4',
-        DASH_SPPED: -5,
-        ICON_SIZE: [10, 10]
-      })
-      console.log(layer)
+      if (layer) {
+        if (layer.eachLayer) {
+          layer.eachLayer(function (layer) {
+            var newStyles = Object.assign(STYLES, styles)
+            layer.setStyle({
+              fill: newStyles.FILL,
+              weight: newStyles.WEIGHT,
+              fillColor: newStyles.FILL_COLOR,
+              color: newStyles.COLOR,
+              fillOpacity: newStyles.FILL_OPACITY,
+              opacity: newStyles.OPACITY,
+              dashArray: newStyles.DASH_ARRAY,
+              dashSpeed: newStyles.DASH_SPPED
+            })
+          })
+          // 閲嶆柊娣诲姞鍒板湴鍥句笂锛屽姩鐢绘墠鏈夋晥鏋�
+          window.map.removeLayer(layer)
+          window.layerFactory.show(config)
+        }
+      }
+    }
+  }
+
+  this.destory = () => {
+    const layers = LayerPipeLines.layers
+    for (var i = 0; i < layers.length; i++) {
+      const config = layers[i]
+      const code = config.code
+      const styles = config.styles
+      // window.layerFactory.show(config)
+      const layer = window.layerFactory.layers[code]
+      if (layer) {
+        if (layer.eachLayer) {
+          layer.eachLayer(function (layer) {
+            layer.resetStyle()
+            var newStyles = Object.assign(STYLES, styles)
+            layer.setStyle({
+              fill: newStyles.FILL,
+              weight: newStyles.WEIGHT,
+              fillColor: newStyles.FILL_COLOR,
+              color: newStyles.COLOR,
+              fillOpacity: newStyles.FILL_OPACITY,
+              opacity: newStyles.OPACITY
+            })
+          })
+        }
+      }
     }
   }
 }

--
Gitblit v1.8.0