diff --git a/src/main/java/com/youlai/boot/shared/codegen/enums/FormTypeEnum.java b/src/main/java/com/youlai/boot/shared/codegen/enums/FormTypeEnum.java index 299b80aa..255d83f5 100644 --- a/src/main/java/com/youlai/boot/shared/codegen/enums/FormTypeEnum.java +++ b/src/main/java/com/youlai/boot/shared/codegen/enums/FormTypeEnum.java @@ -60,7 +60,12 @@ public enum FormTypeEnum implements IBaseEnum { /** * 日期框 */ - DATE_TIME(9, "日期时间框"); + DATE_TIME(9, "日期时间框"), + + /** + * 隐藏域 + */ + HIDDEN(10, "隐藏域"); // Mybatis-Plus 提供注解表示插入数据库时插入该值 diff --git a/src/main/resources/templates/codegen/api.ts.vm b/src/main/resources/templates/codegen/api.ts.vm index 1e2e6c97..cbf8f6dd 100644 --- a/src/main/resources/templates/codegen/api.ts.vm +++ b/src/main/resources/templates/codegen/api.ts.vm @@ -14,8 +14,8 @@ const ${entityName}API = { /** * 获取${businessName}表单数据 * - * @param id ${entityName}ID - * @returns ${entityName}表单数据 + * @param id ${businessName}ID + * @returns ${businessName}表单数据 */ getFormData(id: number) { return request({ @@ -36,8 +36,8 @@ const ${entityName}API = { /** * 更新${businessName} * - * @param id ${entityName}ID - * @param data ${entityName}表单数据 + * @param id ${businessName}ID + * @param data ${businessName}表单数据 */ update(id: number, data: ${entityName}Form) { return request({ diff --git a/src/main/resources/templates/codegen/index.vue.vm b/src/main/resources/templates/codegen/index.vue.vm index faedf21c..4c21b77e 100644 --- a/src/main/resources/templates/codegen/index.vue.vm +++ b/src/main/resources/templates/codegen/index.vue.vm @@ -125,13 +125,21 @@ #foreach($fieldConfig in $fieldConfigs) #if($fieldConfig.isShowInList == 1) - + #if($fieldConfig.dictType && $fieldConfig.dictType.trim() != "") + + + + #else + + #end #end #end @@ -178,7 +186,7 @@ > #foreach($fieldConfig in $fieldConfigs) - #if($fieldConfig.isShowInForm == 1) + #if($fieldConfig.isShowInForm == 1 && $fieldConfig.formType != "HIDDEN") #if($fieldConfig.formType == "INPUT") #end + + #elseif($fieldConfig.formType == "HIDDEN") + #end #end