98 lines
2.7 KiB
TypeScript
98 lines
2.7 KiB
TypeScript
import {
|
|
appCopyrightPreferences,
|
|
defineOverridesPreferences,
|
|
definePreferencesExtension,
|
|
} from '@vben/preferences';
|
|
|
|
interface WebAntdPreferencesExtension {
|
|
defaultTableSize: number;
|
|
enableFormFullscreen: boolean;
|
|
reportTitle: string;
|
|
tenantMode: 'multi' | 'single';
|
|
}
|
|
|
|
/**
|
|
* @description 项目配置文件
|
|
* 只需要覆盖项目中的一部分配置,不需要的配置不用覆盖,会自动使用默认配置
|
|
* !!! 更改配置后请清空缓存,否则可能不生效
|
|
*/
|
|
export const overridesPreferences = defineOverridesPreferences({
|
|
// overrides
|
|
app: {
|
|
// 权限模式 frontend 默认前端控制 backend 后端控制
|
|
accessMode: 'backend',
|
|
name: import.meta.env.VITE_APP_TITLE,
|
|
layout: 'sidebar-mixed-nav',
|
|
// 是否开启检查更新
|
|
enableCheckUpdates: true,
|
|
defaultHomePath: '/workspace',
|
|
// 检查更新的时间间隔,单位为分钟
|
|
checkUpdatesInterval: 1,
|
|
enableRefreshToken: false,
|
|
},
|
|
// logo: {
|
|
// enable: true,
|
|
// source:
|
|
// // 'https://yanydy.oss-cn-hangzhou.aliyuncs.com/uploads/20241219/2b38e38414a2b9383b8643983e3f69d7.png',
|
|
// '/img/logo.png',
|
|
// },
|
|
sidebar: {
|
|
width: 220,
|
|
},
|
|
theme: {
|
|
builtinType: 'violet',
|
|
colorPrimary: 'hsl(245 82% 67%)',
|
|
mode: 'auto',
|
|
},
|
|
copyright: appCopyrightPreferences,
|
|
});
|
|
|
|
export const preferencesExtension =
|
|
definePreferencesExtension<WebAntdPreferencesExtension>({
|
|
tabLabel: 'preferences.antd.tabLabel',
|
|
title: 'preferences.antd.title',
|
|
fields: [
|
|
{
|
|
component: 'switch',
|
|
defaultValue: true,
|
|
key: 'enableFormFullscreen',
|
|
label: 'preferences.antd.fields.enableFormFullscreen.label',
|
|
tip: 'preferences.antd.fields.enableFormFullscreen.tip',
|
|
},
|
|
{
|
|
component: 'select',
|
|
defaultValue: 'single',
|
|
key: 'tenantMode',
|
|
label: 'preferences.antd.fields.tenantMode.label',
|
|
options: [
|
|
{
|
|
label: 'preferences.antd.fields.tenantMode.options.single.label',
|
|
value: 'single',
|
|
},
|
|
{
|
|
label: 'preferences.antd.fields.tenantMode.options.multi.label',
|
|
value: 'multi',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
component: 'number',
|
|
componentProps: {
|
|
max: 200,
|
|
min: 10,
|
|
step: 10,
|
|
},
|
|
defaultValue: 20,
|
|
key: 'defaultTableSize',
|
|
label: 'preferences.antd.fields.defaultTableSize.label',
|
|
},
|
|
{
|
|
component: 'input',
|
|
defaultValue: '',
|
|
key: 'reportTitle',
|
|
label: 'preferences.antd.fields.reportTitle.label',
|
|
placeholder: 'preferences.antd.fields.reportTitle.placeholder',
|
|
},
|
|
],
|
|
});
|