feat: pc端单点登录,隐藏上边栏左边栏

This commit is contained in:
GAOANG
2024-04-22 09:13:18 +08:00
parent 8b0174ddb9
commit 2c8bc68c7d
5 changed files with 77 additions and 8 deletions

View File

@ -1,11 +1,11 @@
<template>
<Layout :class="prefixCls" v-bind="lockEvents">
<LayoutFeatures />
<LayoutHeader fixed v-if="getShowFullHeaderRef" />
<Layout :class="prefixCls" v-bind="lockEvents">z
<LayoutFeatures v-if="showSide"/>
<LayoutHeader fixed v-if="getShowFullHeaderRef && showSide"/>
<Layout :class="[layoutClass]">
<LayoutSideBar v-if="getShowSidebar || getIsMobile" />
<LayoutSideBar v-if="(getShowSidebar || getIsMobile) && showSide"/>
<Layout :class="`${prefixCls}-main`">
<LayoutMultipleHeader />
<LayoutMultipleHeader v-if="showSide"/>
<LayoutContent />
<LayoutFooter />
</Layout>
@ -14,7 +14,7 @@
</template>
<script lang="ts">
import { defineComponent, computed, unref } from 'vue';
import { defineComponent, computed, unref, ref } from 'vue';
import { Layout } from 'ant-design-vue';
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
@ -29,6 +29,8 @@
import { useLockPage } from '/@/hooks/web/useLockPage';
import { useAppInject } from '/@/hooks/web/useAppInject';
import useGlobalFlag from '/@/hooks/core/useGlobalFlag';
import { useRoute } from 'vue-router';
export default defineComponent({
name: 'DefaultLayout',
@ -46,6 +48,16 @@
const { getIsMobile } = useAppInject();
const { getShowFullHeaderRef } = useHeaderSetting();
const { getShowSidebar, getIsMixSidebar, getShowMenu } = useMenuSetting();
const globalFlag = useGlobalFlag();
const route = useRoute();
let showSide = ref(true)
const { isSingleLogin } = globalFlag;
if (route.query.isSingleLogin) {
isSingleLogin.value = true
}
if (isSingleLogin.value) {
showSide.value = false
}
// Create a lock screen monitor
const lockEvents = useLockPage();
@ -66,6 +78,7 @@
getIsMixSidebar,
layoutClass,
lockEvents,
showSide
};
},
});