From 7217e02e098b94e421b5a85ec13e0cd2ed35fbeb Mon Sep 17 00:00:00 2001
From: wangjuncheng <1>
Date: 星期五, 06 六月 2025 17:28:23 +0800
Subject: [PATCH] 1

---
 src/components/tools/Legend_mnfz.vue |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/components/tools/Legend_mnfz.vue b/src/components/tools/Legend_mnfz.vue
index 830cc25..f57a035 100644
--- a/src/components/tools/Legend_mnfz.vue
+++ b/src/components/tools/Legend_mnfz.vue
@@ -11,23 +11,19 @@
 </template>
 
 <script setup>
-import { onMounted, ref } from "vue";
+import { onMounted, watch, ref } from "vue";
+import { useSimStore } from "@/store/simulation";
+import { storeToRefs } from "pinia";
 
-// 瀹氫箟姘翠綅楂樺害鏁版嵁
-const waterHeightLevels = ref([
-  { height: 0.5, color: "#09a2dc" },
-  { height: 1.0, color: "#58c196" },
-  { height: 1.5, color: "#bedf74" },
-  { height: 2.0, color: "#d7f06e" },
-  { height: 2.5, color: "#ffe930" },
-  { height: 3.0, color: "#fdd10a" },
-  { height: 4.0, color: "#feb652" },
-  { height: 5.0, color: "#fd7f06" },
-  { height: 10.0, color: "#fe2b07" },
-  { height: 30.0, color: "#4d0a08" }
-]);
-onMounted(()=>{ 
-})
+const simStore = useSimStore();
+const { waterLegendData } = storeToRefs(simStore);
+const waterHeightLevels = ref([]);
+watch(waterLegendData, (newVal) => {
+  waterHeightLevels.value = newVal.map(item => ({ ...item }));
+}, { immediate: true });
+
+onMounted(() => {
+});
 </script>
 
 <style lang="less" scoped>

--
Gitblit v1.9.3