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/dataset/WmsLayerList.js |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/components/LayerController/dataset/WmsLayerList.js b/src/components/LayerController/dataset/WmsLayerList.js
index fc0e782..3aaeb12 100644
--- a/src/components/LayerController/dataset/WmsLayerList.js
+++ b/src/components/LayerController/dataset/WmsLayerList.js
@@ -1,5 +1,8 @@
 import clone from '../../../utils/utils'
 
+/**
+ * 缁勮wms鍔犺浇鎵�闇�鐨刲ayers浠ュ強filters鍙傛暟
+ */
 class WmsLayerList {
   constructor () {
     // [{鍥惧眰鍚嶇О锛歔{typeName:xxx,filter:yyy}]}]
@@ -10,7 +13,7 @@
     const typeName = config.typeName
     const layerGroup = config.layerGroup || typeName
     const filter = config.filter
-    const index = config.index || 9
+    const index = config.index
     if (layerGroup) {
       this.addLayer(layerGroup, typeName, filter, index)
     }
@@ -18,7 +21,6 @@
 
   addLayer (layerGroup, typeName, filter, index) {
     const layer = this._getLayer(layerGroup)
-
     if (layer) {
       const offset = this.indexOf(typeName, filter)
       if (offset < 0) {
@@ -28,7 +30,11 @@
     } else {
       const layerConfig = {}
       layerConfig[layerGroup] = [{ typeName: typeName, filter: filter || 'INCLUDE' }]
-      this.layers.push(layerConfig)
+      if (index) {
+        this.layers[index] = layerConfig
+      } else {
+        this.layers.push(layerConfig)
+      }
     }
   }
 
@@ -36,7 +42,7 @@
     const layers = this.layers
     for (let i = 0; i < layers.length; i++) {
       const lay = layers[i]
-      if (lay[layer]) {
+      if (lay && lay[layer]) {
         return lay
       }
     }
@@ -112,7 +118,9 @@
           }
         }
       }
-      cqlFilters.push(filters.join(' OR '))
+      if (filters.length > 0) {
+        cqlFilters.push(filters.join(' OR '))
+      }
     }
     return cqlFilters.join(';')
   }

--
Gitblit v1.8.0