File tree Expand file tree Collapse file tree 7 files changed +52
-0
lines changed
layouts/modules/theme-drawer/modules Expand file tree Collapse file tree 7 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import { computed } from ' vue' ;
3
3
import { ConfigProvider } from ' ant-design-vue' ;
4
+ import type { WatermarkProps } from ' ant-design-vue' ;
4
5
import { useAppStore } from ' ./store/modules/app' ;
5
6
import { useThemeStore } from ' ./store/modules/theme' ;
6
7
import { antdLocales } from ' ./locales/antd' ;
@@ -15,12 +16,33 @@ const themeStore = useThemeStore();
15
16
const antdLocale = computed (() => {
16
17
return antdLocales [appStore .locale ];
17
18
});
19
+
20
+ const watermarkProps = computed (() => {
21
+ const props: WatermarkProps = {
22
+ content: themeStore .watermark .text ,
23
+ width: 120 ,
24
+ height: 120 ,
25
+ font: {
26
+ fontSize: 16
27
+ },
28
+ offset: [12 , 60 ],
29
+ rotate: - 15 ,
30
+ zIndex: 9999
31
+ };
32
+
33
+ return props ;
34
+ });
18
35
</script >
19
36
20
37
<template >
21
38
<ConfigProvider :theme =" themeStore.antdTheme" :locale =" antdLocale" >
22
39
<AppProvider >
23
40
<RouterView class =" bg-layout" />
41
+ <AWatermark
42
+ v-if =" themeStore.watermark.visible"
43
+ v-bind =" watermarkProps"
44
+ class =" pointer-events-none absolute-lt! size-full"
45
+ />
24
46
</AppProvider >
25
47
</ConfigProvider >
26
48
</template >
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
97
97
>
98
98
<ASwitch v-model:checked =" themeStore.footer.right" />
99
99
</SettingItem >
100
+ <SettingItem v-if =" themeStore.watermark" key =" 8" :label =" $t('theme.watermark.visible')" >
101
+ <ASwitch v-model:checked =" themeStore.watermark.visible" />
102
+ </SettingItem >
103
+ <SettingItem v-if =" themeStore.watermark?.visible" key =" 8-1" :label =" $t('theme.watermark.text')" >
104
+ <AInput v-model:value =" themeStore.watermark.text" placeholder =" SoybeanAdmin" class =" w-120px" />
105
+ </SettingItem >
100
106
</TransitionGroup >
101
107
</template >
102
108
Original file line number Diff line number Diff line change @@ -133,6 +133,10 @@ const local: App.I18n.Schema = {
133
133
height : 'Footer Height' ,
134
134
right : 'Right Footer'
135
135
} ,
136
+ watermark : {
137
+ visible : 'Watermark Full Screen Visible' ,
138
+ text : 'Watermark Text'
139
+ } ,
136
140
themeDrawerTitle : 'Theme Configuration' ,
137
141
pageFunTitle : 'Page Function' ,
138
142
configOperation : {
Original file line number Diff line number Diff line change @@ -133,6 +133,10 @@ const local: App.I18n.Schema = {
133
133
height : '底部高度' ,
134
134
right : '底部局右'
135
135
} ,
136
+ watermark : {
137
+ visible : '显示全屏水印' ,
138
+ text : '水印文本'
139
+ } ,
136
140
themeDrawerTitle : '主题配置' ,
137
141
pageFunTitle : '页面功能' ,
138
142
configOperation : {
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ export const themeSettings: App.Theme.ThemeSetting = {
49
49
height : 48 ,
50
50
right : true
51
51
} ,
52
+ watermark : {
53
+ visible : false ,
54
+ text : 'SoybeanAdmin'
55
+ } ,
52
56
tokens : {
53
57
light : {
54
58
colors : {
Original file line number Diff line number Diff line change @@ -95,6 +95,13 @@ declare namespace App {
95
95
/** Whether float the footer to the right when the layout is 'horizontal-mix' */
96
96
right : boolean ;
97
97
} ;
98
+ /** Watermark */
99
+ watermark : {
100
+ /** Whether to show the watermark */
101
+ visible : boolean ;
102
+ /** Watermark text */
103
+ text : string ;
104
+ } ;
98
105
/** define some theme settings tokens, will transform to css variables */
99
106
tokens : {
100
107
light : ThemeSettingToken ;
@@ -371,6 +378,10 @@ declare namespace App {
371
378
height : string ;
372
379
right : string ;
373
380
} ;
381
+ watermark : {
382
+ visible : string ;
383
+ text : string ;
384
+ } ;
374
385
themeDrawerTitle : string ;
375
386
pageFunTitle : string ;
376
387
configOperation : {
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ declare module 'vue' {
47
47
ATag : typeof import ( 'ant-design-vue/es' ) [ 'Tag' ]
48
48
ATooltip : typeof import ( 'ant-design-vue/es' ) [ 'Tooltip' ]
49
49
ATree : typeof import ( 'ant-design-vue/es' ) [ 'Tree' ]
50
+ AWatermark : typeof import ( 'ant-design-vue/es' ) [ 'Watermark' ]
50
51
BetterScroll : typeof import ( './../components/custom/better-scroll.vue' ) [ 'default' ]
51
52
ButtonIcon : typeof import ( './../components/custom/button-icon.vue' ) [ 'default' ]
52
53
CountTo : typeof import ( './../components/custom/count-to.vue' ) [ 'default' ]
You can’t perform that action at this time.
0 commit comments