chore: update

This commit is contained in:
xiaoxian521 2024-04-03 12:13:17 +08:00
parent ec5fee4655
commit 99be7583c1

View File

@ -60,6 +60,10 @@ const contextmenuRef = ref();
const isShowArrow = ref(false); const isShowArrow = ref(false);
const topPath = getTopMenu()?.path; const topPath = getTopMenu()?.path;
const { VITE_HIDE_HOME } = import.meta.env; const { VITE_HIDE_HOME } = import.meta.env;
const fixedTags = [
...routerArrays,
...usePermissionStoreHook().tagLists.filter(v => v?.meta?.fixedTag)
];
const dynamicTagView = async () => { const dynamicTagView = async () => {
await nextTick(); await nextTick();
@ -232,14 +236,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) {
useMultiTagsStoreHook().handleTags( useMultiTagsStoreHook().handleTags(
"equal", "equal",
[ [
VITE_HIDE_HOME === "false" VITE_HIDE_HOME === "false" ? fixedTags : toRaw(getTopMenu()),
? [
...routerArrays,
...usePermissionStoreHook().tagLists.filter(
v => v?.meta?.fixedTag
)
]
: toRaw(getTopMenu()),
obj obj
].flat() ].flat()
); );
@ -255,7 +252,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) {
if (tag === "other") { if (tag === "other") {
spliceRoute(1, 1, true); spliceRoute(1, 1, true);
} else if (tag === "left") { } else if (tag === "left") {
spliceRoute(1, valueIndex - 1); spliceRoute(fixedTags.length, valueIndex - 1, true);
} else if (tag === "right") { } else if (tag === "right") {
spliceRoute(valueIndex + 1, multiTags.value.length); spliceRoute(valueIndex + 1, multiTags.value.length);
} else { } else {
@ -332,10 +329,11 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
case 5: case 5:
// //
useMultiTagsStoreHook().handleTags("splice", "", { useMultiTagsStoreHook().handleTags("splice", "", {
startIndex: 1, startIndex: fixedTags.length,
length: multiTags.value.length length: multiTags.value.length
}); });
router.push(topPath); router.push(topPath);
// router.push(fixedTags[fixedTags.length - 1]?.path);
handleAliveRoute(route as ToRouteType); handleAliveRoute(route as ToRouteType);
break; break;
case 6: case 6: