From ca2a7113f660f523518c4be431534e7eebaa297e Mon Sep 17 00:00:00 2001
From: XingChuan <m17600301067@163.com>
Date: 星期日, 30 五月 2021 12:37:24 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/develop' into develop

---
 src/components/panel/RightSearchPanel.vue                 |  124 ++++++++++++++++++++----------
 src/conf/Topic.js                                         |    4 
 src/components/table/components/tabHandover.vue           |    3 
 src/conf/Constants.js                                     |   17 ++++
 src/components/helpers/MapManager.js                      |    5 +
 src/components/LayerController/modules/LcServiceLayer.vue |   42 +++++++++
 6 files changed, 145 insertions(+), 50 deletions(-)

diff --git a/src/components/LayerController/modules/LcServiceLayer.vue b/src/components/LayerController/modules/LcServiceLayer.vue
index acb38a6..e7aef4a 100644
--- a/src/components/LayerController/modules/LcServiceLayer.vue
+++ b/src/components/LayerController/modules/LcServiceLayer.vue
@@ -7,17 +7,17 @@
                     <i class="downUp el-icon-caret-bottom" @click="item.isShow=!item.isShow" :class="item.isShow?'':'active'" ></i><!-- el-icon-arrow-down -->
                     <!-- 涓�绾у浘灞傞亶鍘� -->
                     <div style="padding-left:25px;padding-top:10px;color:#fff;font-size: 16px;">
-                        <input type="checkbox"  :class="item.type==1?'active':''" :name="'wmsLayer_'+item.code" :checked="item.checked" :value="item.code" @change="swAllLayers(item)"/>{{ item.name }}
+                        <input type="checkbox" :class="{ 'active': item.type === 1 }" :name="'wmsLayer_'+item.code" :checked="item.checked" :value="item.code" @change="swAllLayers(item)"/>{{ item.name }}
                     </div>
                     <div class="layerbox-item" v-show="item.isShow" >
                         <!-- 浜岀骇鍥惧眰閬嶅巻 -->
                         <div class="basemap-layer-item" v-for="(itm,index2) in item.layers" :key="index2" :class="!itm.layers?'felxs':''" >
-                            <input type="checkbox" :class="itm.type==1?'active':''" :name="'wmsSublayers_'+item.code+'_'+itm.code" :checked="itm.checked" :value="itm.code" @change="swAllLayers(itm)"/>{{ itm.name }}
+                            <input type="checkbox" :class="{ 'active': itm.type === 1 }" :name="'wmsSublayers_'+item.code+'_'+itm.code" :checked="itm.checked" :value="itm.code" @change="swAllLayers(itm)"/>{{ itm.name }}
                             <!-- 涓夌骇鍥惧眰閬嶅巻 -->
                             <div class="layerbox-item-3" v-show="itm.layers">
                                 <div class="basemap-layer-item" v-for="(layer,index3) in itm.layers" :key="index3">
                                     <input type="checkbox"
-                                           :class="layer.type==1?'active':''"
+                                           :class="{ 'active': layer.type === 1 }"
                                            :name="'wmsSublayers_'+item.code+'_'+layer.code"
                                            :checked="layer.checked"
                                            :value="layer.code"
@@ -68,6 +68,8 @@
       } else {
         this.toggleLayer(item)
       }
+      /* <<<<<<< HEAD
+      bus.$emit('changeSearchBar', item)
       this.serviceLayers.forEach(function (item1, index1) {
         if (item1.layers) {
           item1.istrue = 0
@@ -112,6 +114,7 @@
           // console.log(item1.layers.length, item1.istrue, item1.isfalse, item1.type)
         }
       })
+>>>>>>> de7390c66ef3e3fe316e804495a78d05a01f0160 */
       // console.log(this.serviceLayers)
     },
     swLayers (configs, checked) {
@@ -126,6 +129,30 @@
         }
       }
     },
