123
wangjuncheng
2025-06-16 4b7b8185bdce4272cd5f256fcc777056f54add6d
src/components/menu/TimeLine.vue
@@ -58,10 +58,12 @@
        <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;" />
        <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>
      <el-button @click="handleBack"
        style="margin-top: 3px; margin-left: 28px; margin-right: 10px;width: 75%;height: 30%;">结束模拟</el-button>
    </div>
  </div>
@@ -136,8 +138,8 @@
  rainColor: "#99B3CC",
  rainDensity: 30 // 雨的密度
});
let minFlowRate =ref()
let maxFlowRate =ref()
let minFlowRate = ref()
let maxFlowRate = ref()
// 计算属性
const progressPercentage = computed(
  () => (currentTime.value / duration.value) * 100
@@ -167,8 +169,8 @@
        // baseUrl: `/simu/c2h1dc`,
        interval: intervalMap[playbackRate.value],
        colorRender: isColorRenderEnabled.value,
        minFlowRate:0.1,
        maxFlowRate:10,
        minFlowRate,
        maxFlowRate,
      });
      isWaterPrimitiveCreated.value = true;
    } else {
@@ -545,12 +547,13 @@
    // 当前方案的所有信息
    const schemeInfo = selectedScheme.value;
    serviceInfo = schemeInfo.serviceName;
    // minFlowRate = schemeInfo.最小水深
    // maxFlowRate = schemeInfo.最大水深
    // console.log('获取到的 serviceName:', serviceInfo);
    getRainfallData()
    // 根据layer.json去获取时间轴信息
    const { waterTimestamps: timestamps } = await fetchWaterSimulationData(serviceInfo);
    const { waterTimestamps: timestamps, watersMaxHeight, watersMinHeight } = await fetchWaterSimulationData(serviceInfo);
    console.log('当前方案下的最大水位深度和最小水位深度',watersMaxHeight,watersMinHeight);
    // 现在是按照总共有多少个点来渲染时间轴
    if (timestamps) {
      waterTimestamps.value = timestamps;
@@ -561,6 +564,8 @@
        "YYYY-MM-DD HH:mm:ss"
      );
    }
    minFlowRate = watersMinHeight
    maxFlowRate = watersMaxHeight
  } catch (error) {
    console.error("Error loading water simulation data:", error);
    ElMessage({
@@ -596,7 +601,7 @@
  if (crossRef.value) {
    crossRef.value.clearPoints();
    console.log('执行删除点功能');
  }
  emit("isColorRender", false);
  setTimeout(() => {
@@ -604,6 +609,8 @@
  }, 3000);
  destoryWaterPrimitive();
  EventBus.emit("hide-schemeInfo");
  EventBus.emit("clear-water-depth");
  EventBus.emit("clear-water-velocity");
  ElMessage({ message: "模拟进程正在关闭中...", type: "success" });
}
</script>