mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +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.Getter; | ||||||
| import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||||
|  |  | ||||||
| import top.continew.starter.core.enums.BaseEnum; | import top.continew.starter.core.enums.BaseEnum; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -72,9 +71,9 @@ public enum FormTypeEnum implements BaseEnum<Integer> { | |||||||
|     TEXT_AREA(8, "文本域"), |     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 Integer value; | ||||||
|     private final String description; |     private final String description; | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ public class ${className} extends BaseReq { | |||||||
|     </#if> |     </#if> | ||||||
|     </#if> |     </#if> | ||||||
|     <#if fieldConfig.fieldType = 'String' && fieldConfig.columnSize??> |     <#if fieldConfig.fieldType = 'String' && fieldConfig.columnSize??> | ||||||
|     @Length(max = ${fieldConfig.columnSize}, message = "${fieldConfig.comment}长度不能超过 {max} 个字符") |     @Length(max = ${fieldConfig.columnSize?c}, message = "${fieldConfig.comment}长度不能超过 {max} 个字符") | ||||||
|     </#if> |     </#if> | ||||||
|     private ${fieldConfig.fieldType} ${fieldConfig.fieldName}; |     private ${fieldConfig.fieldType} ${fieldConfig.fieldName}; | ||||||
|     </#if> |     </#if> | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ const [form, resetForm] = useResetReactive({ | |||||||
|   // todo 待补充 |   // todo 待补充 | ||||||
| }) | }) | ||||||
|  |  | ||||||
| const columns: Columns = reactive([ | const columns: Columns = reactive<Columns>([ | ||||||
| <#list fieldConfigs as fieldConfig> | <#list fieldConfigs as fieldConfig> | ||||||
|   <#if fieldConfig.showInForm> |   <#if fieldConfig.showInForm> | ||||||
|   { |   { | ||||||
| @@ -55,9 +55,17 @@ const columns: Columns = reactive([ | |||||||
|     type: 'input', |     type: 'input', | ||||||
|     <#elseif fieldConfig.formType = 'TEXT_AREA'> |     <#elseif fieldConfig.formType = 'TEXT_AREA'> | ||||||
|     type: 'textarea', |     type: 'textarea', | ||||||
|  |     props: { | ||||||
|  |       autoSize: true | ||||||
|  |     }, | ||||||
|     <#elseif fieldConfig.formType = 'DATE'> |     <#elseif fieldConfig.formType = 'DATE'> | ||||||
|     type: 'date-picker', |     type: 'date-picker', | ||||||
|     <#elseif fieldConfig.formType = 'DATE_TIME'> |     <#elseif fieldConfig.formType = 'DATE_TIME'> | ||||||
|  |     type: 'date-picker', | ||||||
|  |     props: { | ||||||
|  |       showTime: true, | ||||||
|  |     }, | ||||||
|  |     <#elseif fieldConfig.formType = 'TIME'> | ||||||
|     type: 'time-picker', |     type: 'time-picker', | ||||||
|     <#elseif fieldConfig.formType = 'INPUT_NUMBER'> |     <#elseif fieldConfig.formType = 'INPUT_NUMBER'> | ||||||
|     type: 'input-number',  |     type: 'input-number',  | ||||||
| @@ -66,7 +74,7 @@ const columns: Columns = reactive([ | |||||||
|     <#elseif fieldConfig.formType = 'SWITCH'> |     <#elseif fieldConfig.formType = 'SWITCH'> | ||||||
|     type: 'switch', |     type: 'switch', | ||||||
|     <#elseif fieldConfig.formType = 'CHECK_BOX'> |     <#elseif fieldConfig.formType = 'CHECK_BOX'> | ||||||
|     type: 'check-group', |     type: 'checkbox-group', | ||||||
|    	<#elseif fieldConfig.formType = 'TREE_SELECT'> |    	<#elseif fieldConfig.formType = 'TREE_SELECT'> | ||||||
|     type: 'tree-select', |     type: 'tree-select', | ||||||
|     <#elseif fieldConfig.formType = 'SELECT'> |     <#elseif fieldConfig.formType = 'SELECT'> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 luoqiz
					luoqiz