wangjuncheng
6 天以前 f60f7c614e60221ed7c0ddb93c52608e86f4b57e
src/components/menu/TimeLine.vue
@@ -340,8 +340,9 @@
      }
      // 触发进度更新
      const progress = currentTime.value / totalDuration;
      emit("timeUpdate", progress * 100);
      // const progress = currentTime.value / totalDuration;
      // 实时模拟应该不用显示弹窗吧
      // emit("timeUpdate", progress * 100);
      // 如果需要触发某些更新函数,也可以保留
      updateWaterColorByTime();
@@ -1076,7 +1077,11 @@
watch(
  () => finishPlay.value,
  (newVal) => {
    if (newVal && selectedScheme.value.type === 2) {
    if (
      newVal &&
      selectedScheme.value.type === 2 &&
      simStore.rePlayList.length > 0
    ) {
      handlePlayFinished();
    }
  }
@@ -1130,32 +1135,33 @@
  if (selectedScheme.value.type === 2) {
    try {
      await ElMessageBox.confirm("方案未停止时结束模拟后,后台将停止计算", {
        confirmButtonText: "返回列表",
        cancelButtonText: "结束模拟",
        confirmButtonText: "结束模拟",
        cancelButtonText: "返回列表",
        type: "warning",
      });
      // 用户点击了确认,这里不执行任何操作,仅关闭对话框
      const res = await stopSim(selectedScheme.value.id);
      if (res.code == 404) {
        ElMessage.warning("该服务已停止");
      } else {
        ElMessage.success("服务正在停止中");
      }
    } catch (error) {
      stopSim(selectedScheme.value.id).then((res) => {
        if (res.code == 404) {
          ElMessage.warning("该服务已停止");
        } else {
          ElMessage.success("服务正在停止中");
        }
      });
      // 用户点击了【返回列表】或者出现错误
      // return;
    }
  }
  // 不管type是不是2,最终都执行结束模拟的操作
  // 不管 type 是不是 2,最终都执行结束模拟操作
  endSimulation();
}
async function endSimulation() {
  clearAllPoints();
  simStore.openDia = true;
  simStore.crossSection = [];
  // 结束模拟之后清除layer列表
  simStore.rePlayList = [];
  console.log(simStore.rePlayList, "结束模拟清除rePlayListrePlayList列表");
  EventBus.emit("close-time");
  endSimulate();
  isWaterPrimitiveCreated.value = false;