+    setLayerType (configs, checkedSum) {
+      if (configs) {
+        for (let i = 0, len = configs.length; i < len; ++i) {
+          const config = configs[i]
+          const checked = config.checked
+          if (config.layers) {
+            checkedSum = this.setLayerType(config.layers, checkedSum || 0)
+            if (checkedSum === config.layers.length) {
+              config.type = 2
+              config.checked = true
+            } else if (checkedSum === 0) {
+              config.type = 0
+              config.checked = false
+            } else {
+              config.type = 1
+            }
+            checkedSum = 0
+            continue
+          }
+          checkedSum = checkedSum + (checked ? 1 : 0)
+        }
+        return checkedSum
+      }
+    },
     toggleLayer (itm) {
       if (itm.checked) {
         window.layerFactory.show(itm)
@@ -134,6 +161,15 @@
       }
       // this.updateWms()
     }
+  },
+  watch: {
+    serviceLayers: {
+      handler: function (val) {
+        this.setLayerType(val, 0)
+      },
+      immediate: true,
+      deep: true
+    }
   }
 }
 </script>
diff --git a/src/components/helpers/MapManager.js b/src/components/helpers/MapManager.js
index eae4b26..c3ec889 100644
--- a/src/components/helpers/MapManager.js
+++ b/src/components/helpers/MapManager.js
@@ -44,7 +44,7 @@
       var point = this.map.latLngToContainerPoint(latlng, this.map.getZoom())
       const wmsLayerService = window.layerFactory.wmsLayerService
       const layers = wmsLayerService.wmsLayerList.getLayers()
-      // const filters = wmsLayerService.wmsLayerList.getFilters()
+      const filters = wmsLayerService.wmsLayerList.getFilters()
       const wmsParams = Object.assign({
         LAYERS: layers,
         QUERY_LAYERS: layers,
@@ -54,6 +54,9 @@
         Y: Math.round(point.y),
         BBOX: this.map.getBounds().toBBoxString()
       }, this.defaultWmsParams, params)
+      if (filters) {
+        wmsParams.CQL_FILTER = filters
+      }
       AjaxUtils.get4JsonDataByUrl(WMS_URL, wmsParams, (res) => {
         resolve(res.data)
       })
diff --git a/src/components/panel/RightSearchPanel.vue b/src/components/panel/RightSearchPanel.vue
index 6df7286..e0b822c 100644
--- a/src/components/panel/RightSearchPanel.vue
+++ b/src/components/panel/RightSearchPanel.vue
@@ -12,7 +12,7 @@
                     </div>
                 </li>
             </ul> -->
-            <ul v-for="item in topicList" :key="item.name"
+            <ul v-for="item in list" :key="item.name"
                 :class="item.checked?'module-wrap map-btn-active':'module-wrap map-btn-unactive'"
                 @click="()=>{selected(item)}" v-show="item.isShow">
               <el-tooltip :popper-class="'map-tooltip'" effect="dark" :content="item.name" placement="left">
@@ -51,7 +51,7 @@
 <script>
 import EnvRiskSearch from './topicSearch/EnvRiskSearch'
 import DischargeSearch from './topicSearch/DischargeSearch'
-import { TopicList } from '../../conf/Topic'
+import { topicList } from '../../conf/Topic'
 
 import GasWasteSearch from '@components/panel/topicSearch/GasWasteSearch'
 import WaterWasteSearch from '@components/panel/topicSearch/WaterWasteSearch'
@@ -61,8 +61,6 @@
 import PipeChangesSearch from '@components/panel/topicSearch/pipeChangesSearch.vue'
 import PipeInformationSearch from '@components/panel/topicSearch/pipeInformationSearch.vue'
 import EnterpriseEmergencySearch from './topicSearch/EnterpriseEmergencySearch'
