guonan
2025-06-10 2280e8be717608bb36c3cf921f129db24349396d
src/store/simulation.js
@@ -1,12 +1,15 @@
// stores/ui.js
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useSimStore = defineStore('simulation', () => {
    // 目录树选中
    const userSelectedLayers = ref([])
    // 隐患点列表
    const DeviceShowSwitch = ref(true)
    const DangerShowSwitch = ref(true)
    const DeviceShowSwitch = ref(false)
    const DangerShowSwitch = ref(false)
    const DangerPoint = ref([])
    // 监测设备列表
    const devices = ref([])
    const navigationShow = ref(true)
    const leftShow = ref(false)
    const rightShow = ref(false)
@@ -23,12 +26,14 @@
    const weatherShow = ref(false)
    const barShow = ref(false)
    const deviceShow = ref(false)
    const showResultAssess = ref(false)
    const showLayerTree = ref(true)
    const showDangerAssess = ref(false)
    const schemCard = ref([])
    const backToHome = ref(false)
    const selectedScheme = ref(null)
    // 图例
    const waterLegendData = ref([])
    // 模拟仿真图例
    const isShowEarth = ref(false)
    // 降雨数据列表
    const rainFalls = ref()
    // 降雨单位
@@ -58,8 +63,6 @@
        rightRiverShow.value = false
        showPreview.value = false
        deviceShow.value = false
        showResultAssess.value = false
        showDangerAssess.value = false
        schemCard.value = []
    }
@@ -102,24 +105,31 @@
        init()
        flyToHomeView()
        locationShow.value = true
        isShowEarth.value = true
    }
    const startZHJC = () => {
        init()
        flyToHomeView()
        functionShow.value = true
        deviceShow.value = true
        isShowEarth.value = true
    }
    const startMNFZ = () => {
        init()
        flyToHomeView()
        leftShow.value = true
        // rightRiverShow.value = true
        isShowEarth.value = false
    }
    const startMNPG = () => {
        init()
        // showResultAssess.value = true
        // showDangerAssess.value = true
        isShowEarth.value = false
    }
    const setBackToHome = (value) => {
@@ -144,6 +154,12 @@
        }
    }
    const updateSelectedLayers = (keys) => {
        userSelectedLayers.value = keys;
    }
    return {
        // UI 状态
        navigationShow,
@@ -162,9 +178,7 @@
        weatherShow,
        barShow,
        deviceShow,
        showResultAssess,
        showLayerTree,
        showDangerAssess,
        schemCard,
        backToHome,
        rainFalls,
@@ -172,6 +186,10 @@
        DangerPoint,
        DeviceShowSwitch,
        DangerShowSwitch,
        waterLegendData,
        isShowEarth,
        userSelectedLayers,
        devices,
        // 方案相关方法
        setSchemCard,
@@ -192,5 +210,6 @@
        startMNFZ,
        startMNPG,
        handleNavClick,
        updateSelectedLayers
    }
})