From 13a4f6ab63b8f75c31c45b4b23d812ae63c9ce45 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Thu, 18 Dec 2025 10:02:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=8F=E6=B0=B4?= =?UTF-8?q?=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yaml | 3 + locales/zh-CN.yaml | 3 + src/layout/components/lay-setting/index.vue | 94 +++++++++++++++++---- 3 files changed, 82 insertions(+), 18 deletions(-) diff --git a/locales/en.yaml b/locales/en.yaml index 1b38890a1..603274e7d 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -55,6 +55,9 @@ panel: pureTagsStyleCardTip: Card tags for efficient browsing pureTagsStyleChrome: Chrome pureTagsStyleChromeTip: Chrome style is classic and elegant + pureFullScreenWatermark: FullScreen Watermark + pureEnableWatermark: Watermark + pureWatermarkText: Text pureInterfaceDisplay: Interface Display pureGreyModel: Grey Model pureWeakModel: Weak Model diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 48fb0ec6c..f73f6c3fd 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -55,6 +55,9 @@ panel: pureTagsStyleCardTip: 卡片标签,高效浏览 pureTagsStyleChrome: 谷歌 pureTagsStyleChromeTip: 谷歌风格,经典美观 + pureFullScreenWatermark: 全屏水印 + pureEnableWatermark: 水印 + pureWatermarkText: 文本 pureInterfaceDisplay: 界面显示 pureGreyModel: 灰色模式 pureWeakModel: 色弱模式 diff --git a/src/layout/components/lay-setting/index.vue b/src/layout/components/lay-setting/index.vue index 0ae2b2a2b..c894696d7 100644 --- a/src/layout/components/lay-setting/index.vue +++ b/src/layout/components/lay-setting/index.vue @@ -9,6 +9,14 @@ import { onUnmounted, onBeforeMount } from "vue"; +import { + useDark, + debounce, + isNumber, + useGlobal, + isAllEmpty, + useWatermark +} from "@pureadmin/utils"; import { useI18n } from "vue-i18n"; import { emitter } from "@/utils/mitt"; import LayPanel from "../lay-panel/index.vue"; @@ -17,7 +25,6 @@ import { useAppStoreHook } from "@/store/modules/app"; import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; import Segmented, { type OptionsType } from "@/components/ReSegmented"; import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange"; -import { useDark, useGlobal, debounce, isNumber } from "@pureadmin/utils"; import Check from "~icons/ep/check"; import LeftArrow from "~icons/ri/arrow-left-s-line?width=20&height=20"; @@ -27,8 +34,9 @@ import DarkIcon from "@/assets/svg/dark.svg?component"; import SystemIcon from "@/assets/svg/system.svg?component"; const { t } = useI18n(); -const { device } = useNav(); const { isDark } = useDark(); +const { device, title } = useNav(); +const { setWatermark, clear } = useWatermark(); const { $storage } = useGlobal(); const mixRef = ref(); @@ -58,6 +66,12 @@ const markValue = ref($storage.configure?.showModel ?? "smart"); const logoVal = ref($storage.configure?.showLogo ?? true); +/** WIP... */ +const watermarkConfigs = reactive({ + enable: false, + text: null +}); + const settings = reactive({ greyVal: $storage.configure.grey, weakVal: $storage.configure.weak, @@ -129,6 +143,21 @@ function onChange({ option }) { emitter.emit("tagViewsShowModel", value); } +function onWatermarkSwitchChange(value) { + const text = isAllEmpty(watermarkConfigs.text) + ? title.value + : watermarkConfigs.text; + if (value) { + setWatermark(text); + } else { + clear(); + } +} + +function onWatermarkInputChange(value) { + setWatermark(value); +} + /** 侧边栏Logo */ function logoChange() { unref(logoVal) @@ -448,29 +477,38 @@ onUnmounted(() => removeMatchMedia); />

- {{ t("panel.pureInterfaceDisplay") }} + {{ t("panel.pureFullScreenWatermark") }}

+ +

+ {{ t("panel.pureInterfaceDisplay") }} +

+