From 288bf6f545b846dd4df9c61f753e9eff54edfc17 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 10 Dec 2024 14:36:39 +0800
Subject: [PATCH] 图层控制中,应急池及阀门显示调整

---
 src/pages/map/components/scomponents/layersControl.vue |  225 ++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 163 insertions(+), 62 deletions(-)

diff --git a/src/pages/map/components/scomponents/layersControl.vue b/src/pages/map/components/scomponents/layersControl.vue
index 7f7a2e0..1694931 100644
--- a/src/pages/map/components/scomponents/layersControl.vue
+++ b/src/pages/map/components/scomponents/layersControl.vue
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2024-10-31 10:47:29
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-12-09 11:52:35
+ * @LastEditTime: 2024-12-10 14:33:31
  * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
  * @Description:
  *
@@ -158,83 +158,184 @@
         parentId: '3',
         id: '3-1',
         label: '应急池',
-        type: 'layer',
-        subType: 'labelPoint',
-        method: getList,
-        params: {
-          type: 1,
-          size: 1000
-        },
-        backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
-        className: 'yjc-box',
-        showPanel: false,
-        layerName: 'yjc',
-        incident: (e) => {
-          const { attrParams } = e.overlay
-          // 删除
-          destroyPop()
-          if (!attrParams.firmName) {
-            return
-          }
-          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
-          window.$viewer.addLayer(addPopLayers[attrParams.id])
-          let iconEl = `<div class="marsBlueGradientPnl">
+        children: [
+          {
+            parentId: '3-1',
+            id: '3-1-1',
+            label: '园区',
+            type: 'layer',
+            subType: 'labelPoint',
+            method: getList,
+            params: {
+              type: 1,
+              size: 1000,
+              category: 1
+            },
+            backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
+            className: 'yjc-box',
+            showPanel: false,
+            layerName: 'yjc-yq',
+            incident: (e) => {
+              const { attrParams } = e.overlay
+              // 删除
+              destroyPop()
+              if (!attrParams.firmName) {
+                return
+              }
+              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
+              window.$viewer.addLayer(addPopLayers[attrParams.id])
+              let iconEl = `<div class="marsBlueGradientPnl">
             <div>企业名称:${attrParams.firmName}</div>
             <div>作用:${attrParams.mainFuncName}</div>
                 </div>`
-          let divIcon = new DC.DivIcon(
-            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
-            `<div class="public-map-popup-two">
+              let divIcon = new DC.DivIcon(
+                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
+                `<div class="public-map-popup-two">
                     ${iconEl}
                   </div>`
-          )
-          let incident = () => {
-            destroyPop()
-          }
-          divIcon.on(DC.MouseEventType.CLICK, incident)
-          addPopLayers[attrParams.id].addOverlay(divIcon)
-        }
+              )
+              let incident = () => {
+                destroyPop()
+              }
+              divIcon.on(DC.MouseEventType.CLICK, incident)
+              addPopLayers[attrParams.id].addOverlay(divIcon)
+            }
+          },
+          {
+            parentId: '3-1',
+            id: '3-1-2',
+            label: '企业',
+            type: 'layer',
+            subType: 'labelPoint',
+            method: getList,
+            params: {
+              type: 1,
+              size: 1000,
+              category: 2
+            },
+            backgroundIcon: VITE_APP_BASE + 'img/mapicon/yjc.png',
+            className: 'yjc-box',
+            showPanel: false,
+            layerName: 'yjc-qy',
+            incident: (e) => {
+              const { attrParams } = e.overlay
+              // 删除
+              destroyPop()
+              if (!attrParams.firmName) {
+                return
+              }
+              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
+              window.$viewer.addLayer(addPopLayers[attrParams.id])
+              let iconEl = `<div class="marsBlueGradientPnl">
+            <div>企业名称:${attrParams.firmName}</div>
+            <div>作用:${attrParams.mainFuncName}</div>
+                </div>`
+              let divIcon = new DC.DivIcon(
+                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
+                `<div class="public-map-popup-two">
+                    ${iconEl}
+                  </div>`
+              )
+              let incident = () => {
+                destroyPop()
+              }
+              divIcon.on(DC.MouseEventType.CLICK, incident)
+              addPopLayers[attrParams.id].addOverlay(divIcon)
+            }
+          },
+        ]
       },
