From b93ebe713b3bbee92bc651b0fabd514915ac0ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E4=B8=87?= <52823142+Ten-K@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:25:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=A1=B5=E8=84=9A=20?= =?UTF-8?q?(#758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: 添加页脚 --- public/platform-config.json | 1 + src/layout/components/appMain.vue | 65 ++++++++++++++++++------- src/layout/components/footer/index.vue | 29 +++++++++++ src/layout/components/setting/index.vue | 21 ++++++++ src/layout/hooks/useLayout.ts | 1 + src/utils/responsive.ts | 1 + types/global.d.ts | 3 ++ 7 files changed, 103 insertions(+), 18 deletions(-) create mode 100644 src/layout/components/footer/index.vue diff --git a/public/platform-config.json b/public/platform-config.json index 4bab15ad83..6860406f98 100644 --- a/public/platform-config.json +++ b/public/platform-config.json @@ -12,6 +12,7 @@ "Grey": false, "Weak": false, "HideTabs": false, + "HideFooter": false, "SidebarStatus": true, "EpThemeColor": "#409EFF", "ShowLogo": true, diff --git a/src/layout/components/appMain.vue b/src/layout/components/appMain.vue index 0cf1be2fd6..28354d9795 100644 --- a/src/layout/components/appMain.vue +++ b/src/layout/components/appMain.vue @@ -1,4 +1,5 @@ + + + + diff --git a/src/layout/components/setting/index.vue b/src/layout/components/setting/index.vue index 9600a8455f..49cfc06d97 100644 --- a/src/layout/components/setting/index.vue +++ b/src/layout/components/setting/index.vue @@ -66,6 +66,7 @@ const settings = reactive({ tabsVal: $storage.configure.hideTabs, showLogo: $storage.configure.showLogo, showModel: $storage.configure.showModel, + hideFooter: $storage.configure.hideFooter, multiTagsCache: $storage.configure.multiTagsCache }); @@ -111,12 +112,20 @@ const weekChange = (value): void => { storageConfigureChange("weak", value); }; +/** 隐藏标签页设置 */ const tagsChange = () => { const showVal = settings.tabsVal; storageConfigureChange("hideTabs", showVal); emitter.emit("tagViewsChange", showVal as unknown as string); }; +/** 隐藏页脚设置 */ +const hideFooterChange = () => { + const hideFooter = settings.hideFooter; + storageConfigureChange("hideFooter", hideFooter); +}; + +/** 标签页持久化设置 */ const multiTagsCacheChange = () => { const multiTagsCache = settings.multiTagsCache; storageConfigureChange("multiTagsCache", multiTagsCache); @@ -218,6 +227,7 @@ onBeforeMount(() => { settings.weakVal && document.querySelector("html")?.setAttribute("class", "html-weakness"); settings.tabsVal && tagsChange(); + settings.hideFooter && hideFooterChange(); }); }); @@ -344,6 +354,17 @@ onBeforeMount(() => { @change="tagsChange" /> +
  • + 隐藏页脚 + +
  • 侧边栏Logo { grey: config.Grey ?? false, weak: config.Weak ?? false, hideTabs: config.HideTabs ?? false, + hideFooter: config.HideFooter ?? false, showLogo: config.ShowLogo ?? true, showModel: config.ShowModel ?? "smart", multiTagsCache: config.MultiTagsCache ?? false diff --git a/types/global.d.ts b/types/global.d.ts index 3953672df5..b9c4c243bd 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -89,6 +89,7 @@ declare global { Grey?: boolean; Weak?: boolean; HideTabs?: boolean; + HideFooter?: boolean; SidebarStatus?: boolean; EpThemeColor?: string; ShowLogo?: boolean; @@ -125,6 +126,7 @@ declare global { grey?: boolean; weak?: boolean; hideTabs?: boolean; + hideFooter?: boolean; sidebarStatus?: boolean; epThemeColor?: string; showLogo?: boolean; @@ -158,6 +160,7 @@ declare global { grey?: boolean; weak?: boolean; hideTabs?: boolean; + hideFooter?: boolean; showLogo?: boolean; showModel?: string; multiTagsCache?: boolean;