wangjuncheng
7 天以前 bf0eb543e2deab8a1629dd2a46f8e1cd191531e1
src/components/tools/DebuffDetail.vue
@@ -18,8 +18,8 @@
import { storeToRefs } from "pinia";
const simStore = useSimStore();
const { selectedScheme } = storeToRefs(simStore);
const { selectedScheme, schemWaterInfo } = storeToRefs(simStore);
// schemWaterInfo
// 隐患点
const filteredData = simStore.DangerPoint.filter((item) =>
  item.position?.includes("孙胡沟")
@@ -39,10 +39,10 @@
    name: "最大水深:",
    value: "1.86 m",
  },
  {
    name: "最大流速:",
    value: "7 m/s",
  },
  // {
  //   name: "最大流速:",
  //   value: "7 m/s",
  // },
  {
    name: "威胁房数:",
    value: "406 间",
@@ -113,24 +113,27 @@
  }
  if (selectedScheme.value.type !== 2) {
    const rainfallList = data.rainfalls;
    // console.log(schemWaterInfo.value,'这里是所有的方案数据');
    // const rainfallList = data.rainfalls;
    // 提取 intensity 值
    const rainValues = rainfallList.map((r) => r.intensity);
    const minRain = Math.min(...rainValues);
    const maxRain = Math.max(...rainValues);
    const avgRain =
      rainValues.reduce((sum, val) => sum + val, 0) / rainValues.length;
    // const rainValues = rainfallList.map((r) => r.intensity);
    // const minRain = Math.min(...rainValues);
    // const maxRain = Math.max(...rainValues);
    // const avgRain =
    //   rainValues.reduce((sum, val) => sum + val, 0) / rainValues.length;
    // 更新 detailList 中的“最大雨强”和“平均雨强”
    detailList.value[0].value = maxRain.toFixed(2) + " mm/h"; // 最大雨强
    detailList.value[1].value = avgRain.toFixed(2) + " mm/h"; // 平均雨强
    detailList.value[0].value = schemWaterInfo.value[1].toFixed(2) + " mm/h"; // 最大雨强
    detailList.value[1].value = schemWaterInfo.value[2].toFixed(2) + " mm/h"; // 平均雨强
    detailList.value[2].value = schemWaterInfo.value[0].toFixed(2) + " m"; // 最大水深
    console.log(
      "当前方案下最小雨量、最大雨量、平均雨量:",
      minRain.toFixed(2),
      maxRain.toFixed(2),
      avgRain.toFixed(2)
      "当前方案下最大水深、最大雨量、平均雨量:",
      schemWaterInfo.value[0].toFixed(2),
      schemWaterInfo.value[1].toFixed(2),
      schemWaterInfo.value[2].toFixed(2)
    );
  }
};
@@ -149,7 +152,7 @@
// 生命周期钩子
onMounted(() => {
  console.log(filteredData);
  // console.log(filteredData);
  updateThreatData();
  getRainfallData();
});