From e92dd671ed1f79243bee0083aecbc5627b5cc7f6 Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期四, 10 七月 2025 16:17:52 +0800
Subject: [PATCH] 断面echart清除

---
 src/components/menu/CrossSectionalAnalysis.vue |    4 ++++
 src/components/monifangzhen/echartInfo.vue     |    9 +++++++++
 src/components/menu/TimeLine.vue               |    2 +-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/components/menu/CrossSectionalAnalysis.vue b/src/components/menu/CrossSectionalAnalysis.vue
index b4478aa..3923cee 100644
--- a/src/components/menu/CrossSectionalAnalysis.vue
+++ b/src/components/menu/CrossSectionalAnalysis.vue
@@ -78,6 +78,8 @@
 import { getCrossSection } from '@/api/trApi.js'; // 鍋囪浣犳湁鐪熷疄鎺ュ彛
 import { useSimStore } from '@/store/simulation';
 import { storeToRefs } from 'pinia';
+import { EventBus } from "@/eventBus";
+
 const simStore = useSimStore();
 const { selectedScheme } = storeToRefs(simStore);
 const viewer = window.viewer;
@@ -234,6 +236,8 @@
 		pickHandlerCross = null;
 	}
 	isPicking.value = false;
+ 	simStore.crossSection = []
+	EventBus.emit("clear-dM")
 	console.log('杩欓噷鍙戦�佽姹傦紝娓呯┖閮鐨別charts2');
 	
 }
diff --git a/src/components/menu/TimeLine.vue b/src/components/menu/TimeLine.vue
index 2be26e1..b341eb1 100644
--- a/src/components/menu/TimeLine.vue
+++ b/src/components/menu/TimeLine.vue
@@ -1158,9 +1158,9 @@
 async function endSimulation() {
   clearAllPoints();
   simStore.openDia = true;
+  simStore.crossSection = [];
   // 缁撴潫妯℃嫙涔嬪悗娓呴櫎layer鍒楄〃
   simStore.rePlayList = [];
-  console.log(simStore.rePlayList, "缁撴潫妯℃嫙娓呴櫎rePlayListrePlayList鍒楄〃");
   EventBus.emit("close-time");
   endSimulate();
   isWaterPrimitiveCreated.value = false;
diff --git a/src/components/monifangzhen/echartInfo.vue b/src/components/monifangzhen/echartInfo.vue
index 6162017..2f5b8af 100644
--- a/src/components/monifangzhen/echartInfo.vue
+++ b/src/components/monifangzhen/echartInfo.vue
@@ -155,6 +155,14 @@
   chart2Data.value.resetLoading();
 });
 
+// 娓呴櫎鏂潰
+EventBus.on("clear-dM", () => {
+  chart2Data.value.stopUpdating();
+  chart2Data.value.resetLoading();
+  clearInterval(intervalId2);
+  intervalId2 = null;
+});
+
 // 娓呴櫎濞佽儊瀵硅薄涓殑鏁版嵁
 const resetTable = () => {
   currentIndex.value = 0;
@@ -838,6 +846,7 @@
 onUnmounted(() => {
   EventBus.off("reset-table"); // 绉婚櫎浜嬩欢鐩戝惉
   EventBus.off("clear-echart");
+  EventBus.off("clear-dM");
   EventBus.off("time-update"); // 娓呯悊浜嬩欢鐩戝惉
 });
 </script>

--
Gitblit v1.9.3