From d5e9dc8c955516e2deb83eb2b97e9564a73af0a2 Mon Sep 17 00:00:00 2001 From: ZhangYantao Date: Thu, 10 Oct 2024 11:23:42 +0800 Subject: [PATCH 1/2] feat: preferences settings panel to add display switches with copyright --- packages/@core/preferences/src/config.ts | 1 + packages/@core/preferences/src/types.ts | 2 ++ .../src/widgets/preferences/blocks/layout/copyright.vue | 2 +- .../src/widgets/preferences/blocks/layout/footer.vue | 2 +- .../src/widgets/preferences/blocks/layout/header.vue | 2 +- .../src/widgets/preferences/blocks/layout/sidebar.vue | 2 +- .../layouts/src/widgets/preferences/preferences-drawer.vue | 6 +++++- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/@core/preferences/src/config.ts b/packages/@core/preferences/src/config.ts index 6da8eda1c91..2d685042184 100644 --- a/packages/@core/preferences/src/config.ts +++ b/packages/@core/preferences/src/config.ts @@ -37,6 +37,7 @@ const defaultPreferences: Preferences = { enable: true, icp: '', icpLink: '', + settingShow: true, }, footer: { enable: false, diff --git a/packages/@core/preferences/src/types.ts b/packages/@core/preferences/src/types.ts index 45bde56fce5..2b536b85a81 100644 --- a/packages/@core/preferences/src/types.ts +++ b/packages/@core/preferences/src/types.ts @@ -88,6 +88,8 @@ interface CopyrightPreferences { icp: string; /** 备案号链接 */ icpLink: string; + /** 设置面板是否显示*/ + settingShow?: boolean; } interface FooterPreferences { diff --git a/packages/effects/layouts/src/widgets/preferences/blocks/layout/copyright.vue b/packages/effects/layouts/src/widgets/preferences/blocks/layout/copyright.vue index 484eece16af..8db2822e329 100644 --- a/packages/effects/layouts/src/widgets/preferences/blocks/layout/copyright.vue +++ b/packages/effects/layouts/src/widgets/preferences/blocks/layout/copyright.vue @@ -7,7 +7,7 @@ import InputItem from '../input-item.vue'; import SwitchItem from '../switch-item.vue'; defineOptions({ - name: 'PreferenceBreadcrumbConfig', + name: 'PreferenceCopyrightConfig', }); const props = defineProps<{ disabled: boolean }>(); diff --git a/packages/effects/layouts/src/widgets/preferences/blocks/layout/footer.vue b/packages/effects/layouts/src/widgets/preferences/blocks/layout/footer.vue index be161743066..17964db885e 100644 --- a/packages/effects/layouts/src/widgets/preferences/blocks/layout/footer.vue +++ b/packages/effects/layouts/src/widgets/preferences/blocks/layout/footer.vue @@ -4,7 +4,7 @@ import { $t } from '@vben/locales'; import SwitchItem from '../switch-item.vue'; defineOptions({ - name: 'PreferenceBreadcrumbConfig', + name: 'PreferenceFooterConfig', }); const footerEnable = defineModel('footerEnable'); diff --git a/packages/effects/layouts/src/widgets/preferences/blocks/layout/header.vue b/packages/effects/layouts/src/widgets/preferences/blocks/layout/header.vue index 07fdaf29f85..ccfac0d441c 100644 --- a/packages/effects/layouts/src/widgets/preferences/blocks/layout/header.vue +++ b/packages/effects/layouts/src/widgets/preferences/blocks/layout/header.vue @@ -7,7 +7,7 @@ import SelectItem from '../select-item.vue'; import SwitchItem from '../switch-item.vue'; defineOptions({ - name: 'PreferenceBreadcrumbConfig', + name: 'PreferenceHeaderConfig', }); defineProps<{ disabled: boolean }>(); diff --git a/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue b/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue index 36925f851f5..5aeee7c4110 100644 --- a/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue +++ b/packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue @@ -5,7 +5,7 @@ import NumberFieldItem from '../number-field-item.vue'; import SwitchItem from '../switch-item.vue'; defineOptions({ - name: 'PreferenceBreadcrumbConfig', + name: 'PreferenceSidebarConfig', }); defineProps<{ disabled: boolean }>(); diff --git a/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue b/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue index ab713a7b7f1..1cece3c17ab 100644 --- a/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue +++ b/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue @@ -116,6 +116,7 @@ const navigationAccordion = defineModel('navigationAccordion'); const footerEnable = defineModel('footerEnable'); const footerFixed = defineModel('footerFixed'); +const copyrightSettingShow = defineModel('copyrightSettingShow'); const copyrightEnable = defineModel('copyrightEnable'); const copyrightCompanyName = defineModel('copyrightCompanyName'); const copyrightCompanySiteLink = defineModel( @@ -369,7 +370,10 @@ async function handleReset() { v-model:footer-fixed="footerFixed" /> - + Date: Thu, 10 Oct 2024 16:27:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20snapshots=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preferences/__tests__/__snapshots__/config.test.ts.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap b/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap index b6bf7b1635a..70868234743 100644 --- a/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap +++ b/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap @@ -37,6 +37,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj "enable": true, "icp": "", "icpLink": "", + "settingShow": true, }, "footer": { "enable": false,