| | |
| | | <div>专题渲染: |
| | | <el-switch v-model="isColorRenderEnabled" @change="handleColorRenderChange" style="margin-top:-3px" |
| | | :disabled="!isPlaying || !isWaterPrimitiveCreated" /> |
| | | <!-- active-text="开" inactive-text="关" --> |
| | | <!-- active-text="开" inactive-text="关" --> |
| | | </div> |
| | | </div> |
| | | <div class="timeline-track" ref="timelineTrack" @click="seekToPosition"> |
| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <ratelevel ref="ratelevelRef" :playing-time="sendCurrentPlayingTime" @finish-calculation="handleFinishCalculation" |
| | | style="margin-top: 12px; margin-left: 28px; margin-right: 10px;justify-content: flex-end;"></ratelevel> |
| | | <el-button @click="handleBack" style="margin-top: 3px; margin-left: 30px; margin-right: 10px">结束模拟</el-button> |
| | | <div style="display: flex;"> |
| | | <ratelevel ref="ratelevelRef" :playing-time="sendCurrentPlayingTime" |
| | | @finish-calculation="handleFinishCalculation" |
| | | style="margin-top: 12px; margin-left: 28px; margin-right: 10px;justify-content: flex-end;" /> |
| | | <crossanalysis ref="crossRef" style="margin-top: 12px; margin-left: 16px; margin-right: 20px;justify-content: flex-end;" /> |
| | | </div> |
| | | <el-button @click="handleBack" style="margin-top: 3px; margin-left: 28px; margin-right: 10px;width: 75%;height: 30%;">结束模拟</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | reactive |
| | | } from "vue"; |
| | | import ratelevel from "@/components/menu/flowRate_waterLevel.vue"; |
| | | import crossanalysis from "@/components/menu/CrossSectionalAnalysis.vue"; |
| | | |
| | | import dayjs from "dayjs"; |
| | | import { |
| | |
| | | // 响应式状态 |
| | | let serviceInfo = ref(null); // 当前方案的服务地址 |
| | | const ratelevelRef = ref(null); // 获取子组件实例的引用 |
| | | const crossRef = ref(null); // 获取子组件实例的引用 |
| | | const currentPlayingTime = ref(""); // 当前播放时间 |
| | | const sendCurrentPlayingTime = ref(""); // 当前播放时间 |
| | | const isPlaying = ref(false); |
| | |
| | | size: 0.7, |
| | | speed: 40, |
| | | density: 35, |
| | | color: '#ADD8E6' |
| | | color: '#ADD8E6' |
| | | }, |
| | | { |
| | | name: '大雨', |
| | |
| | | size: 1.3, |
| | | speed: 90, |
| | | density: 80, |
| | | color: '#ADD8E6' |
| | | color: '#ADD8E6' |
| | | }, |
| | | { |
| | | name: '大暴雨', |
| | |
| | | let lastRainValue = null; |
| | | function updateWeatherByProgress() { |
| | | if (rainFallValues.value.length === 0) return; |
| | | console.log(`时间轴总时长: ${duration.value}, 当前时间: ${currentTime.value}`); // 打印时间轴信息 |
| | | // console.log(`时间轴总时长: ${duration.value}, 当前时间: ${currentTime.value}`); // 打印时间轴信息 |
| | | const progress = currentTime.value / duration.value; |
| | | const floatIndex = progress * (rainFallValues.value.length - 1); |
| | | const index = Math.floor(floatIndex); // 当前索引 |
| | |
| | | // console.log(`正在处理的雨量数据点: 当前=${currentRain}, 下一个=${nextRain}, 插值后=${rainValue.toFixed(2)}, 索引=${index}`); |
| | | // 如果当前索引未变化且插值差异不大,跳过重复更新 |
| | | if (index === lastUsedIndex && Math.abs(rainValue - lastRainValue) < 0.1) { |
| | | console.log('由于数据无显著变化,跳过本次更新'); |
| | | // console.log('由于数据无显著变化,跳过本次更新'); |
| | | return; |
| | | } |
| | | |
| | |
| | | rainDensity: rainLevel.density, |
| | | rainColor: rainLevel.color |
| | | }; |
| | | console.log('当前雨量数据:', rainValue, '当前雨形:', rainLevel); |
| | | // console.log('当前雨量数据:', rainValue, '当前雨形:', rainLevel); |
| | | // 调用工具方法更新雨效 |
| | | mapUtils.toggleRain(rainParams, true); |
| | | } |
| | |
| | | clearInterval(playInterval); |
| | | }; |
| | | |
| | | const skipForward = () => |
| | | (currentTime.value = Math.min(currentTime.value + 1, duration.value)); // 向前跳转1秒 |
| | | const skipForward = () => { |
| | | if (waterTimestamps.value.length === 0) return; |
| | | const currentIndex = findClosestTimestampIndex(currentTime.value); |
| | | const nextIndex = currentIndex + 1; |
| | | if (nextIndex >= waterTimestamps.value.length) { |
| | | return; |
| | | } |
| | | const baseTimestamp = waterTimestamps.value[0]; |
| | | currentTime.value = (waterTimestamps.value[nextIndex] - baseTimestamp) / 1000; |
| | | setTimeForWaterSimulation(nextIndex); |
| | | if (!isPlaying.value) pauseWaterSimulation(); |
| | | }; |
| | | |
| | | const skipBackward = () => |
| | | (currentTime.value = Math.max(currentTime.value - 1, 0)); // 向后跳转1秒 |
| | | |
| | | const skipBackward = () => { |
| | | if (waterTimestamps.value.length === 0) return; |
| | | const currentIndex = findClosestTimestampIndex(currentTime.value); |
| | | const prevIndex = currentIndex - 1; |
| | | if (prevIndex < 0) { |
| | | return; |
| | | } |
| | | const baseTimestamp = waterTimestamps.value[0]; |
| | | currentTime.value = (waterTimestamps.value[prevIndex] - baseTimestamp) / 1000; |
| | | setTimeForWaterSimulation(prevIndex); |
| | | if (!isPlaying.value) pauseWaterSimulation(); |
| | | }; |
| | | const toggleSpeedMenu = () => (showSpeedMenu.value = !showSpeedMenu.value); |
| | | |
| | | // 设置播放速率 |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 根据返回数据的个数去渲染时间轴 |
| | | function updateTimelineRange() { |
| | | if (waterTimestamps.value.length > 0) { |
| | | const [first, last] = [ |
| | |
| | | isWaterPrimitiveCreated.value = false; |
| | | if (ratelevelRef.value) { |
| | | ratelevelRef.value.endCalculation(); |
| | | ratelevelRef.value.stopPicking(); |
| | | } |
| | | if (crossRef.value) { |
| | | crossRef.value.clearPoints(); |
| | | } |
| | | emit("isColorRender", false); |
| | | setTimeout(() => { |
| | |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | z-index: 99; |
| | | width: 38%; |
| | | width: 44%; |
| | | height: 10%; |
| | | /* background-color: #1a2634; */ |
| | | background: url("@/assets/img/menubar/bar.png"); |
| | |
| | | .timeline { |
| | | margin-top: 10px; |
| | | position: relative; |
| | | flex: 1; |
| | | flex: 0.9; |
| | | } |
| | | |
| | | .dates { |