From f37845dd0a787dd42bf6c72e923433f30fcd8cc3 Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期四, 03 七月 2025 15:40:09 +0800
Subject: [PATCH] 实时模拟

---
 src/store/simulation.js |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/src/store/simulation.js b/src/store/simulation.js
index aad1e40..a1b2f8a 100644
--- a/src/store/simulation.js
+++ b/src/store/simulation.js
@@ -2,11 +2,20 @@
 import { defineStore } from 'pinia'
 import { ref } from 'vue'
 export const useSimStore = defineStore('simulation', () => {
-
+    // 鍘嗗彶鍥炴斁鍒楄〃
+    const rePlayList = ref([])
+    // 鍖椾含甯傛墍鏈夋潙鐨刢ode
+    const townCodeAll = ref([])
+    // 瀹炴椂妯℃嫙鏈�鏂扮殑layer
+    const layerDate = ref("")
+    // 甯ф暟
+    const frameNum = ref(0)
+    // 鐩綍鏍戦�変腑
+    const userSelectedLayers = ref([])
     // 闅愭偅鐐瑰垪琛�
-    const DangerPoint = ref([])
     const DeviceShowSwitch = ref(false)
     const DangerShowSwitch = ref(false)
+    const DangerPoint = ref([])
     // 鐩戞祴璁惧鍒楄〃
     const devices = ref([])
     const navigationShow = ref(true)
@@ -40,11 +49,22 @@
     // 闄嶉洦鍗曚綅
     const intensityUnit = ref()
     const setSelectedScheme = (scheme) => {
-        selectedScheme.value = scheme
-        rainFalls.value = JSON.parse(scheme.data).rainfalls
-        intensityUnit.value = JSON.parse(scheme.data).intensityUnit
-        console.log(intensityUnit.value, 'shceme')
-    }
+        selectedScheme.value = scheme;
+
+        try {
+            const parsedData = JSON.parse(scheme.data);
+
+            // 鍙湁褰� rainfalls 鍜� intensityUnit 瀛樺湪涓旈潪绌烘椂鎵嶈祴鍊�
+            if (parsedData.rainfalls && parsedData.intensityUnit) {
+                rainFalls.value = parsedData.rainfalls;
+                intensityUnit.value = parsedData.intensityUnit;
+            } else {
+                console.warn("缂哄皯蹇呰鐨� rainfalls 鎴� intensityUnit 瀛楁");
+            }
+        } catch (error) {
+            console.error("瑙f瀽 scheme.data 鍑洪敊", error);
+        }
+    };
     const clearSelectedScheme = () => {
         selectedScheme.value = null
     }
@@ -155,7 +175,9 @@
         }
     }
 
-
+    const updateSelectedLayers = (keys) => {
+        userSelectedLayers.value = keys;
+    }
 
 
 
@@ -188,7 +210,11 @@
         waterLegendData,
         currentInfo,
         isShowEarth,
+        userSelectedLayers,
         devices,
+        frameNum,
+        layerDate,
+        rePlayList,
 
         // 鏂规鐩稿叧鏂规硶
         setSchemCard,
@@ -209,5 +235,6 @@
         startMNFZ,
         startMNPG,
         handleNavClick,
+        updateSelectedLayers
     }
 })
\ No newline at end of file

--
Gitblit v1.9.3