兰宝车间质量管理系统-前端
三个三
2023-06-20 3b4ac3e525bdc51cf5176d3d52cd01d0a9c67d7d
src/plugins/tab.ts
@@ -33,8 +33,12 @@
  async closePage(obj?: TagView): Promise<{ visitedViews: TagView[]; cachedViews: string[] } | any> {
    if (obj === undefined) {
      // prettier-ignore
      const { lastPath } = await useTagsViewStore().delView(router.currentRoute.value) as any
      return router.push(lastPath || '/index');
      const { visitedViews } = await useTagsViewStore().delView(router.currentRoute.value) as any
      const latestView = visitedViews.slice(-1)[0]
      if (latestView) {
        return router.push(latestView.fullPath)
      }
      return router.push('/');
    }
    return useTagsViewStore().delView(obj);
  },