feat: 新增代码生成预览抽屉

This commit is contained in:
xlsea
2024-09-07 18:27:39 +08:00
parent 9a0df2e4f3
commit c0ad0e4e4f
22 changed files with 508 additions and 52 deletions

View File

@ -106,7 +106,7 @@ async function handleDelete(id: number) {
}
async function edit(id: number) {
handleEdit('#foreach ($column in $columns) #if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) $column.javaField #end #end', id);
handleEdit('#foreach($column in $columns)#if($column.isPk == '1')$column.javaField#end#end', id);
}
</script>

View File

@ -6,11 +6,11 @@
*/
namespace ${ModuleName} {
/** ${businessName} */
type ${ClassName} = Common.CommonRecord<{
#foreach($column in $columns)
/** $column.columnComment */
$column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) CommonType.IdType; #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; #elseif($column.javaType == 'Boolean') boolean; #else string; #end
#end
type ${BusinessName} = Common.CommonRecord<{
#foreach($column in $columns)#if($column.insert || $column.edit)
/** $column.columnComment */
$column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) CommonType.IdType; #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; #elseif($column.javaType == 'Boolean') boolean; #else string; #end
#end#end
}>;
/** ${businessName} search params */
@ -27,11 +27,11 @@ namespace ${ModuleName} {
#else
#set($comment=$column.columnComment)
#end
#if($foreach.hasNext) | #end ' ${column.javaField}'
#if($foreach.hasNext) |#end '${column.javaField}'
#end
#end
> &
CommonSearchParams
Common.CommonSearchParams
>;
/** ${businessName} list */