From f74f264d875b003730484f3fe7cb242c7f91294e Mon Sep 17 00:00:00 2001 From: zhangxiao <898441624@qq.com> Date: 星期四, 15 八月 2024 17:32:55 +0800 Subject: [PATCH] fix: 模型管理代码修改 --- src/components/menu/index.vue | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/menu/index.vue b/src/components/menu/index.vue index 9678249..4485255 100644 --- a/src/components/menu/index.vue +++ b/src/components/menu/index.vue @@ -2,7 +2,7 @@ import { defineComponent, ref, h, compile, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter, RouteRecordRaw } from 'vue-router'; - import type ,{ RouteMeta } from 'vue-router'; + import type, { RouteMeta } from 'vue-router'; import { useAppStore } from '@/store'; import { listenerRouteChange } from '@/utils/route-listener'; import { openWindow, regexUrl } from '@/utils'; @@ -38,10 +38,12 @@ } // Eliminate external link side effects const { hideInMenu, activeMenu } = item.meta as RouteMeta; + if (route.name === item.name && !hideInMenu && !activeMenu) { selectedKey.value = [item.name as string]; return; } + // const firstMenuNameArr=['model','knowledge','session','sessionRecords']; // const suffix='Manager'; // if(firstMenuNameArr.indexOf(item.name)!=-1){ @@ -54,7 +56,8 @@ // }); // } // Trigger router change - router.push({ + + router.push({ name: item.name, }); }; @@ -135,6 +138,7 @@ return travel(menuTree.value); }; + // selected-keys={selectedKey.value} return () => ( <a-menu mode={topMenu.value ? 'horizontal' : 'vertical'} @@ -142,7 +146,6 @@ v-model:open-keys={openKeys.value} show-collapse-button={appStore.device !== 'mobile'} auto-open={false} - selected-keys={selectedKey.value} auto-open-selected={true} level-indent={34} style="height: 100%;width:100%;" -- Gitblit v1.8.0