guonan
2025-06-19 d3e7a1953618d73ffb1a480cb7c6afda42246460
src/store/simulation.js
@@ -1,12 +1,17 @@
// stores/ui.js
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useSimStore = defineStore('simulation', () => {
    // 帧数
    const frameNum = ref(0)
    // 目录树选中
    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)
@@ -27,6 +32,8 @@
    const schemCard = ref([])
    const backToHome = ref(false)
    const selectedScheme = ref(null)
    // 当前模拟经纬度
    const currentInfo = ref({})
    // 图例
    const waterLegendData = ref([])
    // 模拟仿真图例
@@ -151,6 +158,12 @@
        }
    }
    const updateSelectedLayers = (keys) => {
        userSelectedLayers.value = keys;
    }
    return {
        // UI 状态
        navigationShow,
@@ -178,7 +191,11 @@
        DeviceShowSwitch,
        DangerShowSwitch,
        waterLegendData,
        currentInfo,
        isShowEarth,
        userSelectedLayers,
        devices,
        frameNum,
        // 方案相关方法
        setSchemCard,
@@ -199,5 +216,6 @@
        startMNFZ,
        startMNPG,
        handleNavClick,
        updateSelectedLayers
    }
})