Ben Lin
2024-10-24 5a813f3b28f3cbf1db3a3657ccf83267c6e0d315
src/store/modules/multipleTab.ts
@@ -88,7 +88,11 @@
      const name = route.name;
      const useProdRoute = useProdRouteStore();
      useProdRoute.setChangeToCPPage(false);
      useProdRoute.setCurProdRotTree([]);
      // 从sessionStorage中读取参数并转换回对象
      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) {
@@ -138,7 +142,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