| | |
| | | |
| | | import { toRaw, unref } from 'vue'; |
| | | import { defineStore } from 'pinia'; |
| | | import { store } from '/@/store'; |
| | | import { store } from '@/store'; |
| | | |
| | | import { useGo, useRedo } from '/@/hooks/web/usePage'; |
| | | import { Persistent } from '/@/utils/cache/persistent'; |
| | | import { useGo, useRedo } from '@/hooks/web/usePage'; |
| | | import { Persistent } from '@/utils/cache/persistent'; |
| | | |
| | | import { PageEnum } from '/@/enums/pageEnum'; |
| | | import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic'; |
| | | import { getRawRoute } from '/@/utils'; |
| | | import { MULTIPLE_TABS_KEY } from '/@/enums/cacheEnum'; |
| | | import { PageEnum } from '@/enums/pageEnum'; |
| | | import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '@/router/routes/basic'; |
| | | import { getRawRoute } from '@/utils'; |
| | | import { MULTIPLE_TABS_KEY } from '@/enums/cacheEnum'; |
| | | |
| | | import projectSetting from '/@/settings/projectSetting'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import projectSetting from '@/settings/projectSetting'; |
| | | import { useUserStore } from '@/store/modules/user'; |
| | | |
| | | export interface MultipleTabState { |
| | | cacheTabList: Set<string>; |
| | |
| | | // Existing pages, do not add tabs repeatedly |
| | | const tabHasExits = this.tabList.some((tab, index) => { |
| | | updateIndex = index; |
| | | return (tab.fullPath || tab.path) === (fullPath || path); |
| | | return decodeURIComponent(tab.fullPath || tab.path) === decodeURIComponent(fullPath || path); |
| | | }); |
| | | |
| | | // If the tab already exists, perform the update operation |
| | |
| | | |
| | | for (const path of closePathList) { |
| | | if (path !== route.fullPath) { |
| | | const closeItem = this.tabList.find((item) => item.path === path); |
| | | const closeItem = this.tabList.find((item) => item.fullPath === path); |
| | | if (!closeItem) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | this.bulkCloseTabs(pathList); |
| | | this.updateCacheTab(); |
| | | Persistent.setLocal(MULTIPLE_TABS_KEY, this.tabList, true); |
| | | handleGotoPage(router); |
| | | }, |
| | | |