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/48/MERGE
GavinLucky 2024-10-10 21:59:43 +08:00 committed by GitHub
parent ba539f6793
commit 437cb02e11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 13 additions and 5 deletions

View File

@ -37,6 +37,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
"enable": true, "enable": true,
"icp": "", "icp": "",
"icpLink": "", "icpLink": "",
"settingShow": true,
}, },
"footer": { "footer": {
"enable": false, "enable": false,

View File

@ -37,6 +37,7 @@ const defaultPreferences: Preferences = {
enable: true, enable: true,
icp: '', icp: '',
icpLink: '', icpLink: '',
settingShow: true,
}, },
footer: { footer: {
enable: false, enable: false,

View File

@ -88,6 +88,8 @@ interface CopyrightPreferences {
icp: string; icp: string;
/** 备案号链接 */ /** 备案号链接 */
icpLink: string; icpLink: string;
/** 设置面板是否显示*/
settingShow?: boolean;
} }
interface FooterPreferences { interface FooterPreferences {

View File

@ -7,7 +7,7 @@ import InputItem from '../input-item.vue';
import SwitchItem from '../switch-item.vue'; import SwitchItem from '../switch-item.vue';
defineOptions({ defineOptions({
name: 'PreferenceBreadcrumbConfig', name: 'PreferenceCopyrightConfig',
}); });
const props = defineProps<{ disabled: boolean }>(); const props = defineProps<{ disabled: boolean }>();

View File

@ -4,7 +4,7 @@ import { $t } from '@vben/locales';
import SwitchItem from '../switch-item.vue'; import SwitchItem from '../switch-item.vue';
defineOptions({ defineOptions({
name: 'PreferenceBreadcrumbConfig', name: 'PreferenceFooterConfig',
}); });
const footerEnable = defineModel<boolean>('footerEnable'); const footerEnable = defineModel<boolean>('footerEnable');

View File

@ -7,7 +7,7 @@ import SelectItem from '../select-item.vue';
import SwitchItem from '../switch-item.vue'; import SwitchItem from '../switch-item.vue';
defineOptions({ defineOptions({
name: 'PreferenceBreadcrumbConfig', name: 'PreferenceHeaderConfig',
}); });
defineProps<{ disabled: boolean }>(); defineProps<{ disabled: boolean }>();

View File

@ -5,7 +5,7 @@ import NumberFieldItem from '../number-field-item.vue';
import SwitchItem from '../switch-item.vue'; import SwitchItem from '../switch-item.vue';
defineOptions({ defineOptions({
name: 'PreferenceBreadcrumbConfig', name: 'PreferenceSidebarConfig',
}); });
defineProps<{ disabled: boolean }>(); defineProps<{ disabled: boolean }>();

View File

@ -116,6 +116,7 @@ const navigationAccordion = defineModel<boolean>('navigationAccordion');
const footerEnable = defineModel<boolean>('footerEnable'); const footerEnable = defineModel<boolean>('footerEnable');
const footerFixed = defineModel<boolean>('footerFixed'); const footerFixed = defineModel<boolean>('footerFixed');
const copyrightSettingShow = defineModel<boolean>('copyrightSettingShow');
const copyrightEnable = defineModel<boolean>('copyrightEnable'); const copyrightEnable = defineModel<boolean>('copyrightEnable');
const copyrightCompanyName = defineModel<string>('copyrightCompanyName'); const copyrightCompanyName = defineModel<string>('copyrightCompanyName');
const copyrightCompanySiteLink = defineModel<string>( const copyrightCompanySiteLink = defineModel<string>(
@ -369,7 +370,10 @@ async function handleReset() {
v-model:footer-fixed="footerFixed" v-model:footer-fixed="footerFixed"
/> />
</Block> </Block>
<Block :title="$t('preferences.copyright.title')"> <Block
v-if="copyrightSettingShow"
:title="$t('preferences.copyright.title')"
>
<Copyright <Copyright
v-model:copyright-company-name="copyrightCompanyName" v-model:copyright-company-name="copyrightCompanyName"
v-model:copyright-company-site-link="copyrightCompanySiteLink" v-model:copyright-company-site-link="copyrightCompanySiteLink"