feat: 代码生成

This commit is contained in:
puhui999
2025-04-10 11:34:20 +08:00
parent 2c105a21aa
commit 2207db02f5
16 changed files with 3528 additions and 1926 deletions

View File

@@ -72,7 +72,7 @@ export const SystemUserSocialTypeEnum = {
export const InfraCodegenTemplateTypeEnum = {
CRUD: 1, // 基础 CRUD
TREE: 2, // 树形 CRUD
SUB: 3 // 主子表 CRUD
SUB: 15 // 主子表 CRUD
}
/**

View File

@@ -2,9 +2,8 @@ import dayjs from 'dayjs';
// TODO @芋艿:后续整理下
// TODO @puhui999转成 function 方式哈
/** 时间段选择器拓展 */
export const getRangePickerDefaultProps = () => {
export function getRangePickerDefaultProps() {
return {
showTime: {
format: 'HH:mm:ss',
@@ -16,23 +15,16 @@ export const getRangePickerDefaultProps = () => {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
format: 'YYYY-MM-DD HH:mm:ss',
placeholder: ['开始时间', '结束时间'],
// prettier-ignore
ranges: {
'今天': [dayjs().startOf('day'), dayjs().endOf('day')],
'昨天': [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
'本周': [dayjs().startOf('week'), dayjs().endOf('day')],
'本月': [dayjs().startOf('month'), dayjs().endOf('day')],
'最近 7 天': [
dayjs().subtract(7, 'day').startOf('day'),
dayjs().endOf('day'),
],
'最近 30 天': [
dayjs().subtract(30, 'day').startOf('day'),
dayjs().endOf('day'),
],
},
'今天': [dayjs().startOf('day'), dayjs().endOf('day')],
'昨天': [dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day')],
'本周': [dayjs().startOf('week'), dayjs().endOf('day')],
'本月': [dayjs().startOf('month'), dayjs().endOf('day')],
'最近 7 天': [dayjs().subtract(7, 'day').startOf('day'), dayjs().endOf('day')],
'最近 30 天': [dayjs().subtract(30, 'day').startOf('day'), dayjs().endOf('day')],
},
transformDateFunc: (dates: any) => {
if (dates && dates.length === 2) {
return [dates.createTime[0], dates.createTime[1]].join(','); // 格式化为后台支持的时间格式
@@ -40,4 +32,4 @@ export const getRangePickerDefaultProps = () => {
return {};
},
};
};
}