From d9c26a8b8b4336c53696b96d0ce3340758597777 Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期二, 22 四月 2025 15:10:22 +0800
Subject: [PATCH] 增加接口

---
 src/store/simulation.js |   47 +++++------------------------------------------
 1 files changed, 5 insertions(+), 42 deletions(-)

diff --git a/src/store/simulation.js b/src/store/simulation.js
index 35b8ab9..5007810 100644
--- a/src/store/simulation.js
+++ b/src/store/simulation.js
@@ -3,7 +3,7 @@
 import { ref } from 'vue'
 import { createSimData } from '@/api/trApi';
 
-export const useSimStore = defineStore('ui', () => {
+export const useSimStore = defineStore('simulation', () => {
     // 鎵�鏈塙I鐘舵��
     const navigationShow = ref(true)
     const leftShow = ref(false)
@@ -25,7 +25,6 @@
     const showLayerTree = ref(true)
     const showDangerAssess = ref(false)
     const schemCard = ref([])
-    const selectTab = ref("琛屾斂鍖哄垝浠跨湡")
     const backToHome = ref(false)
 
     // 鍒濆鍖栨柟娉�
@@ -47,42 +46,6 @@
         showResultAssess.value = false
         showDangerAssess.value = false
         schemCard.value = []
-        selectTab.value = "琛屾斂鍖哄垝浠跨湡"
-
-    }
-
-    const handleClickTab = (data) => {
-        selectTab.value = data
-    }
-
-    // 鏂板缓鏂规
-    const createSimulation = async (forms) => {
-        const getAreaType = (tabName) => {
-            switch (tabName) {
-                case '琛屾斂鍖哄垝浠跨湡':
-                    return 1
-                case '閲嶇偣鍖哄煙浠跨湡':
-                    return 2
-                case '閲嶇偣娌熶豢鐪�':
-                    return 3
-                default:
-                    return 0 // 鑷畾涔�
-            }
-        }
-        const params = {
-            areaType: getAreaType(selectTab),
-            createTime: Date.now(),
-            name: forms.name,
-            // 1涓洪娴嬫ā鎷燂紝2涓哄疄鏃舵ā鎷燂紝3涓哄巻鍙叉ā鎷�
-            type: 1,
-            // 0涓哄垱寤轰豢鐪燂紝1涓洪澶勭悊锛�2涓哄垎鏋愪腑锛�10涓哄畬鎴愶紝20涓哄嚭閿�
-            status: 0,
-        }
-        try {
-            await createSimData(params)
-        } catch (error) {
-            console.error('鍒涘缓浠跨湡澶辫触:', error)
-        }
     }
 
     // 鏂规鐩稿叧
@@ -172,7 +135,8 @@
         showLayerTree,
         showDangerAssess,
         schemCard,
-        selectTab,
+        // selectTab,
+        backToHome,
         handleNavClick,
         init,
         startYHGL,
@@ -183,9 +147,8 @@
         addSchemCard,
         removeSchemCardItem,
         updateSchemCardItem,
-        handleClickTab,
-        createSimulation,
-        backToHome,
+        // handleClickTab,
+        // createSimulation,
         setBackToHome
     }
 })
\ No newline at end of file

--
Gitblit v1.9.3