File tree Expand file tree Collapse file tree
ui-kit/shadcn-ui/src/components/full-screen
effects/layouts/src/widgets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,11 +106,16 @@ function handleMakeAll() {
106106 notifications .value .forEach ((item ) => (item .isRead = true ));
107107}
108108watch (
109- () => preferences .app .watermark ,
110- async (enable ) => {
109+ () => ({
110+ enable: preferences .app .watermark ,
111+ content: preferences .app .watermarkContent ,
112+ }),
113+ async ({ enable , content }) => {
111114 if (enable ) {
112115 await updateWatermark ({
113- content: ` ${userStore .userInfo ?.username } - ${userStore .userInfo ?.realName } ` ,
116+ content:
117+ content ||
118+ ` ${userStore .userInfo ?.username } - ${userStore .userInfo ?.realName } ` ,
114119 });
115120 } else {
116121 destroyWatermark ();
Original file line number Diff line number Diff line change @@ -106,11 +106,16 @@ function handleMakeAll() {
106106 notifications .value .forEach ((item ) => (item .isRead = true ));
107107}
108108watch (
109- () => preferences .app .watermark ,
110- async (enable ) => {
109+ () => ({
110+ enable: preferences .app .watermark ,
111+ content: preferences .app .watermarkContent ,
112+ }),
113+ async ({ enable , content }) => {
111114 if (enable ) {
112115 await updateWatermark ({
113- content: ` ${userStore .userInfo ?.username } - ${userStore .userInfo ?.realName } ` ,
116+ content:
117+ content ||
118+ ` ${userStore .userInfo ?.username } - ${userStore .userInfo ?.realName } ` ,
114119 });
115120 } else {
116121 destroyWatermark ();
Original file line number Diff line number Diff line change @@ -107,11 +107,16 @@ function handleMakeAll() {
107107}
108108
109109watch (
110- () => preferences .app .watermark ,
111- async (enable ) => {
110+ () => ({
111+ enable: preferences .app .watermark ,
112+ content: preferences .app .watermarkContent ,
113+ }),
114+ async ({ enable , content }) => {
112115 if (enable ) {
113116 await updateWatermark ({
114- content: ` ${userStore .userInfo ?.username } - ${userStore .userInfo ?.realName } ` ,
117+ content:
118+ content ||
119+ ` ${userStore .userInfo ?.username } - ${userStore .userInfo ?.realName } ` ,
115120 });
116121 } else {
117122 destroyWatermark ();
Original file line number Diff line number Diff line change 8585.z-popup {
8686 z-index : var (--popup-z-index );
8787}
88+
89+ @keyframes shrink {
90+ 0% {
91+ transform : scale (1 );
92+ }
93+
94+ 50% {
95+ transform : scale (0.9 );
96+ }
97+
98+ 100% {
99+ transform : scale (1 );
100+ }
101+ }
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const defaultPreferences: Preferences = {
2929 name : 'Vben Admin' ,
3030 preferencesButtonPosition : 'auto' ,
3131 watermark : false ,
32+ watermarkContent : '' ,
3233 zIndex : 200 ,
3334 } ,
3435 breadcrumb : {
Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ interface AppPreferences {
7575 * @zh_CN 是否开启水印
7676 */
7777 watermark : boolean ;
78+ /**
79+ * @zh_CN 水印文案
80+ */
81+ watermarkContent : string ;
7882 /** z-index */
7983 zIndex : number ;
8084}
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ isFullscreen.value = !!(
2121);
2222 </script >
2323<template >
24- <VbenIconButton @click =" toggle " >
24+ <VbenIconButton
25+ class="hover:animate- [shrink_0.3s_ease-in-out ]"
26+ @click =" toggle "
27+ >
2528 <Minimize v-if =" isFullscreen " class="text-foreground size-4" />
2629 <Maximize v-else class="text-foreground size-4" />
2730 </VbenIconButton >
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ async function handleUpdate(value: string | undefined) {
3131 :model-value =" preferences .app .locale "
3232 @update :model-value =" handleUpdate "
3333 >
34- <VbenIconButton >
34+ <VbenIconButton class="hover: animate- [shrink_0. 3s_ease-in-out ]" >
3535 <Languages class="text-foreground size-4" />
3636 </VbenIconButton >
3737 </VbenDropdownRadioMenu >
Original file line number Diff line number Diff line change 22import { SUPPORT_LANGUAGES } from ' @vben/constants' ;
33import { $t } from ' @vben/locales' ;
44
5+ import InputItem from ' ../input-item.vue' ;
56import SelectItem from ' ../select-item.vue' ;
67import SwitchItem from ' ../switch-item.vue' ;
78
@@ -12,6 +13,7 @@ defineOptions({
1213const appLocale = defineModel <string >(' appLocale' );
1314const appDynamicTitle = defineModel <boolean >(' appDynamicTitle' );
1415const appWatermark = defineModel <boolean >(' appWatermark' );
16+ const appWatermarkContent = defineModel <string >(' appWatermarkContent' );
1517const appEnableCheckUpdates = defineModel <boolean >(' appEnableCheckUpdates' );
1618 </script >
1719
@@ -22,9 +24,23 @@ const appEnableCheckUpdates = defineModel<boolean>('appEnableCheckUpdates');
2224 <SwitchItem v-model =" appDynamicTitle " >
2325 {{ $t('preferences.dynamicTitle') }}
2426 </SwitchItem >
25- <SwitchItem v-model =" appWatermark " >
27+ <SwitchItem
28+ v-model =" appWatermark "
29+ @update :model-value ="
30+ (val ) => {
31+ if (! val ) appWatermarkContent = ' ' ;
32+ }
33+ "
34+ >
2635 {{ $t('preferences.watermark') }}
2736 </SwitchItem >
37+ <InputItem
38+ v-if =" appWatermark "
39+ v-model =" appWatermarkContent "
40+ :placeholder =" $t (' preferences.watermarkContent' )"
41+ >
42+ {{ $t('preferences.watermarkContent') }}
43+ </InputItem >
2844 <SwitchItem v-model =" appEnableCheckUpdates " >
2945 {{ $t('preferences.checkUpdates') }}
3046 </SwitchItem >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { SelectOption } from '@vben/types';
33
44import { useSlots } from ' vue' ;
55
6- import { CircleHelp } from ' @vben/icons' ;
6+ import { CircleHelp , CircleX } from ' @vben/icons' ;
77
88import { Input , VbenTooltip } from ' @vben-core/shadcn-ui' ;
99
@@ -47,6 +47,17 @@ const slots = useSlots();
4747 <slot name =" tip" ></slot >
4848 </VbenTooltip >
4949 </span >
50- <Input v-model =" inputValue " class="h-8 w-[165px]" />
50+ <div class =" relative" >
51+ <Input
52+ v-model =" inputValue "
53+ class="h-8 w-[165px]"
54+ :placeholder =" placeholder "
55+ />
56+ <CircleX
57+ v-if =" inputValue "
58+ class="hover:text-foreground text-foreground/60 absolute right-2 top-1/2 size-3 -translate-y-1/2 transform cursor-pointer"
59+ @click =" () => (inputValue = ' ' ) "
60+ />
61+ </div >
5162 </div >
5263</template >
You can’t perform that action at this time.
0 commit comments