Skip to content

Commit

Permalink
feat(setting): supported watermark switch
Browse files Browse the repository at this point in the history
  • Loading branch information
246859 committed Oct 12, 2023
1 parent 0cc948d commit a441950
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config/default-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
splitMenus: false,
header: true,
menu: true,
watermark: true,
menuHeader: true,
footer: false,
colorWeak: false,
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/components/setting-drawer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const props = withDefaults(
keepAlive?: boolean
accordionMode?: boolean
leftCollapsed?: boolean
watermark?: boolean
header?: boolean
footer?: boolean
menu?: boolean
Expand Down Expand Up @@ -204,6 +205,7 @@ const { token } = useAntdToken()
:t="t"
:layout="layout"
:header="header"
:watermark="watermark"
:menu-header="menuHeader"
:footer="footer"
:animation-name="animationName"
Expand Down
8 changes: 8 additions & 0 deletions src/layouts/components/setting-drawer/regional-setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const props = defineProps<{
header?: boolean
footer?: boolean
menu?: boolean
watermark?: boolean
menuHeader?: boolean
multiTab?: boolean
multiTabFixed?: boolean
Expand All @@ -23,6 +24,12 @@ const list = computed(() => ([
disabled: false,
disabledReason: '',
},
{
title: '水印',
key: 'watermark',
disabled: false,
disabledReason: '',
},
{
title: '顶栏',
key: 'header',
Expand Down Expand Up @@ -60,6 +67,7 @@ const list = computed(() => ([
disabledReason: '多页签开启后功能正常使用',
},
]))
function handleChangeSetting(key: string, value: any) {
emit('changeSetting', key, value)
}
Expand Down
4 changes: 3 additions & 1 deletion src/layouts/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const layoutProps = computed(() =>
</template>

<template #renderFooterLinks />
<a-watermark h-full flex flex-col flex-1 :content="layoutSetting.title ?? 'Antdv Pro'">

<a-watermark h-full flex flex-col flex-1 :content="!layoutSetting.watermark ? '' : layoutSetting.title ?? 'Antdv Pro'">
<RouterView>
<template #default="{ Component }">
<component :is="Component" />
Expand All @@ -90,6 +91,7 @@ const layoutProps = computed(() =>
:keep-alive="layoutSetting.keepAlive"
:accordion-mode="layoutSetting.accordionMode"
:left-collapsed="layoutSetting.leftCollapsed"
:watermark="layoutSetting.watermark"
v-bind="layoutProps"
:layout-setting="layoutSetting"
@setting-change="appStore.changeSettingLayout"
Expand Down
1 change: 1 addition & 0 deletions src/locales/lang/global/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
'app.setting.content-area.header': 'Header',
'app.setting.content-area.footer': 'Footer',
'app.setting.content-area.menu': 'Menu',
'app.setting.content-area.watermark': 'Watermark',
'app.setting.content-area.menuHeader': 'Menu Header',
'app.setting.content-area.multiTab': 'Multi Tab',
'app.setting.content-area.multiTabFixed': 'Fixed Multi Tab',
Expand Down
1 change: 1 addition & 0 deletions src/locales/lang/global/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
'app.setting.content-area.header': '顶栏',
'app.setting.content-area.footer': '页脚',
'app.setting.content-area.menu': '菜单',
'app.setting.content-area.watermark': '水印',
'app.setting.content-area.menuHeader': '菜单头',
'app.setting.content-area.multiTab': '多页签',
'app.setting.content-area.multiTabFixed': '固定多页签',
Expand Down
1 change: 1 addition & 0 deletions src/stores/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface LayoutSetting {
fixedHeader?: boolean
fixedSider?: boolean
splitMenus?: boolean
watermark?: boolean
header?: boolean
footer?: boolean
menu?: boolean
Expand Down

0 comments on commit a441950

Please sign in to comment.