Skip to content

Commit

Permalink
fix: 修复 FormTypeEnum 错误,并优化命名
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 24, 2024
1 parent 8632b22 commit cf18c10
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,49 +32,61 @@
public enum FormTypeEnum implements IBaseEnum<Integer> {

/**
* 文本框
* 输入框
*/
TEXT(1, "文本框"),
INPUT(1, "输入框"),

/**
* 文本域
* 数字输入框
*/
TEXT_AREA(2, "文本域"),
INPUT_NUMBER(2, "数字输入框"),

/**
* 下拉框
* 密码输入框
*/
SELECT(3, "下拉框"),
INPUT_PASSWORD(3, "密码输入框"),

/**
* 单选框
* 下拉框
*/
RADIO(4, "单选框"),
SELECT(4, "下拉框"),

/**
* 日期框
* 单选框
*/
DATE(5, "日期框"),
RADIO(5, "单选框"),

/**
* 日期时间框
* 开关
*/
DATE_TIME(6, "日期时间框"),;
SWITCH(6, "开关"),

/**
* 树形选择
* 复选框
*/
TREE_SELECT(7, "树选择"),
CHECK_BOX(7, "复选框"),

/**
* 复选框
* 文本域
*/
CHECK_GROUP(8, "复选框"),
TEXT_AREA(8, "文本域"),

/**
* 数字输入框
* 日期时间框
*/
INPUT_NUMBER(9, "数字输入框"),
DATE_TIME(9, "日期时间框"),

/**
* 密码输入框
* 日期框
*/
INPUT_PASSWORD(10, "密码输入框"),
DATE(10, "日期框"),

/**
* 开关
* 树形选择
*/
SWITCH(11, "开关"),;
TREE_SELECT(11, "树选择"),
;

private final Integer value;
private final String description;
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public FieldConfigDO(@NonNull Column column) {
this.setShowInList(true);
this.setShowInForm(this.getIsRequired());
this.setShowInQuery(this.getIsRequired());
this.setFormType(FormTypeEnum.TEXT);
this.setFormType(FormTypeEnum.INPUT);
this.setQueryType("String".equals(this.getFieldType()) ? QueryTypeEnum.LIKE : QueryTypeEnum.EQ);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const formRef = ref<InstanceType<typeof GiForm>>()
<#list fieldConfigs as fieldConfig>
<#if fieldConfig.showInForm>
<#-- SELECT/RADIO/CHECK_GROUP/TREE_SELECT控件从服务器端获取数据 -->
<#-- SELECT/RADIO/CHECK_BOX/TREE_SELECT控件从服务器端获取数据 -->
<#if fieldConfig.formType = 'SELECT' || fieldConfig.formType = 'RADIO'
|| fieldConfig.formType = 'CHECK_GROUP' || fieldConfig.formType = 'TREE_SELECT'>
|| fieldConfig.formType = 'CHECK_BOX' || fieldConfig.formType = 'TREE_SELECT'>
const { ${fieldConfig.columnName}_enum } = useDict('${fieldConfig.columnName}_enum')
</#if>
</#if>
Expand All @@ -51,7 +51,7 @@ const columns: Columns = [
{
label: '${fieldConfig.comment}',
field: '${fieldConfig.fieldName}',
<#if fieldConfig.formType = 'TEXT'>
<#if fieldConfig.formType = 'INPUT'>
type: 'input',
<#elseif fieldConfig.formType = 'TEXT_AREA'>
type: 'textarea',
Expand All @@ -65,7 +65,7 @@ const columns: Columns = [
type: 'input-password',
<#elseif fieldConfig.formType = 'SWITCH'>
type: 'switch',
<#elseif fieldConfig.formType = 'CHECK_GROUP'>
<#elseif fieldConfig.formType = 'CHECK_BOX'>
type: 'check-group',
props: {
options: ${fieldConfig.columnName}_enum,
Expand Down

0 comments on commit cf18c10

Please sign in to comment.