guonan
2025-04-18 fe14fbb369b1c960e4602e084646bd4554a63411
src/components/menu/TimeLine.vue
@@ -1,6 +1,7 @@
<template>
  <div class="timeline-container">
    <div class="controls">
      <!-- <div @click="endSimulate">结束模拟</div> -->
      <div class="control-btn" @click="skipBackward">
        <img
          src="@/assets/img/timeline/left.png"
@@ -74,6 +75,7 @@
  watch,
  defineProps,
  onBeforeUnmount,
  inject,
} from "vue";
import dayjs from "dayjs";
import { createWaterPrimitive, destoryWaterPrimitive } from "@/utils/water";
@@ -145,6 +147,7 @@
  if (!isPlaying.value && currentTime.value >= duration.value) {
    currentTime.value = 0;
    emit("timeUpdate", progressPercentage.value);
    // earthCtrl.environment.disableEffect("rain");
  }
  isPlaying.value = !isPlaying.value;
@@ -162,6 +165,7 @@
};
const startPlayback = () => {
  // earthCtrl.environment.showEffect("rain");
  clearInterval(playInterval);
  playInterval = setInterval(() => {
    currentTime.value += 600 * playbackRate.value;
@@ -183,6 +187,7 @@
};
const stopPlayback = () => {
  // earthCtrl.environment.disableEffect("rain");
  clearInterval(playInterval);
};
@@ -295,6 +300,7 @@
    destoryWaterPrimitive();
  }, delay);
});
const { startSimulate, endSimulate } = inject("simulateActions");
</script>
<style scoped>