From 1da0bc255179f25b5227bec27833cf486cb6cb90 Mon Sep 17 00:00:00 2001 From: yinbangzhong <zhongbangyin@126.com> Date: 星期二, 10 九月 2024 19:41:40 +0800 Subject: [PATCH] agent会话 --- src/components/menu/index.vue | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/src/components/menu/index.vue b/src/components/menu/index.vue index 4485255..1987bb5 100644 --- a/src/components/menu/index.vue +++ b/src/components/menu/index.vue @@ -28,9 +28,11 @@ const topMenu = computed(() => appStore.topMenu); const openKeys = ref<string[]>([]); const selectedKey = ref<string[]>([]); + const flog = ref(false); const goto = (item: RouteRecordRaw) => { // Open external link + if (regexUrl.test(item.path)) { openWindow(item.path); selectedKey.value = [item.name as string]; @@ -84,7 +86,8 @@ }; listenerRouteChange((newRoute) => { const { requiresAuth, activeMenu, hideInMenu } = newRoute.meta; - if (requiresAuth && (!hideInMenu || activeMenu)) { + // if (requiresAuth && (!hideInMenu || activeMenu)) {//闄ゅ幓杩欎袱涓垽鏂悗锛屽彲浠ユ甯稿睍寮�鑿滃崟 + if (requiresAuth) { const menuOpenKeys = findMenuOpenKeys( (activeMenu || newRoute.name) as string ); @@ -96,6 +99,7 @@ activeMenu || menuOpenKeys[menuOpenKeys.length - 1], ]; } + console.log(selectedKey.value, 48877); }, true); const setCollapse = (val: boolean) => { if (appStore.device === 'desktop') @@ -124,6 +128,12 @@ ) : ( <a-menu-item key={element?.name} + class={ + menuTree.value.length == 1 && + menuTree.value[0].name == 'sessionManager' + ? 'session-manager' + : '' + } v-slots={{ icon }} onClick={() => goto(element)} > @@ -139,6 +149,12 @@ }; // selected-keys={selectedKey.value} + // v-if={ + // menuTree.value.length == 1 && + // menuTree.value[0].name != 'sessionManager' + // } + console.log(menuTree.value, 68877); + return () => ( <a-menu mode={topMenu.value ? 'horizontal' : 'vertical'} @@ -147,6 +163,7 @@ show-collapse-button={appStore.device !== 'mobile'} auto-open={false} auto-open-selected={true} + selected-keys={selectedKey.value} level-indent={34} style="height: 100%;width:100%;" onCollapse={setCollapse} @@ -170,4 +187,7 @@ } } } + .session-manager { + display: none; + } </style> -- Gitblit v1.8.0