feat: 全屏

This commit is contained in:
wangdan 2023-02-09 15:12:13 +08:00 committed by wangdan-fit2cloud
parent 26535ebc09
commit eb9ec322f8
5 changed files with 11 additions and 2 deletions

View file

@ -1,9 +1,9 @@
<template> <template>
<Layout v-loading="loading" :element-loading-text="loadinText" fullscreen> <Layout v-loading="loading" :element-loading-text="loadinText" fullscreen>
<template #menu> <template #menu v-if="!globalStore.isFullScreen">
<Menu></Menu> <Menu></Menu>
</template> </template>
<template #footer> <template #footer v-if="!globalStore.isFullScreen">
<Footer></Footer> <Footer></Footer>
</template> </template>
</Layout> </Layout>

View file

@ -12,6 +12,7 @@
@click="jump(key)" @click="jump(key)"
:right="key == paths.length - 1" :right="key == paths.length - 1"
> >
<!-- <span class="sle">{{ item }}</span> -->
{{ item }} {{ item }}
</BreadCrumbItem> </BreadCrumbItem>
</BreadCrumbs> </BreadCrumbs>

View file

@ -19,9 +19,13 @@ export const GlobalStore = defineStore({
theme: 'bright', theme: 'bright',
footer: true, footer: true,
}, },
isFullScreen: false,
}), }),
getters: {}, getters: {},
actions: { actions: {
setScreenFull() {
this.isFullScreen = !this.isFullScreen;
},
setLogStatus(login: boolean) { setLogStatus(login: boolean) {
this.isLogin = login; this.isLogin = login;
}, },

View file

@ -15,6 +15,7 @@ export interface GlobalState {
language: string; // zh | en language: string; // zh | en
// assemblySize: string; // small | default | large // assemblySize: string; // small | default | large
themeConfig: ThemeConfigProp; themeConfig: ThemeConfigProp;
isFullScreen: boolean;
} }
export interface MenuState { export interface MenuState {

View file

@ -131,13 +131,16 @@ import i18n from '@/lang';
import { Host } from '@/api/interface/host'; import { Host } from '@/api/interface/host';
import { getHostTree, testByID } from '@/api/modules/host'; import { getHostTree, testByID } from '@/api/modules/host';
import { getCommandList } from '@/api/modules/command'; import { getCommandList } from '@/api/modules/command';
import { GlobalStore } from '@/store';
const dialogRef = ref(); const dialogRef = ref();
const ctx = getCurrentInstance() as any; const ctx = getCurrentInstance() as any;
const globalStore = GlobalStore();
function toggleFullscreen() { function toggleFullscreen() {
if (screenfull.isEnabled) { if (screenfull.isEnabled) {
screenfull.toggle(); screenfull.toggle();
globalStore.setScreenFull();
} }
} }