fix(系统设置): 修复社区版切换顶部菜单时显示授权菜单的问题

This commit is contained in:
CaptainB 2024-03-16 11:51:54 +08:00 committed by 刘瑞斌
parent fdf6833448
commit bc707b8cc7
1 changed files with 11 additions and 6 deletions

View File

@ -34,9 +34,19 @@
const { t } = useI18n();
const activeMenus: Ref<RouteRecordName[]> = ref([]);
function checkAuthMenu() {
const topMenus = appStore.getTopMenus;
if (appStore.packageType === 'community') {
appStore.setTopMenus(topMenus.filter((item) => item.name !== RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT));
} else {
appStore.setTopMenus(topMenus);
}
}
watch(
() => appStore.getCurrentTopMenu?.name,
(val) => {
checkAuthMenu();
activeMenus.value = [val || ''];
},
{
@ -130,12 +140,7 @@
watch(
() => appStore.packageType,
(val) => {
const topMenus = appStore.getTopMenus;
if (val === 'enterprise') {
appStore.setTopMenus(topMenus);
} else {
appStore.setTopMenus(topMenus.filter((item) => item.name !== RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT));
}
checkAuthMenu();
}
);
</script>