1
wangjuncheng
2025-06-06 7217e02e098b94e421b5a85ec13e0cd2ed35fbeb
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>