From 479c2855f93517517037dd5805ba3512e9aec37d Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期二, 15 四月 2025 14:58:01 +0800 Subject: [PATCH] change --- src/store/simulation.js | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/src/store/simulation.js b/src/store/simulation.js index 5976841..8fd427c 100644 --- a/src/store/simulation.js +++ b/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, } }) \ No newline at end of file -- Gitblit v1.9.3