From ed436f333286d28af77d712ba7c26c61a0fe9fb5 Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期二, 01 七月 2025 16:08:30 +0800
Subject: [PATCH] 1

---
 src/utils/water.js                         |    2 +-
 src/components/monifangzhen/echartInfo.vue |    2 +-
 src/components/menu/TimeLine.vue           |   37 +++++++++++++++----------------------
 3 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/src/components/menu/TimeLine.vue b/src/components/menu/TimeLine.vue
index f30f68d..c27db28 100644
--- a/src/components/menu/TimeLine.vue
+++ b/src/components/menu/TimeLine.vue
@@ -668,24 +668,24 @@
   colorState.lastTime = currentTime.value;
   // ====== 鏂板锛氬湪 updateWaterColor 鍓嶆墦鍗板綋鍓嶄俊鎭� ======
   // // 鑾峰彇褰撳墠绱闄嶉洦閲�
-  // let currentTotal = null;
-  // const baseTimestamp = new Date(rainTotalInfo.value[0].time).getTime();
-  // const currentTimeMs = baseTimestamp + currentTime.value * 1000;
+  let currentTotal = null;
+  const baseTimestamp = new Date(rainTotalInfo.value[0].time).getTime();
+  const currentTimeMs = baseTimestamp + currentTime.value * 1000;
 
-  // // 鎵惧埌鏈�鎺ヨ繎鐨勯檷闆ㄦ暟鎹偣
-  // for (let i = rainTotalInfo.value.length - 1; i >= 0; i--) {
-  //   const dataTimeMs = new Date(rainTotalInfo.value[i].time).getTime();
-  //   if (dataTimeMs <= currentTimeMs) {
-  //     currentTotal = rainTotalInfo.value[i].total;
-  //     break;
-  //   }
-  // }
+  // 鎵惧埌鏈�鎺ヨ繎鐨勯檷闆ㄦ暟鎹偣
+  for (let i = rainTotalInfo.value.length - 1; i >= 0; i--) {
+    const dataTimeMs = new Date(rainTotalInfo.value[i].time).getTime();
+    if (dataTimeMs <= currentTimeMs) {
+      currentTotal = rainTotalInfo.value[i].total;
+      break;
+    }
+  }
 
-  // // 鎵撳嵃淇℃伅
+  // 鎵撳嵃淇℃伅
   // console.log("========================================");
-  // console.log(`銆愭椂闂存埑銆�: ${new Date(currentTimeMs).toLocaleString()}`);
-  // console.log(`銆愮疮璁¢檷闆ㄩ噺 R銆�: ${currentTotal !== null ? currentTotal.toFixed(2) : '鏈煡'} mm`);
-  // console.log(`銆愬綋鍓嶉樁娈点��: 绗� ${currentStage} 闃舵`);
+  console.log(`銆愭椂闂存埑銆�: ${new Date(currentTimeMs).toLocaleString()}`);
+  console.log(`銆愮疮璁¢檷闆ㄩ噺 R銆�: ${currentTotal !== null ? currentTotal.toFixed(2) : '鏈煡'} mm`);
+  console.log(`銆愬綋鍓嶉樁娈点��: 绗� ${currentStage} 闃舵`);
   // console.log(`銆愰鑹� HEX銆�: ${colorState.colorStages[currentStage]?.color || '鏈畾涔�'}`);
   // console.log(`銆愰�忔槑搴� Alpha銆�: ${colorState.colorStages[currentStage]?.alpha || '鏈畾涔�'}`);
   // console.log("========================================");
@@ -931,7 +931,6 @@
     }
 
     // console.log('鑾峰彇鍒扮殑 serviceName:', serviceInfo);
-
     // 鏍规嵁 layer.json 鑾峰彇鏃堕棿杞翠俊鎭�
     const {
       waterTimestamps: timestamps,
@@ -956,7 +955,6 @@
         "YYYY-MM-DD HH:mm:ss"
       );
     }
-
     minFlowRate = watersMinHeight;
     maxFlowRate = watersMaxHeight;
   } catch (error) {
@@ -973,9 +971,7 @@
   // 鍥犱负杩欎釜鍑芥暟瀹炴椂妯℃嫙鐩戝惉涔熼渶瑕佷娇鐢紝鎵�浠ュ皝瑁呬簡涓�涓嚱鏁�
   await initializeSimulationData();
 });
-
 const shouldAutoPlay = ref(false);
-
 // 鐩戝惉 layerDate 鍙樺寲鍚庢爣璁板噯澶囨挱鏀�
 watch(
   () => layerDate.value,
@@ -986,7 +982,6 @@
   },
   { deep: true }
 );
-
 // 绛夊緟 finishPlay 鎴愬姛鍚庡啀鎾斁
 watchEffect(() => {
   if (shouldAutoPlay.value && finishPlay.value && !isPlaying.value) {
@@ -995,7 +990,6 @@
     shouldAutoPlay.value = false;
   }
 });
-
 // 鏍规嵁杩斿洖鏁版嵁鐨勪釜鏁板幓娓叉煋鏃堕棿杞�
 function updateTimelineRange() {
   if (waterTimestamps.value.length > 0) {
@@ -1006,7 +1000,6 @@
     duration.value = (last - first) / 1000; // 姣杞
   }
 }
-
 onBeforeUnmount(() => {
   stopPlayback();
   destoryWaterPrimitive();
diff --git a/src/components/monifangzhen/echartInfo.vue b/src/components/monifangzhen/echartInfo.vue
index c2e4352..6def9dc 100644
--- a/src/components/monifangzhen/echartInfo.vue
+++ b/src/components/monifangzhen/echartInfo.vue
@@ -456,7 +456,7 @@
 
   const startUpdating = () => {
     if (updateInterval || dataIndex.value >= rainfallData.value.length) {
-      console.log("Animation already running or completed");
+      // console.log("Animation already running or completed");
       return;
     }
 
diff --git a/src/utils/water.js b/src/utils/water.js
index a58bd68..4338630 100644
--- a/src/utils/water.js
+++ b/src/utils/water.js
@@ -47,7 +47,7 @@
   ];
 
   const levelCount = colorStops.length;
-  const minAllowed = 0.005; // 鏈�灏忓厑璁稿��
+  const minAllowed = 0.05; // 鏈�灏忓厑璁稿��
   const threshold = 1; // 灏忓�间笌澶у�煎垎鐣岀偣
 
   let effectiveMin = Math.max(minFlowRate, minAllowed); // 鏈�灏忎笉鑳藉皬浜� 0.01

--
Gitblit v1.9.3