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/service/WmsLayerService.js |   44 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/src/components/LayerController/service/WmsLayerService.js b/src/components/LayerController/service/WmsLayerService.js
index b64e539..20f2af7 100644
--- a/src/components/LayerController/service/WmsLayerService.js
+++ b/src/components/LayerController/service/WmsLayerService.js
@@ -40,23 +40,47 @@
   init () {
   }
 
+  addAll (configs) {
+    for (let i = 0; i < configs.length; i++) {
+      const config = configs[i]
+      const layers = config.layers
+      if (layers) {
+        this.addAll(layers)
+      }
+      this.wmsLayerList.addConfig(config)
+    }
+    this.reload()
+  }
+
   add (config) {
     this.wmsLayerList.addConfig(config)
+    this.reload()
+  }
+
+  removeAll (configs) {
+    for (let i = 0; i < configs.length; i++) {
+      const config = configs[i]
+      const layers = config.layers
+      if (layers) {
+        this.removeAll(layers)
+      }
+      this.wmsLayerList.remove(config.typeName, config.filter)
+    }
+    this.reload()
+  }
+
+  remove (config) {
+    this.wmsLayerList.remove(config.typeName, config.filter)
+    this.reload()
+  }
+
+  reload () {
     const layers = this.wmsLayerList.getLayers() || ''
     const filter = this.wmsLayerList.getFilters() || ''
     const params = {}
     params.cql_filter = filter
     params.layers = layers
-    this.wmsLayer.setParams(params)
-  }
-
-  remove (config) {
-    this.wmsLayerList.remove(config.typeName, config.filter)
-    const layers = this.wmsLayerList.getLayers() || ''
-    const filter = this.wmsLayerList.getFilters() || ''
-    const params = { layers: layers }
-    params.cql_filter = filter
-    this.wmsLayer.setParams(params)
+    this.wmsLayer.setParams(params, false)
   }
 
   load () {

--
Gitblit v1.8.0