diff --git a/src/config/layout.ts b/src/config/layout.ts index 7d2f377..ac5ab6e 100644 --- a/src/config/layout.ts +++ b/src/config/layout.ts @@ -1,13 +1,15 @@ import { getConfigLayout } from "@/utils/cache/local-storage" -/** 布局配置 */ +/** 项目配置 */ export interface LayoutSettings { /** 是否显示 Settings Panel */ showSettings: boolean + /** 布局模式 */ + layoutMode: "left" | "top" | "left-top" /** 是否显示标签栏 */ showTagsView: boolean - /** 是否显示侧边栏 Logo */ - showSidebarLogo: boolean + /** 是否显示 Logo */ + showLogo: boolean /** 是否固定 Header */ fixedHeader: boolean /** 是否显示消息通知 */ @@ -25,10 +27,11 @@ export interface LayoutSettings { } export const layoutSettings: LayoutSettings = getConfigLayout() ?? { + layoutMode: "left", showSettings: true, showTagsView: true, fixedHeader: true, - showSidebarLogo: true, + showLogo: true, showNotify: true, showThemeSwitch: true, showScreenfull: true, diff --git a/src/layout/LeftMode.vue b/src/layout/LeftMode.vue new file mode 100644 index 0000000..fa50740 --- /dev/null +++ b/src/layout/LeftMode.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/src/layout/LeftTopMode.vue b/src/layout/LeftTopMode.vue new file mode 100644 index 0000000..43e5c32 --- /dev/null +++ b/src/layout/LeftTopMode.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 9b26c41..02f5c89 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -30,10 +30,7 @@ const key = computed(() => { @import "@/styles/mixins.scss"; .app-main { - min-height: calc(100vh - var(--v3-navigationbar-height)); width: 100%; - position: relative; - overflow: hidden; background-color: var(--v3-body-bg-color); } @@ -42,19 +39,4 @@ const key = computed(() => { overflow: auto; @include scrollbar; } - -.fixed-header + .app-main { - padding-top: var(--v3-navigationbar-height); - height: 100vh; - overflow: auto; -} - -.hasTagsView { - .app-main { - min-height: calc(100vh - var(--v3-header-height)); - } - .fixed-header + .app-main { - padding-top: var(--v3-header-height); - } -} diff --git a/src/layout/components/Logo/index.vue b/src/layout/components/Logo/index.vue new file mode 100644 index 0000000..9426dbb --- /dev/null +++ b/src/layout/components/Logo/index.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/layout/components/NavigationBar/index.vue b/src/layout/components/NavigationBar/index.vue index 87ac6ae..0e647d3 100644 --- a/src/layout/components/NavigationBar/index.vue +++ b/src/layout/components/NavigationBar/index.vue @@ -5,8 +5,8 @@ import { useAppStore } from "@/store/modules/app" import { useSettingsStore } from "@/store/modules/settings" import { useUserStore } from "@/store/modules/user" import { UserFilled } from "@element-plus/icons-vue" -import Breadcrumb from "../Breadcrumb/index.vue" import Hamburger from "../Hamburger/index.vue" +import Breadcrumb from "../Breadcrumb/index.vue" import ThemeSwitch from "@/components/ThemeSwitch/index.vue" import Screenfull from "@/components/Screenfull/index.vue" import Notify from "@/components/Notify/index.vue" @@ -68,7 +68,7 @@ const logout = () => { .navigation-bar { height: var(--v3-navigationbar-height); overflow: hidden; - background: #fff; + background: var(--v3-header-bg-color); .hamburger { display: flex; align-items: center; diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index eafa840..b8e16eb 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -1,4 +1,5 @@ - - - - diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index eca0654..c83f453 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -6,7 +6,7 @@ import { useAppStore } from "@/store/modules/app" import { usePermissionStore } from "@/store/modules/permission" import { useSettingsStore } from "@/store/modules/settings" import SidebarItem from "./SidebarItem.vue" -import SidebarLogo from "./SidebarLogo.vue" +import Logo from "../Logo/index.vue" import { getCssVariableValue } from "@/utils" const v3SidebarMenuBgColor = getCssVariableValue("--v3-sidebar-menu-bg-color") @@ -18,7 +18,7 @@ const appStore = useAppStore() const permissionStore = usePermissionStore() const settingsStore = useSettingsStore() -const { showSidebarLogo } = storeToRefs(settingsStore) +const { layoutMode, showLogo } = storeToRefs(settingsStore) const activeMenu = computed(() => { const { @@ -29,11 +29,12 @@ const activeMenu = computed(() => { }) const isCollapse = computed(() => !appStore.sidebar.opened) +const isLogo = computed(() => layoutMode.value === "left" && showLogo.value)