mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
前端和后端源码,合并到一个git仓库中,方便用户下载,避免前后端不匹配的问题
This commit is contained in:
93
jeecgboot-vue3/src/settings/componentSetting.ts
Normal file
93
jeecgboot-vue3/src/settings/componentSetting.ts
Normal file
@ -0,0 +1,93 @@
|
||||
// 用于配置某些组件的常规配置,而无需修改组件
|
||||
|
||||
import type { SorterResult } from '../components/Table';
|
||||
|
||||
export default {
|
||||
// 表格配置
|
||||
table: {
|
||||
// 表格接口请求通用配置,可在组件prop覆盖
|
||||
// 支持 xxx.xxx.xxx格式
|
||||
fetchSetting: {
|
||||
// 传给后台的当前页字段
|
||||
pageField: 'pageNo',
|
||||
// 传给后台的每页显示多少条的字段
|
||||
sizeField: 'pageSize',
|
||||
// 接口返回表格数据的字段
|
||||
listField: 'records',
|
||||
// 接口返回表格总数的字段
|
||||
totalField: 'total',
|
||||
},
|
||||
// 可选的分页选项
|
||||
pageSizeOptions: ['10', '50', '80', '100'],
|
||||
// 表格默认尺寸
|
||||
defaultSize: 'middle',
|
||||
//默认每页显示多少条
|
||||
defaultPageSize: 10,
|
||||
// 默认排序方法
|
||||
defaultSortFn: (sortInfo: SorterResult) => {
|
||||
//update-begin-author:taoyan date:2022-10-21 for: VUEN-2199【表单设计器】多字段排序
|
||||
if(sortInfo instanceof Array){
|
||||
let sortInfoArray:any[] = []
|
||||
for(let item of sortInfo){
|
||||
let info = getSort(item);
|
||||
if(info){
|
||||
sortInfoArray.push(info)
|
||||
}
|
||||
}
|
||||
return {
|
||||
sortInfoString: JSON.stringify(sortInfoArray)
|
||||
}
|
||||
}else{
|
||||
let info = getSort(sortInfo)
|
||||
return info || {}
|
||||
}
|
||||
//update-end-author:taoyan date:2022-10-21 for: VUEN-2199【表单设计器】多字段排序
|
||||
},
|
||||
// 自定义过滤方法
|
||||
defaultFilterFn: (data: Partial<Recordable<string[]>>) => {
|
||||
return data;
|
||||
},
|
||||
// update-begin--author:liaozhiyang---date:20240424---for:【issues/1188】BasicTable加上scrollToFirstRowOnChange类型定义
|
||||
scrollToFirstRowOnChange: false,
|
||||
// update-end--author:liaozhiyang---date:20240424---for:【issues/1188】BasicTable加上scrollToFirstRowOnChange类型定义
|
||||
},
|
||||
// 滚动组件配置
|
||||
scrollbar: {
|
||||
// 是否使用原生滚动样式
|
||||
// 开启后,菜单,弹窗,抽屉会使用原生滚动条组件
|
||||
native: false,
|
||||
},
|
||||
//表单配置
|
||||
form: {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 4 },
|
||||
xl: { span: 6 },
|
||||
xxl: { span: 4 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 18 },
|
||||
},
|
||||
//表单默认冒号
|
||||
colon: true,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取排序信息
|
||||
* @param item
|
||||
*/
|
||||
function getSort(item){
|
||||
const { field, order } = item;
|
||||
if (field && order) {
|
||||
let sortType = 'ascend' == order ? 'asc' : 'desc';
|
||||
return {
|
||||
// 排序字段
|
||||
column: field,
|
||||
// 排序方式 asc/desc
|
||||
order: sortType,
|
||||
};
|
||||
}
|
||||
return ''
|
||||
}
|
||||
71
jeecgboot-vue3/src/settings/designSetting.ts
Normal file
71
jeecgboot-vue3/src/settings/designSetting.ts
Normal file
@ -0,0 +1,71 @@
|
||||
import { ThemeEnum } from '../enums/appEnum';
|
||||
|
||||
export const prefixCls = 'jeecg';
|
||||
|
||||
export const darkMode = ThemeEnum.LIGHT;
|
||||
|
||||
// app theme preset color
|
||||
export const APP_PRESET_COLOR_LIST: string[] = [
|
||||
'#0960bd',
|
||||
'#1890ff',
|
||||
'#009688',
|
||||
'#536dfe',
|
||||
'#ff5c93',
|
||||
'#13c2c2',
|
||||
'#52c41a',
|
||||
'#ee4f12',
|
||||
'#0096c7',
|
||||
'#9c27b0',
|
||||
'#ff9800',
|
||||
];
|
||||
|
||||
// header preset color
|
||||
export const HEADER_PRESET_BG_COLOR_LIST: string[] = [
|
||||
'#ffffff',
|
||||
'#151515',
|
||||
'#009688',
|
||||
'#5172DC',
|
||||
'#018ffb',
|
||||
'#13c2c2',
|
||||
'#e74c3c',
|
||||
'#52c41a',
|
||||
'#394664',
|
||||
'#faad14',
|
||||
'#383f45',
|
||||
];
|
||||
|
||||
// sider preset color
|
||||
export const SIDE_BAR_BG_COLOR_LIST: string[] = [
|
||||
'#001529',
|
||||
// '#212121',
|
||||
'#009688',
|
||||
'#273352',
|
||||
'#ffffff',
|
||||
'#191b24',
|
||||
// '#191a23',
|
||||
'#037bd5',
|
||||
'#304156',
|
||||
'#001628',
|
||||
'#28333E',
|
||||
// '#344058',
|
||||
'#e74c3c',
|
||||
'#383f45',
|
||||
];
|
||||
|
||||
// sider logo line preset color [logo<67><6F><EFBFBD><EFBFBD>ɫ]
|
||||
export const SIDER_LOGO_BG_COLOR_LIST: string[] = [
|
||||
'linear-gradient(180deg, #000000, #021d37)',
|
||||
// 'linear-gradient(180deg, #000000, #282828)',
|
||||
'linear-gradient(180deg, #078d80, #029184)',
|
||||
'linear-gradient(180deg, #1c253e, #2b385c)',
|
||||
'linear-gradient(180deg, #ffffff, #ffffff)',
|
||||
'linear-gradient(180deg, #000000, #242735)',
|
||||
// 'linear-gradient(180deg, #000000, #1d1f2a)',
|
||||
'linear-gradient(180deg, #1d77bb, #188efa)',
|
||||
'linear-gradient(180deg, #304156, #32455d)',
|
||||
'linear-gradient(180deg, #000000, #001f39)',
|
||||
'linear-gradient(180deg, #000000, #2b3743)',
|
||||
// 'linear-gradient(180deg, #344058, #374560)',
|
||||
'linear-gradient(180deg, #e83723, #e52611)',
|
||||
'linear-gradient(180deg, #383f45, #3b434b)',
|
||||
];
|
||||
13
jeecgboot-vue3/src/settings/encryptionSetting.ts
Normal file
13
jeecgboot-vue3/src/settings/encryptionSetting.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { isDevMode } from '/@/utils/env';
|
||||
|
||||
// 缓存默认过期时间
|
||||
export const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7;
|
||||
|
||||
// 开启缓存加密后,加密密钥。采用aes加密
|
||||
export const cacheCipher = {
|
||||
key: '_11111000001111@',
|
||||
iv: '@11111000001111_',
|
||||
};
|
||||
|
||||
// 是否加密缓存,默认生产环境加密
|
||||
export const enableStorageEncryption = false;
|
||||
30
jeecgboot-vue3/src/settings/localeSetting.ts
Normal file
30
jeecgboot-vue3/src/settings/localeSetting.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import type { DropMenu } from '../components/Dropdown';
|
||||
import type { LocaleSetting, LocaleType } from '/#/config';
|
||||
|
||||
export const LOCALE: { [key: string]: LocaleType } = {
|
||||
ZH_CN: 'zh_CN',
|
||||
EN_US: 'en',
|
||||
};
|
||||
|
||||
export const localeSetting: LocaleSetting = {
|
||||
// 是否显示语言选择器
|
||||
showPicker: true,
|
||||
// 当前语言
|
||||
locale: LOCALE.ZH_CN,
|
||||
// 默认语言
|
||||
fallback: LOCALE.ZH_CN,
|
||||
// 允许的语言
|
||||
availableLocales: [LOCALE.ZH_CN, LOCALE.EN_US],
|
||||
};
|
||||
|
||||
// 语言列表
|
||||
export const localeList: DropMenu[] = [
|
||||
{
|
||||
text: '简体中文',
|
||||
event: LOCALE.ZH_CN,
|
||||
},
|
||||
{
|
||||
text: 'English',
|
||||
event: LOCALE.EN_US,
|
||||
},
|
||||
];
|
||||
192
jeecgboot-vue3/src/settings/projectSetting.ts
Normal file
192
jeecgboot-vue3/src/settings/projectSetting.ts
Normal file
@ -0,0 +1,192 @@
|
||||
import type { ProjectConfig } from '/#/config';
|
||||
import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum';
|
||||
import { CacheTypeEnum } from '/@/enums/cacheEnum';
|
||||
import {
|
||||
ContentEnum,
|
||||
PermissionModeEnum,
|
||||
ThemeEnum,
|
||||
RouterTransitionEnum,
|
||||
SettingButtonPositionEnum,
|
||||
SessionTimeoutProcessingEnum,
|
||||
TabsThemeEnum,
|
||||
} from '/@/enums/appEnum';
|
||||
import { SIDE_BAR_BG_COLOR_LIST, HEADER_PRESET_BG_COLOR_LIST } from './designSetting';
|
||||
import { primaryColor } from '../../build/config/themeConfig';
|
||||
|
||||
// ! 改动后需要清空浏览器缓存
|
||||
const setting: ProjectConfig = {
|
||||
// 是否显示SettingButton
|
||||
showSettingButton: true,
|
||||
|
||||
// 是否显示主题切换按钮
|
||||
showDarkModeToggle: true,
|
||||
|
||||
// 设置按钮位置 可选项
|
||||
// SettingButtonPositionEnum.AUTO: 自动选择
|
||||
// SettingButtonPositionEnum.HEADER: 位于头部
|
||||
// SettingButtonPositionEnum.FIXED: 固定在右侧
|
||||
settingButtonPosition: SettingButtonPositionEnum.AUTO,
|
||||
|
||||
// 权限模式,默认前端角色权限模式
|
||||
// ROUTE_MAPPING: 前端模式(菜单由路由生成,默认)
|
||||
// ROLE:前端模式(菜单路由分开)
|
||||
// BACK:后台模式
|
||||
permissionMode: PermissionModeEnum.BACK,
|
||||
|
||||
// 权限缓存存放位置。默认存放于localStorage
|
||||
permissionCacheType: CacheTypeEnum.LOCAL,
|
||||
|
||||
// 会话超时处理方案
|
||||
// SessionTimeoutProcessingEnum.ROUTE_JUMP: 路由跳转到登录页
|
||||
// SessionTimeoutProcessingEnum.PAGE_COVERAGE: 生成登录弹窗,覆盖当前页面
|
||||
sessionTimeoutProcessing: SessionTimeoutProcessingEnum.ROUTE_JUMP,
|
||||
|
||||
// 项目主题色
|
||||
themeColor: primaryColor,
|
||||
|
||||
// 网站灰色模式,用于可能悼念的日期开启
|
||||
grayMode: false,
|
||||
|
||||
// 色弱模式
|
||||
colorWeak: false,
|
||||
|
||||
// 是否取消菜单,顶部,多标签页显示, 用于可能内嵌在别的系统内
|
||||
fullContent: false,
|
||||
|
||||
// 主题内容宽度
|
||||
contentMode: ContentEnum.FULL,
|
||||
|
||||
// 是否显示logo
|
||||
showLogo: true,
|
||||
|
||||
// 是否显示底部信息 copyright
|
||||
showFooter: false,
|
||||
|
||||
// 头部配置
|
||||
headerSetting: {
|
||||
// 背景色
|
||||
bgColor: HEADER_PRESET_BG_COLOR_LIST[4],
|
||||
// 固定头部
|
||||
fixed: true,
|
||||
// 是否显示顶部
|
||||
show: true,
|
||||
// 主题
|
||||
theme: ThemeEnum.LIGHT,
|
||||
// 开启锁屏功能
|
||||
useLockPage: false,
|
||||
// 显示全屏按钮
|
||||
showFullScreen: false,
|
||||
// 显示官网按钮
|
||||
showDoc: false,
|
||||
// 显示消息中心按钮
|
||||
showNotice: true,
|
||||
// 显示菜单搜索按钮
|
||||
showSearch: true,
|
||||
},
|
||||
|
||||
// 菜单配置
|
||||
menuSetting: {
|
||||
// 背景色
|
||||
bgColor: SIDE_BAR_BG_COLOR_LIST[0],
|
||||
// 是否固定住左侧菜单
|
||||
fixed: true,
|
||||
// 菜单折叠
|
||||
collapsed: false,
|
||||
// 折叠菜单时候是否显示菜单名
|
||||
collapsedShowTitle: false,
|
||||
// 是否可拖拽
|
||||
// Only limited to the opening of the left menu, the mouse has a drag bar on the right side of the menu
|
||||
canDrag: false,
|
||||
// Whether to show no dom
|
||||
show: true,
|
||||
// Whether to show dom
|
||||
hidden: false,
|
||||
// 菜单宽度
|
||||
menuWidth: 210,
|
||||
// 菜单模式
|
||||
mode: MenuModeEnum.INLINE,
|
||||
// 菜单类型
|
||||
type: MenuTypeEnum.SIDEBAR,
|
||||
// 菜单主题
|
||||
theme: ThemeEnum.DARK,
|
||||
// 分割菜单
|
||||
split: false,
|
||||
// 顶部菜单布局
|
||||
topMenuAlign: 'center',
|
||||
// 折叠触发器的位置
|
||||
trigger: TriggerEnum.HEADER,
|
||||
// 手风琴模式,只展示一个菜单
|
||||
accordion: true,
|
||||
// 在路由切换的时候关闭左侧混合菜单展开菜单
|
||||
closeMixSidebarOnChange: false,
|
||||
// 左侧混合菜单模块切换触发方式 ‘click’ |'hover'
|
||||
mixSideTrigger: MixSidebarTriggerEnum.CLICK,
|
||||
// 是否固定左侧混合菜单
|
||||
mixSideFixed: false,
|
||||
},
|
||||
|
||||
// 多标签
|
||||
multiTabsSetting: {
|
||||
// 刷新后是否保留已经打开的标签页
|
||||
cache: false,
|
||||
// 开启
|
||||
show: true,
|
||||
// 是否可以拖拽
|
||||
canDrag: true,
|
||||
// 开启快速操作
|
||||
showQuick: true,
|
||||
// 是否显示刷新按钮
|
||||
showRedo: true,
|
||||
// 是否显示折叠按钮
|
||||
showFold: true,
|
||||
// 标签页样式
|
||||
theme: TabsThemeEnum.CARD,
|
||||
},
|
||||
|
||||
// 动画配置
|
||||
transitionSetting: {
|
||||
// 是否开启切换动画
|
||||
// The disabled state will also disable pageLoadinng
|
||||
enable: true,
|
||||
|
||||
// 动画名 Route basic switching animation
|
||||
basicTransition: RouterTransitionEnum.FADE_SIDE,
|
||||
|
||||
// 是否打开页面切换loading
|
||||
// Only open when enable=true
|
||||
openPageLoading: true,
|
||||
|
||||
//是否打开页面切换顶部进度条
|
||||
openNProgress: true,
|
||||
},
|
||||
|
||||
// 是否开启KeepAlive缓存 开发时候最好关闭,不然每次都需要清除缓存
|
||||
openKeepAlive: true,
|
||||
|
||||
// 自动锁屏时间,为0不锁屏。 单位分钟 默认1个小时
|
||||
lockTime: 0,
|
||||
|
||||
// 显示面包屑
|
||||
showBreadCrumb: false,
|
||||
|
||||
// 显示面包屑图标
|
||||
showBreadCrumbIcon: true,
|
||||
|
||||
// 是否使用全局错误捕获
|
||||
useErrorHandle: false,
|
||||
|
||||
// 是否开启回到顶部
|
||||
useOpenBackTop: true,
|
||||
|
||||
// 是否可以嵌入iframe页面
|
||||
canEmbedIFramePage: true,
|
||||
|
||||
// 切换界面的时候是否删除未关闭的message及notify
|
||||
closeMessageOnSwitch: true,
|
||||
|
||||
// 切换界面的时候是否取消已经发送但是未响应的http请求。
|
||||
// 如果开启,想对单独接口覆盖。可以在单独接口设置
|
||||
removeAllHttpPending: false,
|
||||
};
|
||||
|
||||
export default setting;
|
||||
44
jeecgboot-vue3/src/settings/registerThirdComp.ts
Normal file
44
jeecgboot-vue3/src/settings/registerThirdComp.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import type { App } from 'vue';
|
||||
import { registerJVxeTable } from '/@/components/jeecg/JVxeTable';
|
||||
import { registerJVxeCustom } from '/@/components/JVxeCustom';
|
||||
|
||||
// 注册全局dayjs
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
|
||||
|
||||
export async function registerThirdComp(app: App) {
|
||||
//---------------------------------------------------------------------
|
||||
// 注册 JVxeTable 组件
|
||||
registerJVxeTable(app);
|
||||
// 注册 JVxeTable 自定义组件
|
||||
await registerJVxeCustom();
|
||||
//---------------------------------------------------------------------
|
||||
// 注册全局聊天表情包
|
||||
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8241】emoji-mart-vue-fast库异步加载
|
||||
app.component(
|
||||
'Picker',
|
||||
createAsyncComponent(() => {
|
||||
return new Promise((resolve, rejected) => {
|
||||
import('emoji-mart-vue-fast/src')
|
||||
.then((res) => {
|
||||
const { Picker } = res;
|
||||
resolve(Picker);
|
||||
})
|
||||
.catch((err) => {
|
||||
rejected(err);
|
||||
});
|
||||
});
|
||||
})
|
||||
);
|
||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8241】emoji-mart-vue-fast库异步加载
|
||||
//---------------------------------------------------------------------
|
||||
// 注册全局dayjs
|
||||
dayjs.locale('zh-cn');
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(customParseFormat);
|
||||
app.config.globalProperties.$dayjs = dayjs
|
||||
app.provide('$dayjs', dayjs)
|
||||
//---------------------------------------------------------------------
|
||||
}
|
||||
8
jeecgboot-vue3/src/settings/siteSetting.ts
Normal file
8
jeecgboot-vue3/src/settings/siteSetting.ts
Normal file
@ -0,0 +1,8 @@
|
||||
// github repo url
|
||||
export const GITHUB_URL = 'https://github.com/jeecgboot/JeecgBoot';
|
||||
|
||||
// vue-Jeecg-admin-next-doc
|
||||
export const DOC_URL = 'https://help.jeecg.com';
|
||||
|
||||
// site url
|
||||
export const SITE_URL = 'http://www.jeecg.com';
|
||||
Reference in New Issue
Block a user