| | |
| | | <div class="timeline-container"> |
| | | <div class="controls"> |
| | | <div class="control-btn" @click="skipBackward"> |
| | | <img |
| | | src="@/assets/img/timeline/left.png" |
| | | class="fas fa-step-backward" |
| | | /> |
| | | <img src="@/assets/img/timeline/left.png" class="fas fa-step-backward" /> |
| | | </div> |
| | | <div class="control-btn play-btn" @click="togglePlay"> |
| | | <img v-show="isPlaying" src="@/assets/img/timeline/stop.png" /> |
| | | <img v-show="!isPlaying" src="@/assets/img/timeline/start.png" /> |
| | | </div> |
| | | <div class="control-btn" @click="skipForward"> |
| | | <img |
| | | src="@/assets/img/timeline/right.png" |
| | | class="fas fa-step-forward" |
| | | /> |
| | | <img src="@/assets/img/timeline/right.png" class="fas fa-step-forward" /> |
| | | </div> |
| | | <div class="speed-control"> |
| | | <div @click="toggleSpeedMenu">{{ playbackRate }}X</div> |
| | | <div class="speed-menu" v-show="showSpeedMenu"> |
| | | <div |
| | | v-for="rate in playbackRates" |
| | | :key="rate" |
| | | @click.capture="setPlaybackRate(rate)" |
| | | :class="{ active: playbackRate === rate }" |
| | | > |
| | | <div v-for="rate in playbackRates" :key="rate" @click.capture="setPlaybackRate(rate)" |
| | | :class="{ active: playbackRate === rate }"> |
| | | {{ rate }}X |
| | | </div> |
| | | </div> |
| | |
| | | <div class="timeline"> |
| | | <div class="dates"> |
| | | <div class="current-date">当前播放时间:{{ currentPlayingTime }}</div> |
| | | <div |
| | | v-for="(date, index) in visibleDates" |
| | | :key="index" |
| | | class="date-label" |
| | | > |
| | | <div v-for="(date, index) in visibleDates" :key="index" class="date-label"> |
| | | <!-- {{ formatDate(date) }} --> |
| | | </div> |
| | | </div> |
| | | <div class="timeline-track" ref="timelineTrack" @click="seekToPosition"> |
| | | <div |
| | | class="timeline-progress" |
| | | :style="{ width: progressPercentage + '%' }" |
| | | ></div> |
| | | <div |
| | | class="timeline-cursor" |
| | | :style="{ left: progressPercentage + '%' }" |
| | | ></div> |
| | | <div class="timeline-progress" :style="{ width: progressPercentage + '%' }"></div> |
| | | <div class="timeline-cursor" :style="{ left: progressPercentage + '%' }"></div> |
| | | <div class="time-markers"> |
| | | <div |
| | | v-for="(time, index) in timeMarkers" |
| | | :key="index" |
| | | class="time-marker" |
| | | > |
| | | <div v-for="(time, index) in timeMarkers" :key="index" class="time-marker"> |
| | | {{ time }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-button |
| | | @click="handleBack" |
| | | style="margin-top: 26px; margin-left: 30px; margin-right: 10px" |
| | | >结束模拟</el-button |
| | | > |
| | | <el-button @click="handleBack" style="margin-top: 26px; margin-left: 30px; margin-right: 10px">结束模拟</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { EventBus } from "@/eventBus"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { useSimStore } from '@/store/simulation' |
| | | import { storeToRefs } from 'pinia' |
| | | import { storeToRefs } from 'pinia' |
| | | const simStore = useSimStore() |
| | | const { selectedScheme } = storeToRefs(simStore) |
| | | |
| | |
| | | startPlayback(); |
| | | if (!isWaterPrimitiveCreated.value) { |
| | | // 第一次播放时创建水体模拟层 |
| | | console.log(selectedScheme.value,'这里是当前方案的全部信息'); |
| | | |
| | | createWaterPrimitive({ interval: intervalMap[playbackRate.value] }); |
| | | |
| | | console.log(selectedScheme.value, '这里是当前方案的全部信息'); |
| | | |
| | | createWaterPrimitive({ interval: intervalMap[playbackRate.value], baseUrl: "/simu/c2h1dc",}); |
| | | isWaterPrimitiveCreated.value = true; // 标记为已创建 |
| | | } else { |
| | | // 后续播放时调用恢复接口 |
| | |
| | | |
| | | return closestIndex; |
| | | } |
| | | |
| | | watch( |
| | | () => selectedScheme.value, |
| | | (newVal) => { |
| | | if (newVal) { |
| | | console.log('选中方案已改变:', newVal) |
| | | // 你可以触发一些逻辑,比如调接口等 |
| | | } |
| | | } |
| | | ) |
| | | watch( |
| | | () => currentTime.value, |
| | | () => { |
| | | if (waterTimestamps.value.length > 0) { |