guonan
2025-07-04 629dd300a25adc9ebd76770363386fc8fd0dca52
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;