From 9eda86f1b33b9d2a95eae89eb7bdb3e99ad745d5 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 03 Dec 2024 12:58:25 +0800
Subject: [PATCH] 首页内存泄漏优化

---
 src/pages/map/components/scomponents/layersControl.vue |   80 ++++++++++++++++++---------------------
 1 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/src/pages/map/components/scomponents/layersControl.vue b/src/pages/map/components/scomponents/layersControl.vue
index 1e3cc43..29cec18 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-02 21:12:23
+ * @LastEditTime: 2024-12-02 22:20:32
  * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
  * @Description:
  *
@@ -79,12 +79,12 @@
 import EventBus from 'utils/bus'
 import { usePointStore } from 'store/usepoint'
 const pointStore = usePointStore()
-import { useRouter } from 'vue-router';
-const router = useRouter();
+import { useRouter } from 'vue-router'
+const router = useRouter()
 
 const { VITE_APP_BASE } = import.meta.env
 // , '7', 
-let indexPoint = ref(['1', '5'])
+let indexPoint = ref(['1', '5', '7'])
 
 const treeRef = ref(null)
 
@@ -414,22 +414,22 @@
         showPanel: false,
         layerName: 'gouqu'
       },
-      {
-        id: '3-9',
-        label: '废水处理站',
-        type: 'layer',
-        subType: 'labelPoint',
-        method: getList,
-        params: {
-          type: 9,
-          size: 1000
-          // name: '吉水县绿源污水处理厂',
-        },
-        backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsclc.png',
-        className: 'xfs-box',
-        showPanel: false,
-        layerName: 'fsclz'
-      },
+      // {
+      //   id: '3-9',
+      //   label: '废水处理站',
+      //   type: 'layer',
+      //   subType: 'labelPoint',
+      //   method: getList,
+      //   params: {
+      //     type: 9,
+      //     size: 1000
+      //     // name: '吉水县绿源污水处理厂',
+      //   },
+      //   backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsclc.png',
+      //   className: 'xfs-box',
+      //   showPanel: false,
+      //   layerName: 'fsclz'
+      // },
       {
         id: '3-10',
         label: '排水口',
@@ -445,21 +445,21 @@
         showPanel: false,
         layerName: 'psk'
       },
-      {
-        id: '3-11',
-        label: '污水池',
-        type: 'layer',
-        subType: 'labelPoint',
-        method: getList,
-        params: {
-          type: 11,
-          size: 1000
-        },
-        backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsc.png',
-        className: 'xfs-box',
-        showPanel: false,
-        layerName: 'wsc'
-      }
+      // {
+      //   id: '3-11',
+      //   label: '污水池',
+      //   type: 'layer',
+      //   subType: 'labelPoint',
+      //   method: getList,
+      //   params: {
+      //     type: 11,
+      //     size: 1000
+      //   },
+      //   backgroundIcon: VITE_APP_BASE + 'img/mapicon/wsc.png',
+      //   className: 'xfs-box',
+      //   showPanel: false,
+      //   layerName: 'wsc'
+      // }
     ]
   },
 
@@ -693,12 +693,8 @@
               progressiveResolutionHeightFraction: 0.5,
               baseScreenSpaceError: 1024
             })
-            addTileLayers[item.layerName][ind].setSplitDirection(1)
             // tile.setHeight(-420)
-            // tile.setSplitDirection(-1)
-            window.$viewer.sceneSplit.addTileset(addTileLayers[item.layerName][ind])
             tileLayers.addOverlay(addTileLayers[item.layerName][ind])
-            window.$viewer.sceneSplit.enable = false
           })
         } else {
           addTileLayers[item.layerName].forEach(m => m.show = true)
@@ -912,9 +908,7 @@
 EventBus.on('flyToyqfw', flyToyqfw)
 
 onMounted(() => {
-  setTimeout(() => {
-    // handleCheckChange(data.filter(i => indexPoint.value.includes(i.id)))
-  }, 3000)
+  handleCheckChange(data.filter(i => indexPoint.value.includes(i.id)))
 })
 
 // const sharedData = computed(() => pointStore.sharedData);
@@ -951,7 +945,7 @@
 // 监听当前路由路径的变化
 watch(() => router.currentRoute.value.path,
   (newPath, oldPath) => {
-    console.log(`Current path changed from ${oldPath} to ${newPath}`);
+    console.log(`Current path changed from ${oldPath} to ${newPath}`)
     closeAll()
   },
   { immediate: true }

--
Gitblit v1.9.3