feat: 新增代码生成页面

This commit is contained in:
xlsea
2024-09-04 15:50:09 +08:00
parent c4d959d133
commit 824974e904
22 changed files with 1272 additions and 76 deletions

View File

@ -188,7 +188,7 @@ declare namespace Api {
}>;
/** menu list */
type MenuList = Array<Menu>;
type MenuList = Menu[];
/** menu search params */
type MenuSearchParams = CommonType.RecordNullable<Pick<Menu, 'menuName' | 'status' | 'menuType' | 'parentId'>>;
@ -213,8 +213,20 @@ declare namespace Api {
| 'remark'
>;
/** 字典类型 */
type DictType = Common.CommonRecord<{
/** 字典主键 */
dictId?: number;
/** 字典名称 */
dictName?: string;
/** 字典类型 */
dictType?: string;
/** 备注 */
remark?: string;
}>;
/** 字典数据 */
export type DictData = Common.CommonRecord<{
type DictData = Common.CommonRecord<{
/** 样式属性(其他样式扩展) */
cssClass?: string;
/** 字典编码 */

View File

@ -10,8 +10,37 @@ declare namespace Api {
* backend api module: "tool"
*/
namespace Tool {
/** 生成模板 */
type TplCategory = 'crud' | 'tree';
/** Java类型 */
type JavaType = 'Long' | 'String' | 'Integer' | 'Double' | 'BigDecimal' | 'Date' | 'Boolean';
/** 查询方式 */
type QueryType = 'EQ' | 'NE' | 'GT' | 'GE' | 'LT' | 'LE' | 'LIKE' | 'BETWEEN';
/** 显示类型 */
type HtmlType =
| 'input'
| 'textarea'
| 'select'
| 'radio'
| 'checkbox'
| 'datetime'
| 'imageUpload'
| 'fileUpload'
| 'editor';
/**
* 生成代码方式
*
* - 0: zip压缩包
* - 1: 自定义路径
*/
type GenType = '0' | '1';
/** 代码生成业务表 */
export type GenTable = {
export type GenTable = Common.CommonRecord<{
/** 生成业务名 */
businessName: string;
/** 实体类名称(首字母大写) */
@ -29,7 +58,7 @@ declare namespace Api {
/** 生成路径(不填默认项目路径) */
genPath?: string;
/** 生成代码方式0zip压缩包 1自定义路径 */
genType?: string;
genType?: GenType;
/** 菜单 id 列表 */
menuIds?: CommonType.IdType[];
/** 生成模块名 */
@ -39,7 +68,7 @@ declare namespace Api {
/** 生成包路径 */
packageName: string;
/** 上级菜单ID字段 */
parentMenuId?: string;
parentMenuId?: CommonType.IdType;
/** 上级菜单名称字段 */
parentMenuName?: string;
/** 主键信息 */
@ -53,11 +82,11 @@ declare namespace Api {
/** 表描述 */
tableComment: string;
/** 编号 */
tableId?: number;
tableId?: CommonType.IdType;
/** 表名称 */
tableName: string;
/** 使用的模板crud单表操作 tree树表操作 sub主子表操作 */
tplCategory?: string;
tplCategory?: TplCategory;
/** 是否tree树表操作 */
tree?: boolean;
/** 树编码字段 */
@ -66,14 +95,15 @@ declare namespace Api {
treeName?: string;
/** 树父编码字段 */
treeParentCode?: string;
};
params: { [key: string]: any };
}>;
/** 代码生成业务字段 */
export type GenTableColumn = {
export type GenTableColumn = Common.CommonRecord<{
/** 列描述 */
columnComment?: string;
/** 编号 */
columnId?: number;
columnId?: CommonType.IdType;
/** 列名称 */
columnName?: string;
/** 列类型 */
@ -83,7 +113,7 @@ declare namespace Api {
/** 是否编辑字段1是 */
edit?: boolean;
/** 显示类型input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件 */
htmlType?: string;
htmlType?: HtmlType;
/** 是否自增1是 */
increment?: boolean;
/** 是否为插入字段1是 */
@ -105,7 +135,7 @@ declare namespace Api {
/** JAVA字段名 */
javaField: string;
/** JAVA类型 */
javaType?: string;
javaType?: JavaType;
/** 是否列表字段1是 */
list?: boolean;
/** 是否主键1是 */
@ -113,7 +143,7 @@ declare namespace Api {
/** 是否查询字段1是 */
query?: boolean;
/** 查询方式EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围 */
queryType?: string;
queryType?: QueryType;
/** 是否必填1是 */
required?: boolean;
/** 排序 */
@ -121,25 +151,43 @@ declare namespace Api {
/** 是否基类字段 */
superColumn?: boolean;
/** 归属表编号 */
tableId?: number;
tableId?: CommonType.IdType;
/** 可用字段 */
usableColumn?: boolean;
};
}>;
/** gen table search params */
type GenTableSearchParams = CommonType.RecordNullable<
Pick<GenTable, 'dataName' | 'tableName' | 'tableComment'> &
CommonType.RecordNullable<
Common.CommonSearchParams & {
params: {
beginTime: string;
endTime: string;
};
}
>
Common.CommonSearchParams & {
params: {
beginTime?: string;
endTime?: string;
};
}
>;
/** gen table list */
type GenTableList = Common.PaginatingQueryRecord<GenTable>;
/** gen table search params */
type GenTableDbSearchParams = CommonType.RecordNullable<
Pick<GenTable, 'dataName' | 'tableName' | 'tableComment'> & Common.CommonSearchParams
>;
/** gen table db list */
type GenTableDbList = Common.PaginatingQueryRecord<
Common.CommonRecord<Pick<GenTable, 'tableName' | 'tableComment'>>
>;
/** gen table info */
type GenTableInfo = {
/** 字段信息 */
rows: GenTableColumn[];
/** 生成信息 */
tables: GenTable[];
/** 基本信息 */
info: GenTable;
};
}
}

View File

@ -23,12 +23,15 @@ declare module 'vue' {
IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
'IconIc:roundPlus': typeof import('~icons/ic/round-plus')['default']
IconIcRoundDelete: typeof import('~icons/ic/round-delete')['default']
IconIcRoundDownload: typeof import('~icons/ic/round-download')['default']
IconIcRoundEdit: typeof import('~icons/ic/round-edit')['default']
IconIcRoundPlus: typeof import('~icons/ic/round-plus')['default']
IconIcRoundRefresh: typeof import('~icons/ic/round-refresh')['default']
IconIcRoundRemove: typeof import('~icons/ic/round-remove')['default']
IconIcRoundRoundDownload: typeof import('~icons/ic/round-round-download')['default']
IconIcRoundSave: typeof import('~icons/ic/round-save')['default']
IconIcRoundSearch: typeof import('~icons/ic/round-search')['default']
IconIcRoundUpload: typeof import('~icons/ic/round-upload')['default']
IconLocalBanner: typeof import('~icons/local/banner')['default']
IconLocalLogo: typeof import('~icons/local/logo')['default']
IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default']
@ -41,6 +44,7 @@ declare module 'vue' {
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
LookForward: typeof import('./../components/custom/look-forward.vue')['default']
MenuToggler: typeof import('./../components/common/menu-toggler.vue')['default']
MenuTreeSelect: typeof import('./../components/custom/menu-tree-select.vue')['default']
NAlert: typeof import('naive-ui')['NAlert']
NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
@ -51,6 +55,7 @@ declare module 'vue' {
NCollapseItem: typeof import('naive-ui')['NCollapseItem']
NColorPicker: typeof import('naive-ui')['NColorPicker']
NDataTable: typeof import('naive-ui')['NDataTable']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDescriptions: typeof import('naive-ui')['NDescriptions']
NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
@ -92,6 +97,7 @@ declare module 'vue' {
NStatistic: typeof import('naive-ui')['NStatistic']
NSwitch: typeof import('naive-ui')['NSwitch']
NTab: typeof import('naive-ui')['NTab']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag']
NThing: typeof import('naive-ui')['NThing']
@ -107,6 +113,7 @@ declare module 'vue' {
StatusTag: typeof import('./../components/custom/status-tag.vue')['default']
SvgIcon: typeof import('./../components/custom/svg-icon.vue')['default']
SystemLogo: typeof import('./../components/common/system-logo.vue')['default']
TableColumnCheckAlert: typeof import('./../components/advanced/table-column-check-alert.vue')['default']
TableColumnSetting: typeof import('./../components/advanced/table-column-setting.vue')['default']
TableHeaderOperation: typeof import('./../components/advanced/table-header-operation.vue')['default']
TableSiderLayout: typeof import('./../components/advanced/table-sider-layout.vue')['default']