From b769ee78055cfd89a5866925571d1c10e23882cc Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期二, 08 七月 2025 11:32:50 +0800
Subject: [PATCH] 1111

---
 src/components/menu/TimeLine.vue      |   94 ++++++++++++++++------------------------------
 src/components/tools/DebuffDetail.vue |   23 +++++------
 2 files changed, 44 insertions(+), 73 deletions(-)

diff --git a/src/components/menu/TimeLine.vue b/src/components/menu/TimeLine.vue
index 42f2e16..0337415 100644
--- a/src/components/menu/TimeLine.vue
+++ b/src/components/menu/TimeLine.vue
@@ -2,30 +2,20 @@
   <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" v-show="speedShow">
         <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>
@@ -35,33 +25,19 @@
     <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>
           涓撻娓叉煋:
-          <el-switch
-            v-model="isColorRenderEnabled"
-            @change="handleColorRenderChange"
-            style="margin-top: -3px"
-            :disabled="!isPlaying || !isWaterPrimitiveCreated"
-          />
+          <el-switch v-model="isColorRenderEnabled" @change="handleColorRenderChange" style="margin-top: -3px"
+            :disabled="!isPlaying || !isWaterPrimitiveCreated" />
           <!-- active-text="寮�" inactive-text="鍏�" -->
         </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="scale-markers">
           <div class="scale-marker" style="left: 0%"></div>
           <div class="scale-marker" style="left: 25%"></div>
@@ -70,12 +46,8 @@
           <div class="scale-marker" style="left: 100%"></div>
         </div>
         <div class="time-markers">
-          <div
-            v-for="(time, index) in timeMarkers"
-            :key="index"
-            class="time-marker"
-            :style="{ left: `${index * 25}%`, transform: 'translateX(-50%)' }"
-          >
+          <div v-for="(time, index) in timeMarkers" :key="index" class="time-marker"
+            :style="{ left: `${index * 25}%`, transform: 'translateX(-50%)' }">
             <div class="date-part">{{ time.split(" ")[0] }}</div>
             <div class="time-part">{{ time.split(" ")[1] }}</div>
           </div>
@@ -84,38 +56,27 @@
     </div>
     <div>
       <div style="display: flex">
-        <ratelevel
-          ref="ratelevelRef"
-          :playing-time="sendCurrentPlayingTime"
-          @finish-calculation="handleFinishCalculation"
-          style="
+        <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="
+          " />
+        <crossanalysis ref="crossRef" style="
             margin-top: 12px;
             margin-left: 16px;
             margin-right: 20px;
             justify-content: flex-end;
-          "
-        />
+          " />
       </div>
-      <el-button
-        @click="handleBack"
-        style="
+      <el-button @click="handleBack" style="
           margin-top: 3px;
           margin-left: 28px;
           margin-right: 10px;
           width: 75%;
           height: 30%;
-        "
-        >缁撴潫妯℃嫙</el-button
-      >
+        ">缁撴潫妯℃嫙</el-button>
     </div>
   </div>
 </template>
@@ -153,7 +114,7 @@
 import { useSimStore } from "@/store/simulation";
 import { storeToRefs } from "pinia";
 const simStore = useSimStore();
-const { selectedScheme, frameNum, layerDate,schemWaterInfo } = storeToRefs(simStore);
+const { selectedScheme, frameNum, layerDate, schemWaterInfo } = storeToRefs(simStore);
 
 const emit = defineEmits([
   "timeUpdate",
@@ -391,6 +352,7 @@
 // 闄嶉洦鏁版嵁鐩稿叧鍙橀噺
 let rainFallValues = ref([]); // 瀛樺偍鍘熷闄嶉洦閲忔暟鎹�
 let minRainValue = ref(Infinity);
+let averageRainIntensity = ref()
 let maxRainValue = ref(-Infinity);
 // 鑾峰彇闄嶉洦鏁版嵁
 function getRainfallData() {
@@ -471,6 +433,16 @@
 
   // 鎻愬彇 intensity 鍊�
   rainFallValues.value = hourlyRainfallList.map((r) => r.intensity);
+  // 璁$畻骞冲潎闆ㄥ己
+  if (rainFallValues.value.length > 0) {
+    const sumIntensity = rainFallValues.value.reduce((sum, val) => sum + val, 0);
+    averageRainIntensity.value = sumIntensity / rainFallValues.value.length;
+  } else {
+    averageRainIntensity.value = 0; // 鎴栬�� null 琛ㄧず鏃犳暟鎹�
+  }
+
+  console.log("骞冲潎闆ㄥ己涓猴細", averageRainIntensity.value);
+
   minRainValue.value = Math.min(...rainFallValues.value);
   maxRainValue.value = Math.max(...rainFallValues.value);
 
@@ -479,6 +451,7 @@
     minRainValue.value,
     maxRainValue.value
   );
+
 }
 // 瀹氫箟闄嶉洦绛夌骇鍙婂叾瀵瑰簲鐨勮瑙夊弬鏁�
 const rainLevels = [
@@ -736,8 +709,7 @@
   // console.log("========================================");
   // console.log(`銆愭椂闂存埑銆�: ${new Date(currentTimeMs).toLocaleString()}`);
   console.log(
-    `銆愮疮璁¢檷闆ㄩ噺 R銆�: ${
-      currentTotal !== null ? currentTotal.toFixed(2) : "鏈煡"
+    `銆愮疮璁¢檷闆ㄩ噺 R銆�: ${currentTotal !== null ? currentTotal.toFixed(2) : "鏈煡"
     } mm`
   );
   // console.log(`銆愬綋鍓嶉樁娈点��: 绗� ${currentStage} 闃舵`);
@@ -1010,7 +982,7 @@
       watersMaxHeight,
       watersMinHeight
     );
-    const waterInfoArr = [watersMaxHeight]
+    const waterInfoArr = [watersMaxHeight, maxRainValue.value,averageRainIntensity.value]
     schemWaterInfo.value = waterInfoArr
     // 鏇存柊鏃堕棿杞寸浉鍏虫暟鎹�
     if (timestamps) {
diff --git a/src/components/tools/DebuffDetail.vue b/src/components/tools/DebuffDetail.vue
index fb841b2..22b75b8 100644
--- a/src/components/tools/DebuffDetail.vue
+++ b/src/components/tools/DebuffDetail.vue
@@ -113,27 +113,26 @@
   }
 
   if (selectedScheme.value.type !== 2) {
-    console.log(schemWaterInfo.value[0],'杩欓噷鏄墍鏈夌殑鏂规鏁版嵁');
+    // console.log(schemWaterInfo.value,'杩欓噷鏄墍鏈夌殑鏂规鏁版嵁');
     
-    const rainfallList = data.rainfalls;
-
+    // 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(
       "褰撳墠鏂规涓嬫渶澶ф按娣便�佹渶澶ч洦閲忋�佸钩鍧囬洦閲忥細",
       schemWaterInfo.value[0].toFixed(2),
-      maxRain.toFixed(2),
-      avgRain.toFixed(2)
+      schemWaterInfo.value[1].toFixed(2),
+      schemWaterInfo.value[2].toFixed(2)
     );
   }
 };

--
Gitblit v1.9.3