From d064f6285a6d1616d7606f1390d5f01819b258bb Mon Sep 17 00:00:00 2001 From: zuihou <244387066@qq.com> Date: Fri, 2 Dec 2022 16:47:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20setting=20=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BAfooter?= =?UTF-8?q?=E7=9A=84=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/BasicLayout/index.vue | 1 + .../common/SettingDrawer/components/PageFunc/index.vue | 3 +++ src/settings/theme.json | 3 ++- src/settings/theme.ts | 3 ++- src/store/modules/theme/index.ts | 4 ++++ src/typings/system.d.ts | 2 ++ 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/layouts/BasicLayout/index.vue b/src/layouts/BasicLayout/index.vue index 807a7bff..4adb561a 100644 --- a/src/layouts/BasicLayout/index.vue +++ b/src/layouts/BasicLayout/index.vue @@ -11,6 +11,7 @@ :sider-collapsed-width="siderCollapsedWidth" :sider-collapse="app.siderCollapse" :fixed-footer="theme.footer.fixed" + :footer-visible="theme.footer.visible" @update:sider-collapse="app.setSiderCollapse" > diff --git a/src/settings/theme.json b/src/settings/theme.json index aa1dd740..a0299b55 100644 --- a/src/settings/theme.json +++ b/src/settings/theme.json @@ -110,7 +110,8 @@ }, "footer": { "fixed": false, - "height": 48 + "height": 48, + "visible": true }, "page": { "animate": true, diff --git a/src/settings/theme.ts b/src/settings/theme.ts index 3475d260..d354dceb 100644 --- a/src/settings/theme.ts +++ b/src/settings/theme.ts @@ -88,7 +88,8 @@ const defaultThemeSetting: Theme.Setting = { }, footer: { fixed: false, - height: 48 + height: 48, + visible: true }, page: { animate: true, diff --git a/src/store/modules/theme/index.ts b/src/store/modules/theme/index.ts index c693790f..01118da8 100644 --- a/src/store/modules/theme/index.ts +++ b/src/store/modules/theme/index.ts @@ -149,6 +149,10 @@ export const useThemeStore = defineStore('theme-store', { setFooterHeight(height: number) { this.footer.height = height; }, + /** 设置底部是否显示 */ + setFooterVisible(isVisible: boolean) { + this.footer.visible = isVisible; + }, /** 设置切换页面时是否过渡动画 */ setPageIsAnimate(animate: boolean) { this.page.animate = animate; diff --git a/src/typings/system.d.ts b/src/typings/system.d.ts index 301c2db4..761af358 100644 --- a/src/typings/system.d.ts +++ b/src/typings/system.d.ts @@ -236,6 +236,8 @@ declare namespace Theme { fixed: boolean; /** 底部高度 */ height: number; + /* 底部是否可见 */ + visible: boolean; } /** 页面样式 */ From e772ff05fb6ef513bd37cd9b1e245ea72f0ad6d2 Mon Sep 17 00:00:00 2001 From: zuihou <244387066@qq.com> Date: Fri, 2 Dec 2022 17:00:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20affix=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E7=94=A8=E4=BA=8E=E5=B0=86=E5=85=B6?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E5=9C=A8tab=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TabDetail/components/ContextMenu.vue | 4 +++- .../GlobalTab/components/TabDetail/index.vue | 14 ++++++++------ src/typings/route.d.ts | 2 ++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/layouts/common/GlobalTab/components/TabDetail/components/ContextMenu.vue b/src/layouts/common/GlobalTab/components/TabDetail/components/ContextMenu.vue index 658bc537..709a095a 100644 --- a/src/layouts/common/GlobalTab/components/TabDetail/components/ContextMenu.vue +++ b/src/layouts/common/GlobalTab/components/TabDetail/components/ContextMenu.vue @@ -23,6 +23,8 @@ interface Props { visible?: boolean; /** 当前路由路径 */ currentPath?: string; + /** 是否固定在tab卡不可关闭 */ + affix?: boolean; /** 鼠标x坐标 */ x: number; /** 鼠标y坐标 */ @@ -72,7 +74,7 @@ const options = computed(() => [ { label: '关闭', key: 'close-current', - disabled: props.currentPath === tab.homeTab.fullPath, + disabled: props.currentPath === tab.homeTab.fullPath || Boolean(props.affix), icon: iconRender({ icon: 'ant-design:close-outlined' }) }, { diff --git a/src/layouts/common/GlobalTab/components/TabDetail/index.vue b/src/layouts/common/GlobalTab/components/TabDetail/index.vue index de50973a..f7117706 100644 --- a/src/layouts/common/GlobalTab/components/TabDetail/index.vue +++ b/src/layouts/common/GlobalTab/components/TabDetail/index.vue @@ -6,12 +6,12 @@ :key="item.fullPath" :is-active="tab.activeTab === item.fullPath" :primary-color="theme.themeColor" - :closable="item.name !== tab.homeTab.name" + :closable="!(item.name === tab.homeTab.name || item.meta.affix)" :dark-mode="theme.darkMode" :class="{ '!mr-0': isChromeMode && index === tab.tabs.length - 1, 'mr-10px': !isChromeMode }" @click="tab.handleClickTab(item.fullPath)" @close="tab.removeTab(item.fullPath)" - @contextmenu="handleContextMenu($event, item.fullPath)" + @contextmenu="handleContextMenu($event, item.fullPath, item.meta.affix)" > { - setDropdown(clientX, clientY, fullPath); + setDropdown(clientX, clientY, fullPath, affix); showDropdown(); isClickContextMenu = false; }, DURATION); diff --git a/src/typings/route.d.ts b/src/typings/route.d.ts index cfad97b8..671ab219 100644 --- a/src/typings/route.d.ts +++ b/src/typings/route.d.ts @@ -60,6 +60,8 @@ declare namespace AuthRoute { activeMenu?: RouteKey; /** 表示是否是多级路由的中间级路由(用于转换路由数据时筛选多级路由的标识,定义路由时不用填写) */ multi?: boolean; + /** 是否固定在tab卡不可关闭 */ + affix?: boolean; } type Route = K extends AllRouteKey