wangjuncheng
2025-04-15 479c2855f93517517037dd5805ba3512e9aec37d
src/store/simulation.js
@@ -23,6 +23,7 @@
    const showResultAssess = ref(false)
    const showLayerTree = ref(true)
    const showDangerAssess = ref(false)
    const schemCard = ref([])
    // 初始化方法
    const init = () => {
@@ -41,6 +42,31 @@
        deviceShow.value = false
        showResultAssess.value = false
        showDangerAssess.value = false
        schemCard.value = []
    }
    // 方案相关
    const setSchemCard = (data) => {
        schemCard.value = data
        console.log(schemCard,'aaaaaaaaaaaaaa');
    }
    // 添加单个方案数据
    const addSchemCardItem = (item) => {
        schemCard.value.push(item)
    }
    // 删除指定方案数据
    const removeSchemCardItem = (id) => {
        schemCard.value = schemCard.value.filter(item => item.id !== id)
    }
    // 更新指定方案数据
    const updateSchemCardItem = (id, newData) => {
        const index = schemCard.value.findIndex(item => item.id === id)
        if (index !== -1) {
            schemCard.value[index] = { ...schemCard.value[index], ...newData }
        }
    }
@@ -109,6 +135,11 @@
        startYHGL,
        startZHJC,
        startMNFZ,
        startMNPG
        startMNPG,
        schemCard,
        setSchemCard,
        addSchemCardItem,
        removeSchemCardItem,
        updateSchemCardItem,
    }
})