From 629dd300a25adc9ebd76770363386fc8fd0dca52 Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期五, 04 七月 2025 11:13:53 +0800
Subject: [PATCH] 提交

---
 src/components/menu/TimeLine.vue |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/src/components/menu/TimeLine.vue b/src/components/menu/TimeLine.vue
index b92ddbe..902ee8f 100644
--- a/src/components/menu/TimeLine.vue
+++ b/src/components/menu/TimeLine.vue
@@ -319,7 +319,8 @@
 
   // 鏂板缓鏂规涓殑瀹炴椂妯℃嫙涓嶈兘鍊嶉��
   if (selectedScheme.value.type === 2 && simStore.rePlayList.length == 0) {
-    // 绫诲瀷涓� 2锛氭瘡 5 绉掕烦鍔ㄤ竴娆�
+    console.log("鏂板缓鏂规瀹炴椂妯℃嫙浜旂涓�璺�");
+    // 瀹炴椂妯℃嫙锛氭瘡 5 绉掕烦鍔ㄤ竴娆�
     playInterval = setInterval(() => {
       const fiveSeconds = 5;
       const totalDuration = duration.value; // 鎬绘椂闀匡紙绉掞級
@@ -364,6 +365,7 @@
         currentTime.value = duration.value;
         stopPlayback();
         isPlaying.value = false;
+        finishPlay.value = true;
         emit("isPlaying", false);
         emit("playbackFinished", true);
         return;
@@ -379,7 +381,17 @@
       }
 
       const progress = currentTime.value / duration.value;
-      emit("timeUpdate", progress * 100);
+      // if (
+      //   currentReplayIndex.value == simStore.rePlayList.length - 1 &&
+      //   selectedScheme.value.type === 2 &&
+      //   simStore.rePlayList.length > 0
+      // ) {
+      //   // 鍘嗗彶鍥炴斁鐩存帴缁�100
+      //   emit("timeUpdate", 100);
+      // }
+      if (selectedScheme.value.type !== 2) {
+        emit("timeUpdate", progress * 100);
+      }
     }, 1000 / playbackRate.value);
   }
 };
@@ -731,9 +743,15 @@
   // 鎵撳嵃淇℃伅
   // console.log("========================================");
   // console.log(`銆愭椂闂存埑銆�: ${new Date(currentTimeMs).toLocaleString()}`);
-  console.log(`銆愮疮璁¢檷闆ㄩ噺 R銆�: ${currentTotal !== null ? currentTotal.toFixed(2) : '鏈煡'} mm`);
+  console.log(
+    `銆愮疮璁¢檷闆ㄩ噺 R銆�: ${
+      currentTotal !== null ? currentTotal.toFixed(2) : "鏈煡"
+    } mm`
+  );
   // console.log(`銆愬綋鍓嶉樁娈点��: 绗� ${currentStage} 闃舵`);
-  console.log(`銆愰鑹� HEX銆�: ${colorState.colorStages[currentStage]?.color || '鏈畾涔�'}`);
+  console.log(
+    `銆愰鑹� HEX銆�: ${colorState.colorStages[currentStage]?.color || "鏈畾涔�"}`
+  );
   // console.log(`銆愰�忔槑搴� Alpha銆�: ${colorState.colorStages[currentStage]?.alpha || '鏈畾涔�'}`);
   // console.log("========================================");
   // 搴旂敤棰滆壊
@@ -1022,7 +1040,6 @@
     });
   }
 }
-
 // 鎾斁瀹屾垚鍚庣殑鍥炶皟
 function handlePlayFinished() {
   if (selectedScheme.value.type !== 2) return;
@@ -1030,8 +1047,6 @@
   currentReplayIndex.value++;
 
   if (currentReplayIndex.value < simStore.rePlayList.length) {
-    console.log(currentReplayIndex.value);
-
     // 鑷姩鎾斁涓嬩竴涓�
     initializeSimulationData(simStore.rePlayList[currentReplayIndex.value]);
     togglePlay();
@@ -1122,6 +1137,9 @@
 }
 
 async function endSimulation() {
+  // 缁撴潫妯℃嫙涔嬪悗娓呴櫎layer鍒楄〃
+  simStore.rePlayList = [];
+  console.log(simStore.rePlayList, "缁撴潫妯℃嫙娓呴櫎rePlayListrePlayList鍒楄〃");
   EventBus.emit("close-time");
   endSimulate();
   isWaterPrimitiveCreated.value = false;

--
Gitblit v1.9.3