From 7c99be35803568d4743a8d134b0479bbf6f281fd Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 07 十一月 2024 00:58:52 +0800
Subject: [PATCH] 删除工艺更新

---
 src/store/modules/multipleTab.ts |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts
index 2fd6736..69cdd67 100644
--- a/src/store/modules/multipleTab.ts
+++ b/src/store/modules/multipleTab.ts
@@ -14,6 +14,8 @@
 
 import projectSetting from '@/settings/projectSetting';
 import { useUserStore } from '@/store/modules/user';
+import { useProdRouteStore } from './prodRoute';
+import { isNullOrUnDef } from '/@/utils/is';
 
 export interface MultipleTabState {
   cacheTabList: Set<string>;
@@ -85,6 +87,17 @@
       const { currentRoute } = router;
       const route = unref(currentRoute);
       const name = route.name;
+      const useProdRoute = useProdRouteStore();
+      useProdRoute.setChangeToCPPage(false);
+      if (!isNullOrUnDef(route.params.id)) {
+        // 浠巗essionStorage涓鍙栧弬鏁板苟杞崲鍥炲璞�
+        const savedParams = sessionStorage.getItem(
+          `${JSON.parse(decodeURI(route.params.id[0]))['sName']}_params`,
+        );
+        const objParams = savedParams ? JSON.parse(decodeURI(savedParams)) : {};
+        useProdRoute.setCurProdRotTree({ name: objParams['CODE'], treeInfo: [] });
+        useProdRoute.setCurSelectedNodes({ name: objParams['CODE'], SelectedNodes: [] });
+      }
 
       const findTab = this.getCachedTabList.find((item) => item === name);
       if (findTab) {
@@ -134,7 +147,9 @@
       // Existing pages, do not add tabs repeatedly
       const tabHasExits = this.tabList.some((tab, index) => {
         updateIndex = index;
-        return decodeURIComponent(tab.fullPath || tab.path) === decodeURIComponent(fullPath || path);
+        return (
+          decodeURIComponent(tab.fullPath || tab.path) === decodeURIComponent(fullPath || path)
+        );
       });
 
       // If the tab already exists, perform the update operation

--
Gitblit v1.9.3