+
       {
         parentId: '3',
         id: '3-2',
         label: '阀门',
-        type: 'layer',
-        subType: 'labelPoint',
-        method: getList,
-        params: {
-          type: 2,
-          size: 1000
-        },
-        backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
-        className: 'ysf-box',
-        showPanel: false,
-        layerName: 'fm',
-        incident: (e) => {
-          const { attrParams } = e.overlay
-          // 删除
-          destroyPop()
-          if (!attrParams.firmName) {
-            return
-          }
-          addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
-          window.$viewer.addLayer(addPopLayers[attrParams.id])
-          let iconEl = `<div class="marsBlueGradientPnl">
+        children: [
+          {
+            parentId: '3-2',
+            id: '3-2-1',
+            label: '园区',
+            type: 'layer',
+            subType: 'labelPoint',
+            method: getList,
+            params: {
+              type: 2,
+              size: 1000,
+              category: 1
+            },
+            backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
+            className: 'ysf-box',
+            showPanel: false,
+            layerName: 'fm-yq',
+            incident: (e) => {
+              const { attrParams } = e.overlay
+              // 删除
+              destroyPop()
+              if (!attrParams.firmName) {
+                return
+              }
+              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
+              window.$viewer.addLayer(addPopLayers[attrParams.id])
+              let iconEl = `<div class="marsBlueGradientPnl">
             <div>企业名称:${attrParams.firmName}</div>
             <div>作用:${attrParams.mainFuncName}</div>
                 </div>`
-          let divIcon = new DC.DivIcon(
-            new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
-            `<div class="public-map-popup-two">
+              let divIcon = new DC.DivIcon(
+                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
+                `<div class="public-map-popup-two">
                     ${iconEl}
                   </div>`
-          )
-          let incident = () => {
-            destroyPop()
+              )
+              let incident = () => {
+                destroyPop()
+              }
+              divIcon.on(DC.MouseEventType.CLICK, incident)
+              addPopLayers[attrParams.id].addOverlay(divIcon)
+            }
+          },
+          {
+            parentId: '3-2',
+            id: '3-2-2',
+            label: '企业',
+            type: 'layer',
+            subType: 'labelPoint',
+            method: getList,
+            params: {
+              type: 2,
+              size: 1000,
+              category: 2
+            },
+            backgroundIcon: VITE_APP_BASE + 'img/mapicon/ysf.png',
+            className: 'ysf-box',
+            showPanel: false,
+            layerName: 'fm-qy',
+            incident: (e) => {
+              const { attrParams } = e.overlay
+              // 删除
+              destroyPop()
+              if (!attrParams.firmName) {
+                return
+              }
+              addPopLayers[attrParams.id] = new DC.HtmlLayer(attrParams.id)
+              window.$viewer.addLayer(addPopLayers[attrParams.id])
+              let iconEl = `<div class="marsBlueGradientPnl">
+            <div>企业名称:${attrParams.firmName}</div>
+            <div>作用:${attrParams.mainFuncName}</div>
+                </div>`
+              let divIcon = new DC.DivIcon(
+                new DC.Position(attrParams.lng, attrParams.lat, attrParams.ele || 64),
+                `<div class="public-map-popup-two">
+                    ${iconEl}
+                  </div>`
+              )
+              let incident = () => {
+                destroyPop()
+              }
+              divIcon.on(DC.MouseEventType.CLICK, incident)
+              addPopLayers[attrParams.id].addOverlay(divIcon)
+            }
           }
-          divIcon.on(DC.MouseEventType.CLICK, incident)
-          addPopLayers[attrParams.id].addOverlay(divIcon)
-        }
+        ]
       },
 
       {

--
Gitblit v1.9.3