-
-import bus from '@/eventBus'
 
 export default {
   name: 'MonitorPanel',
@@ -78,7 +76,7 @@
     return {
       isShow: true,
       topicMenu: [],
-      topicList: TopicList,
+      list: topicList,
       topicCheckedList: [],
       isPanelVisible: false,
       gcComp: SewersSearch,
@@ -91,7 +89,11 @@
       selectGroup: false
     }
   },
-  computed: {},
+  computed: {
+    serviceLayers () {
+      return this.$store.state.map.serviceLayers.LayerSewersLine
+    }
+  }, /*
   watch: {
     '$store.state.map.topic.topicCheckedList': function (newVal, oldVal) {
       console.log(oldVal)
@@ -106,26 +108,46 @@
         })
       })
     }
-  },
+  }, */
   methods: {
     handleClose (done) {
       console.log(done)
     },
     setSearchPanelChange () {
+      // 鎼滅储闈㈡澘娌℃湁鏄剧ず鏃讹紝灏嗘墍鏈変富棰橀�夋嫨鐘舵�佽缃负false
       this.selectGroup = !this.selectGroup
       if (!this.selectGroup) {
-        this.topicList.forEach((itm) => {
+        this.list.forEach((itm) => {
           itm.checked = false
         })
       }
     },
+    unselected (val) {
+      // console.log(val)
+      this.selectGroup = true
+      this.list.forEach((itm) => {
+        if (itm.name === val.name) {
+          console.log(val.name)
+          itm.checked = false
+          itm.isShow = false
+        }
+      })
+    },
     selected (val) {
       // console.log(val)
-      this.title = val.name
       this.selectGroup = true
-      this.topicList.forEach((itm) => {
-        itm.checked = val.name === itm.name
+      this.list.forEach((itm) => {
+        if (itm.name === val.name) {
+          itm.isShow = true
+          itm.checked = true
+        } else {
+          itm.checked = false
+        }
       })
+      this.setComp(val)
+    },
+    setComp (val) {
+      this.title = val.name
       switch (val.name) {
         case '姹℃煋婧�':
           this.gcComp = DischargeSearch
@@ -160,9 +182,6 @@
       }
     },
     handlePage (page) {
-    },
-    handleGd () {
-      this.title = '绠¢亾淇℃伅鏌ヨ'
     },
     toggleMonitorPanel () {
       this.isCollapse = !this.isCollapse
@@ -204,37 +223,60 @@
       //     })
       //   }
     },
-    defaultLastOne () {
-      let v = {}
-      this.topicList.forEach((item) => {
-        if (item.isShow) {
-          v = item
+    containsLayer (layer) {
+      if (layer) {
+        for (let i = 0; i < layer.length; i++) {
+          const lay = layer[i]
+          const checked = lay.checked
+
+          for (let j = 0; j < this.list.length; j++) {
+            const topic = this.list[j]
+            if (lay.name === topic.name) {
+              if (lay.layers) {
+                const isChecked = this.isChecked(lay.layers)
+                if (isChecked) {
+                  this.selected(topic)
+                } else {
+                  this.unselected(topic)
+                }
+              } else if (checked) {
+                this.selected(topic)
+              }
+              break
+            }
+          }
+          this.containsLayer(lay.layers)
         }
-      })
-      this.selected(v)
+      }
+    },
+    isChecked (layers) {
+      for (let i = 0; i < layers.length; i++) {
+        const layer = layers[i]
+        const checked = layer.checked
+        if (checked) {
+          return true
+        }
+        if (layer.layers) {
+          return this.isChecked(layer.layers)
+        }
+      }
+      return false
     }
   },
   mounted () {
-    const that = this
-    bus.$on('changeSearchBar', function (obj) {
-      that.gcComp = ''
-      that.topicList.forEach((item) => {
-        if (item.name === obj.name) {
-          if (obj.type > 0) {
-            item.isShow = true
-          } else {
-            item.isShow = false
-          }
-          // item.isShow = obj.checked
-          if (item.isShow) {
-            that.selected(item)
-          } else {
-            that.defaultLastOne()
-          }
-        }
-      })
-    })
-  //  console.log(that.topicList)
+    /* bus.$on('changeSearchBar', (obj) => {
+      const topic = this.search(this.serviceLayers, obj)
+      console.log('====' + JSON.stringify(topic))
+    }) */
+  },
+  watch: {
+    serviceLayers: {
+      handler: function (newVal, oldVal) {
+        this.containsLayer(newVal)
+      },
+      immediate: true,
+      deep: true
+    }
   }
 }
 </script>
diff --git a/src/components/table/components/tabHandover.vue b/src/components/table/components/tabHandover.vue
index 43896f1..0a92b64 100644
--- a/src/components/table/components/tabHandover.vue
+++ b/src/components/table/components/tabHandover.vue
@@ -19,7 +19,6 @@
 import EnvironmentalRisk from '@components/table/components/EnvironmentalRisk'
 import Pipeline from '@components/table/components/Pipeline'
 import CorporateEmergency from '@components/table/components/CorporateEmergency'
-
 import { TopicList } from '../../../conf/Topic'
 export default {
   name: 'tabHandover',
@@ -38,7 +37,7 @@
       titleProp: '',
       activeName: '姹℃煋婧�',
       topicList: TopicList, // tab椤�
-      gcComp: PollutionSource // 榛樿鏄剧ず姹℃煋婧愬唴瀹�
+      gcComp: PollutionSource
     }
   },
   methods: {
diff --git a/src/conf/Constants.js b/src/conf/Constants.js
index 20c3f29..3abd745 100644
--- a/src/conf/Constants.js
+++ b/src/conf/Constants.js
@@ -65,7 +65,8 @@
   emergencyesources: '搴旀�ョ墿璧�',
   firefightingunit: '娑堥槻鍗曚綅',
   unitareaboundary: '瑁呯疆鍖鸿竟鐣�',
-  sensitivetarget: '鏁忔劅鐩爣'
+  sensitivetarget: '鏁忔劅鐩爣',
+  chokevalve: '鎴祦闂�'
 }
 
 export const LAYERPROPS = {
@@ -92,6 +93,7 @@
     name: '绠$綉鍚嶇О',
     linenumtype: '绠$嚎绫诲瀷',
     pipename: '绠$嚎鍚嶇О',
+    subchaname: '鏀嚎鍚嶇О',
     mediumtype: '杈撻�佷粙璐�',
     length: '闀垮害(m)',
     startposname: '璧风偣浣嶇疆鍚嶇О',
@@ -414,5 +416,18 @@
     huncount: '甯歌浜哄彛鏁伴噺',
     structureoridsitearea: '鍗犲湴闈㈢Н',
     adminzonename: '琛屾斂闅跺睘'
+  },
+  // 鎴祦闂�
+  chokevalve: {
+    closurename: '鍚嶇О',
+    closurecode: '缂栫爜',
+    pointnumber: '娴嬬偣缂栧彿',
+    mediumtype: '浠嬭川',
+    size: '灏哄(m)',
+    operatingtype: '鎺у埗鏂瑰紡',
+    telephone: '鑱旂郴鐢佃瘽',
+    resperson: '璐熻矗浜�',
+    startdate: '鎶曠敤鏃ユ湡',
+    operationalstatus: '杩愯鐘舵��'
   }
 }
diff --git a/src/conf/Topic.js b/src/conf/Topic.js
index ff80c53..7f566af 100644
--- a/src/conf/Topic.js
+++ b/src/conf/Topic.js
@@ -12,10 +12,10 @@
   EnterpriseEmergencySearch: () => import('@components/panel/topicSearch/EnterpriseEmergencySearch.vue')
 }
 
-export const TopicList = [{
+export const topicList = [{
   name: '姹℃煋婧�',
   id: 1,
-  check: false,
+  checked: false,
   isShow: false,
   icon: 'iconwuranyuan',
   comp: ''

--
Gitblit v1.8.0