From a57caa72a54efe9de3fe26a6c36d3e8038267377 Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期四, 17 七月 2025 09:09:49 +0800
Subject: [PATCH] 修改x按钮

---
 src/components/menu/TimeLine.vue |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/src/components/menu/TimeLine.vue b/src/components/menu/TimeLine.vue
index 649f970..6951358 100644
--- a/src/components/menu/TimeLine.vue
+++ b/src/components/menu/TimeLine.vue
@@ -340,8 +340,9 @@
       }
 
       // 瑙﹀彂杩涘害鏇存柊
-      const progress = currentTime.value / totalDuration;
-      emit("timeUpdate", progress * 100);
+      // const progress = currentTime.value / totalDuration;
+      // 瀹炴椂妯℃嫙搴旇涓嶇敤鏄剧ず寮圭獥鍚�
+      // emit("timeUpdate", progress * 100);
 
       // 濡傛灉闇�瑕佽Е鍙戞煇浜涙洿鏂板嚱鏁帮紝涔熷彲浠ヤ繚鐣�
       updateWaterColorByTime();
@@ -1076,7 +1077,11 @@
 watch(
   () => finishPlay.value,
   (newVal) => {
-    if (newVal && selectedScheme.value.type === 2) {
+    if (
+      newVal &&
+      selectedScheme.value.type === 2 &&
+      simStore.rePlayList.length > 0
+    ) {
       handlePlayFinished();
     }
   }
@@ -1130,32 +1135,33 @@
   if (selectedScheme.value.type === 2) {
     try {
       await ElMessageBox.confirm("鏂规鏈仠姝㈡椂缁撴潫妯℃嫙鍚庯紝鍚庡彴灏嗗仠姝㈣绠�", {
-        confirmButtonText: "杩斿洖鍒楄〃",
-        cancelButtonText: "缁撴潫妯℃嫙",
+        confirmButtonText: "缁撴潫妯℃嫙",
+        cancelButtonText: "杩斿洖鍒楄〃",
         type: "warning",
       });
-      // 鐢ㄦ埛鐐瑰嚮浜嗙‘璁わ紝杩欓噷涓嶆墽琛屼换浣曟搷浣滐紝浠呭叧闂璇濇
+
+      const res = await stopSim(selectedScheme.value.id);
+      if (res.code == 404) {
+        ElMessage.warning("璇ユ湇鍔″凡鍋滄");
+      } else {
+        ElMessage.success("鏈嶅姟姝e湪鍋滄涓�");
+      }
     } catch (error) {
-      stopSim(selectedScheme.value.id).then((res) => {
-        if (res.code == 404) {
-          ElMessage.warning("璇ユ湇鍔″凡鍋滄");
-        } else {
-          ElMessage.success("鏈嶅姟姝e湪鍋滄涓�");
-        }
-      });
-      // return;
+      // 鐢ㄦ埛鐐瑰嚮浜嗐�愯繑鍥炲垪琛ㄣ�戞垨鑰呭嚭鐜伴敊璇�
+      return;
     }
   }
-  // 涓嶇type鏄笉鏄�2锛屾渶缁堥兘鎵ц缁撴潫妯℃嫙鐨勬搷浣�
+
+  // 涓嶇 type 鏄笉鏄� 2锛屾渶缁堥兘鎵ц缁撴潫妯℃嫙鎿嶄綔
   endSimulation();
 }
 
 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;

--
Gitblit v1.9.3