From 036647fcdc936273e78597408ee3fba09534ffd8 Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期一, 21 四月 2025 16:12:41 +0800
Subject: [PATCH] change

---
 src/views/mnfz.vue |   43 +++++++++++++++++++++----------------------
 1 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/src/views/mnfz.vue b/src/views/mnfz.vue
index fade2a7..7d8d533 100644
--- a/src/views/mnfz.vue
+++ b/src/views/mnfz.vue
@@ -1,23 +1,9 @@
 <template>
   <Left @start="startSimulate" @end="endSimulate" />
-  <echartInfo
-    :isDynamicMode="isDynamicMode"
-    :isFinish="isFinish"
-    v-if="rightRiverShow"
-  />
-  <TimeLine
-    v-if="showWaterSimulate"
-    @time-update="timeUpdate"
-    @is-playing="isPlaying"
-    :waterSimulateParams="waterSimulateParams"
-    @playbackFinished="playbackFinished"
-    @end="endSimulate"
-  />
-  <DebuffDetail
-    v-if="showDebuffDetail"
-    @open="openDetail"
-    @close="showDebuffDetail = false"
-  />
+  <echartInfo :isDynamicMode="isDynamicMode" :isFinish="isFinish" v-if="rightRiverShow" />
+  <TimeLine v-if="showWaterSimulate" @time-update="timeUpdate" @is-playing="isPlaying"
+    :waterSimulateParams="waterSimulateParams" @playbackFinished="playbackFinished" @end="endSimulate" />
+  <DebuffDetail v-if="showDebuffDetail" @open="openDetail" @close="showDebuffDetail = false" />
   <DebuffTable v-if="showDebuffTable" @close="closeDebuffTable" />
 </template>
 
@@ -121,7 +107,7 @@
     });
     await Promise.all(loadPromises);
     setupRowClickListener(dataSources);
-  } catch (error) {}
+  } catch (error) { }
 }
 // 娓呴櫎闅愭偅鐐�
 function removeDataSources() {
@@ -267,32 +253,41 @@
 }
 // 瀹氫箟鍏ㄥ眬鍙橀噺瀛樺偍褰撳墠姝e湪闂姩鐨勯潰鐗�
 let flashingPolygon = null;
+
 // 娣诲姞浜嬩欢鐩戝惉鍣紝鎺ユ敹鏉ヨ嚜琛ㄦ牸缁勪欢鐨勪簨浠�
 function setupRowClickListener(dataSources) {
   if (!Array.isArray(dataSources) || dataSources.length === 0) {
     console.error("Data sources array is undefined or empty!");
     return;
   }
-
   EventBus.on("row-clicked", (id) => {
     const clickedEntity = findEntityById(id, dataSources);
     if (clickedEntity) {
+      // 濡傛灉鐐瑰嚮鐨勬槸鍚屼竴涓疄浣擄紝鍒欏仠姝㈤棯鍔ㄥ苟娓呯┖閫夋嫨
+      if (flashingPolygon && flashingPolygon === clickedEntity) {
+        stopFlashing(flashingPolygon);
+        flashingPolygon = null; // 娓呯┖褰撳墠閫変腑鐨勫疄浣�
+        return;
+      }
+      // 濡傛灉鏈夊叾浠栧疄浣撴鍦ㄩ棯鍔紝鍏堝仠姝㈠畠鐨勯棯鍔�
       if (flashingPolygon && flashingPolygon !== clickedEntity) {
         stopFlashing(flashingPolygon);
       }
-
+      // 寮�濮嬫柊鐨勯棯鍔�
       startFlashing(clickedEntity);
       flashingPolygon = clickedEntity;
     } else {
+      console.warn(`No entity found with ID: ${id}`);
     }
   });
 }
+
+// 鏍规嵁ID鏌ユ壘瀹炰綋
 function findEntityById(id, dataSources) {
   if (!Array.isArray(dataSources) || dataSources.length === 0) {
     console.error("Data sources array is undefined or empty!");
     return null;
   }
-
   console.log("Searching for ID:", id);
   for (const dataSource of dataSources) {
     const entities = dataSource.entities.values;
@@ -305,11 +300,13 @@
   }
   return null;
 }
+
 // 寮�濮嬮棯鍔ㄦ晥鏋�
 function startFlashing(polygonEntity) {
   // 瀛樺偍鍘熷棰滆壊
   const originalColor = polygonEntity.polygon.material.color.getValue();
   polygonEntity._originalColor = originalColor; // 灏嗗師濮嬮鑹蹭繚瀛樺埌瀹炰綋涓�
+
   // 鍒涘缓棰滆壊鍙樺寲鐨勫洖璋冨嚱鏁�
   let isFlashing = true; // 鏍囪鏄惁姝e湪闂姩
   polygonEntity.polygon.material = new Cesium.ColorMaterialProperty(
@@ -323,6 +320,7 @@
         : originalColor;
     }, false)
   );
+
   // 灏嗛棯鍔ㄧ姸鎬佷繚瀛樺埌瀹炰綋涓婏紝渚夸簬鍚庣画鎺у埗
   polygonEntity._isFlashing = isFlashing;
 }
@@ -334,6 +332,7 @@
   polygonEntity.polygon.material = new Cesium.ColorMaterialProperty(
     originalColor
   );
+
   // 娓呯┖闂姩鐘舵��
   polygonEntity._isFlashing = false;
   polygonEntity._originalColor = null; // 娓呴櫎淇濆瓨鐨勫師濮嬮鑹�

--
Gitblit v1.9.3