From 99be7583c14bb994f0af0e63dd1e00f07c9f65e6 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 3 Apr 2024 12:13:17 +0800 Subject: [PATCH] chore: update --- src/layout/components/tag/index.vue | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/layout/components/tag/index.vue b/src/layout/components/tag/index.vue index 9218f3f44..18394fd43 100644 --- a/src/layout/components/tag/index.vue +++ b/src/layout/components/tag/index.vue @@ -60,6 +60,10 @@ const contextmenuRef = ref(); const isShowArrow = ref(false); const topPath = getTopMenu()?.path; const { VITE_HIDE_HOME } = import.meta.env; +const fixedTags = [ + ...routerArrays, + ...usePermissionStoreHook().tagLists.filter(v => v?.meta?.fixedTag) +]; const dynamicTagView = async () => { await nextTick(); @@ -232,14 +236,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) { useMultiTagsStoreHook().handleTags( "equal", [ - VITE_HIDE_HOME === "false" - ? [ - ...routerArrays, - ...usePermissionStoreHook().tagLists.filter( - v => v?.meta?.fixedTag - ) - ] - : toRaw(getTopMenu()), + VITE_HIDE_HOME === "false" ? fixedTags : toRaw(getTopMenu()), obj ].flat() ); @@ -255,7 +252,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) { if (tag === "other") { spliceRoute(1, 1, true); } else if (tag === "left") { - spliceRoute(1, valueIndex - 1); + spliceRoute(fixedTags.length, valueIndex - 1, true); } else if (tag === "right") { spliceRoute(valueIndex + 1, multiTags.value.length); } else { @@ -332,10 +329,11 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) { case 5: // 关闭全部标签页 useMultiTagsStoreHook().handleTags("splice", "", { - startIndex: 1, + startIndex: fixedTags.length, length: multiTags.value.length }); router.push(topPath); + // router.push(fixedTags[fixedTags.length - 1]?.path); handleAliveRoute(route as ToRouteType); break; case 6: