| | |
| | | import type { MenuSetting } from '/#/config'; |
| | | import type { MenuSetting } from '#/config'; |
| | | |
| | | import { computed, unref, ref } from 'vue'; |
| | | |
| | | import { useAppStore } from '/@/store/modules/app'; |
| | | import { useAppStore } from '@/store/modules/app'; |
| | | |
| | | import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '/@/enums/appEnum'; |
| | | import { MenuModeEnum, MenuTypeEnum, TriggerEnum } from '/@/enums/menuEnum'; |
| | | import { useFullContent } from '/@/hooks/web/useFullContent'; |
| | | import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '@/enums/appEnum'; |
| | | import { MenuModeEnum, MenuTypeEnum, TriggerEnum } from '@/enums/menuEnum'; |
| | | import { useFullContent } from '@/hooks/web/useFullContent'; |
| | | |
| | | const mixSideHasChildren = ref(false); |
| | | |
| | |
| | | return siderHidden |
| | | ? 0 |
| | | : collapsedShowTitle |
| | | ? SIDE_BAR_SHOW_TIT_MINI_WIDTH |
| | | : SIDE_BAR_MINI_WIDTH; |
| | | ? SIDE_BAR_SHOW_TIT_MINI_WIDTH |
| | | : SIDE_BAR_MINI_WIDTH; |
| | | }); |
| | | |
| | | const getCalcContentWidth = computed(() => { |
| | |
| | | unref(getIsTopMenu) || !unref(getShowMenu) || (unref(getSplit) && unref(getMenuHidden)) |
| | | ? 0 |
| | | : unref(getIsMixSidebar) |
| | | ? (unref(getCollapsed) ? SIDE_BAR_MINI_WIDTH : SIDE_BAR_SHOW_TIT_MINI_WIDTH) + |
| | | (unref(getMixSideFixed) && unref(mixSideHasChildren) ? unref(getRealWidth) : 0) |
| | | : unref(getRealWidth); |
| | | ? (unref(getCollapsed) ? SIDE_BAR_MINI_WIDTH : SIDE_BAR_SHOW_TIT_MINI_WIDTH) + |
| | | (unref(getMixSideFixed) && unref(mixSideHasChildren) ? unref(getRealWidth) : 0) |
| | | : unref(getRealWidth); |
| | | |
| | | return `calc(100% - ${unref(width)}px)`; |
| | | }); |
| | | |
| | | // Set menu configuration |
| | | function setMenuSetting(menuSetting: Partial<MenuSetting>): void { |
| | | appStore.setProjectConfig({ menuSetting }); |
| | | appStore.setMenuSetting(menuSetting); |
| | | } |
| | | |
| | | function toggleCollapsed() { |
| | |
| | | } |
| | | return { |
| | | setMenuSetting, |
| | | |
| | | toggleCollapsed, |
| | | |
| | | getMenuFixed, |
| | | getRealWidth, |
| | | getMenuType, |