Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: preferences settings panel to add display switches with copyright #4603

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
"enable": true,
"icp": "",
"icpLink": "",
"settingShow": true,
},
"footer": {
"enable": false,
Expand Down
1 change: 1 addition & 0 deletions packages/@core/preferences/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const defaultPreferences: Preferences = {
enable: true,
icp: '',
icpLink: '',
settingShow: true,
},
footer: {
enable: false,
Expand Down
2 changes: 2 additions & 0 deletions packages/@core/preferences/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ interface CopyrightPreferences {
icp: string;
/** 备案号链接 */
icpLink: string;
/** 设置面板是否显示*/
settingShow?: boolean;
}

interface FooterPreferences {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { $t } from '@vben/locales';
import SwitchItem from '../switch-item.vue';

defineOptions({
name: 'PreferenceBreadcrumbConfig',
name: 'PreferenceFooterConfig',
anncwb marked this conversation as resolved.
Show resolved Hide resolved
});

const footerEnable = defineModel<boolean>('footerEnable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SelectItem from '../select-item.vue';
import SwitchItem from '../switch-item.vue';

defineOptions({
name: 'PreferenceBreadcrumbConfig',
name: 'PreferenceHeaderConfig',
anncwb marked this conversation as resolved.
Show resolved Hide resolved
});

defineProps<{ disabled: boolean }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down Expand Up @@ -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"
Expand Down