mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 20:57:21 +08:00
fix(generator): 前端页面生成表单类型 (#110)
This commit is contained in:
@@ -18,7 +18,6 @@ package top.continew.admin.generator.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
@@ -72,9 +71,9 @@ public enum FormTypeEnum implements BaseEnum<Integer> {
|
||||
TEXT_AREA(8, "文本域"),
|
||||
|
||||
/**
|
||||
* 日期时间框
|
||||
* 时间框
|
||||
*/
|
||||
DATE_TIME(9, "日期时间框"),
|
||||
TIME(9, "时间框"),
|
||||
|
||||
/**
|
||||
* 日期框
|
||||
@@ -84,7 +83,13 @@ public enum FormTypeEnum implements BaseEnum<Integer> {
|
||||
/**
|
||||
* 树形选择
|
||||
*/
|
||||
TREE_SELECT(11, "树选择"),;
|
||||
TREE_SELECT(11, "树选择"),
|
||||
|
||||
/**
|
||||
* 时间框
|
||||
*/
|
||||
DATE_TIME(12, "日期时间框"),
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
@@ -48,7 +48,7 @@ public class ${className} extends BaseReq {
|
||||
</#if>
|
||||
</#if>
|
||||
<#if fieldConfig.fieldType = 'String' && fieldConfig.columnSize??>
|
||||
@Length(max = ${fieldConfig.columnSize}, message = "${fieldConfig.comment}长度不能超过 {max} 个字符")
|
||||
@Length(max = ${fieldConfig.columnSize?c}, message = "${fieldConfig.comment}长度不能超过 {max} 个字符")
|
||||
</#if>
|
||||
private ${fieldConfig.fieldType} ${fieldConfig.fieldName};
|
||||
</#if>
|
||||
|
@@ -45,7 +45,7 @@ const [form, resetForm] = useResetReactive({
|
||||
// todo 待补充
|
||||
})
|
||||
|
||||
const columns: Columns = reactive([
|
||||
const columns: Columns = reactive<Columns>([
|
||||
<#list fieldConfigs as fieldConfig>
|
||||
<#if fieldConfig.showInForm>
|
||||
{
|
||||
@@ -55,9 +55,17 @@ const columns: Columns = reactive([
|
||||
type: 'input',
|
||||
<#elseif fieldConfig.formType = 'TEXT_AREA'>
|
||||
type: 'textarea',
|
||||
props: {
|
||||
autoSize: true
|
||||
},
|
||||
<#elseif fieldConfig.formType = 'DATE'>
|
||||
type: 'date-picker',
|
||||
<#elseif fieldConfig.formType = 'DATE_TIME'>
|
||||
type: 'date-picker',
|
||||
props: {
|
||||
showTime: true,
|
||||
},
|
||||
<#elseif fieldConfig.formType = 'TIME'>
|
||||
type: 'time-picker',
|
||||
<#elseif fieldConfig.formType = 'INPUT_NUMBER'>
|
||||
type: 'input-number',
|
||||
@@ -66,7 +74,7 @@ const columns: Columns = reactive([
|
||||
<#elseif fieldConfig.formType = 'SWITCH'>
|
||||
type: 'switch',
|
||||
<#elseif fieldConfig.formType = 'CHECK_BOX'>
|
||||
type: 'check-group',
|
||||
type: 'checkbox-group',
|
||||
<#elseif fieldConfig.formType = 'TREE_SELECT'>
|
||||
type: 'tree-select',
|
||||
<#elseif fieldConfig.formType = 'SELECT'>
|
||||
|
Reference in New Issue
Block a user