Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 前端页面生成表单类型 #110

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import top.continew.starter.core.enums.BaseEnum;

/**
Expand Down Expand Up @@ -72,9 +71,9 @@ public enum FormTypeEnum implements BaseEnum<Integer> {
TEXT_AREA(8, "文本域"),

/**
* 日期时间框
* 时间框
*/
DATE_TIME(9, "日期时间框"),
TIME(9, "时间框"),

/**
* 日期框
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
{
Expand All @@ -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',
Expand All @@ -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'>
Expand Down
Loading