Browse Source
feat: preferences settings panel to add display switches with copyright (#4603)
* feat: preferences settings panel to add display switches with copyright
* feat: 更新 snapshots 测试用例
---------
Co-authored-by: ZhangYantao <Gavin@163.com>
pull/4607/head
GavinLucky
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with
13 additions and
5 deletions
-
packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap
-
packages/@core/preferences/src/config.ts
-
packages/@core/preferences/src/types.ts
-
packages/effects/layouts/src/widgets/preferences/blocks/layout/copyright.vue
-
packages/effects/layouts/src/widgets/preferences/blocks/layout/footer.vue
-
packages/effects/layouts/src/widgets/preferences/blocks/layout/header.vue
-
packages/effects/layouts/src/widgets/preferences/blocks/layout/sidebar.vue
-
packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue
|
|
|
@ -37,6 +37,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj |
|
|
|
"enable": true, |
|
|
|
"icp": "", |
|
|
|
"icpLink": "", |
|
|
|
"settingShow": true, |
|
|
|
}, |
|
|
|
"footer": { |
|
|
|
"enable": false, |
|
|
|
|
|
|
|
@ -37,6 +37,7 @@ const defaultPreferences: Preferences = { |
|
|
|
enable: true, |
|
|
|
icp: '', |
|
|
|
icpLink: '', |
|
|
|
settingShow: true, |
|
|
|
}, |
|
|
|
footer: { |
|
|
|
enable: false, |
|
|
|
|
|
|
|
@ -88,6 +88,8 @@ interface CopyrightPreferences { |
|
|
|
icp: string; |
|
|
|
/** 备案号链接 */ |
|
|
|
icpLink: string; |
|
|
|
/** 设置面板是否显示*/ |
|
|
|
settingShow?: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
interface FooterPreferences { |
|
|
|
|
|
|
|
@ -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 }>(); |
|
|
|
|
|
|
|
@ -4,7 +4,7 @@ import { $t } from '@vben/locales'; |
|
|
|
import SwitchItem from '../switch-item.vue'; |
|
|
|
|
|
|
|
defineOptions({ |
|
|
|
name: 'PreferenceBreadcrumbConfig', |
|
|
|
name: 'PreferenceFooterConfig', |
|
|
|
}); |
|
|
|
|
|
|
|
const footerEnable = defineModel<boolean>('footerEnable'); |
|
|
|
|
|
|
|
@ -7,7 +7,7 @@ import SelectItem from '../select-item.vue'; |
|
|
|
import SwitchItem from '../switch-item.vue'; |
|
|
|
|
|
|
|
defineOptions({ |
|
|
|
name: 'PreferenceBreadcrumbConfig', |
|
|
|
name: 'PreferenceHeaderConfig', |
|
|
|
}); |
|
|
|
|
|
|
|
defineProps<{ disabled: boolean }>(); |
|
|
|
|
|
|
|
@ -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 }>(); |
|
|
|
|
|
|
|
@ -116,6 +116,7 @@ const navigationAccordion = defineModel<boolean>('navigationAccordion'); |
|
|
|
const footerEnable = defineModel<boolean>('footerEnable'); |
|
|
|
const footerFixed = defineModel<boolean>('footerFixed'); |
|
|
|
|
|
|
|
const copyrightSettingShow = defineModel<boolean>('copyrightSettingShow'); |
|
|
|
const copyrightEnable = defineModel<boolean>('copyrightEnable'); |
|
|
|
const copyrightCompanyName = defineModel<string>('copyrightCompanyName'); |
|
|
|
const copyrightCompanySiteLink = defineModel<string>( |
|
|
|
@ -369,7 +370,10 @@ async function handleReset() { |
|
|
|
v-model:footer-fixed="footerFixed" |
|
|
|
/> |
|
|
|
</Block> |
|
|
|
<Block :title="$t('preferences.copyright.title')"> |
|
|
|
<Block |
|
|
|
v-if="copyrightSettingShow" |
|
|
|
:title="$t('preferences.copyright.title')" |
|
|
|
> |
|
|
|
<Copyright |
|
|
|
v-model:copyright-company-name="copyrightCompanyName" |
|
|
|
v-model:copyright-company-site-link="copyrightCompanySiteLink" |
|
|
|
|