diff --git a/modules/core/src/main/resources/config/beetl-core.properties b/modules/core/src/main/resources/config/beetl-core.properties index f2a2b137..74d48a80 100644 --- a/modules/core/src/main/resources/config/beetl-core.properties +++ b/modules/core/src/main/resources/config/beetl-core.properties @@ -93,6 +93,7 @@ FN.parentTag=org.beetl.ext.fn.ParentTagFunction ##JeeSite自定义函数 FN.isBlank = com.jeesite.common.beetl.ext.fn.IsBlank FN.isNotBlank = com.jeesite.common.beetl.ext.fn.IsNotBlank +FN.toBoolean = com.jeesite.common.beetl.ext.fn.ToBoolean FN.toJson = com.jeesite.common.beetl.ext.fn.ToJson FN.fromJson = com.jeesite.common.beetl.ext.fn.FromJson FN.hasPermi = com.jeesite.common.beetl.ext.fn.HasPermi diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml b/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml index ed3d0efe..76df546d 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/controller.xml @@ -164,7 +164,7 @@ public class ${ClassName}Controller extends BaseController { ${className}Service.save(${className}); return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!")); } - <% if(@ObjectUtils.toBoolean(table.optionMap['isHaveDisableEnable'])){ %> + <% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %> /** * 停用${functionNameSimple} @@ -199,7 +199,7 @@ public class ${ClassName}Controller extends BaseController { return renderResult(Global.TRUE, text("启用${functionNameSimple}成功")); } <% } %> - <% if(@ObjectUtils.toBoolean(table.optionMap['isHaveDelete'])){ %> + <% if(toBoolean(table.optionMap['isHaveDelete'])){ %> /** * 删除${functionNameSimple} diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/service.xml b/modules/core/src/main/resources/templates/modules/gen/crud/service.xml index 595af5a5..de718b38 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/service.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/service.xml @@ -22,7 +22,7 @@ import com.jeesite.common.entity.Page; import com.jeesite.common.service.${table.isTreeEntity?'Tree':'Crud'}Service; import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${ClassName}; import ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${ClassName}Dao; -<% if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload']) || @ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){ %> +<% if(toBoolean(table.optionMap['isImageUpload']) || toBoolean(table.optionMap['isFileUpload'])){ %> import com.jeesite.modules.file.utils.FileUploadUtils; <% } %> <% for (child in table.childList){ %> @@ -98,11 +98,11 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv @Transactional(readOnly=false) public void save(${ClassName} ${className}) { super.save(${className}); - <% if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload'])){ %> + <% if(toBoolean(table.optionMap['isImageUpload'])){ %> // 保存上传图片 FileUploadUtils.saveFileUpload(${className}.getId(), "${className}_image"); <% } %> - <% if(@ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){ %> + <% if(toBoolean(table.optionMap['isFileUpload'])){ %> // 保存上传附件 FileUploadUtils.saveFileUpload(${className}.getId(), "${className}_file"); <% } %> diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml b/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml index e6d59afd..4c03ab52 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/viewForm.xml @@ -7,7 +7,7 @@ 0){ diff --git a/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html b/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html index e8d1deda..427efec2 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/dataGridScript.html @@ -77,7 +77,7 @@ $('#dataGrid').dataGrid({ <% }else{ %> \<% if(hasPermi('${permissionPrefix}:edit')){ %> actions.push(' '); - <% if(@ObjectUtils.toBoolean(table.optionMap['isHaveDisableEnable'])){ %> + <% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %> if (row.status == Global.STATUS_NORMAL){ actions.push(' '); } @@ -85,7 +85,7 @@ $('#dataGrid').dataGrid({ actions.push(' '); } <% } %> - <% if(@ObjectUtils.toBoolean(table.optionMap['isHaveDelete'])){ %> + <% if(toBoolean(table.optionMap['isHaveDelete'])){ %> actions.push('及所有子${functionNameSimple}<% } %>吗?")}"<% if(table.isTreeEntity){ %> data-deltreenode="'+row.id+'"<% } %>> '); <% } %> <% if(table.isTreeEntity){ %> diff --git a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html index 9562b037..ed3a1ad3 100644 --- a/modules/core/src/main/resources/templates/modules/gen/include/formControl.html +++ b/modules/core/src/main/resources/templates/modules/gen/include/formControl.html @@ -76,7 +76,7 @@
- <% + <% var attrs = ''; if (c.dataLength != '0'){ var s = { %> maxlength="${c.dataLength}"<% }; @@ -103,60 +103,49 @@ if (c.showType == 'input'){ // 如果为自定义主键,则第一个pk字段需输出isNewRecord if (c.isPk == '1' && table.pkList[0].columnName == c.columnName){ - %> - <${'#'}form:hidden path="isNewRecord"/> + %><${'#'}form:hidden path="isNewRecord"/> <% } - %> - <${'#'}form:input path="${c.attrName}"${attrs} class="form-control${cssClass}"/> + %><${'#'}form:input path="${c.attrName}"${attrs} class="form-control${cssClass}"/> <% } else if (c.showType == 'textarea') { - %> - <${'#'}form:textarea path="${c.attrName}" rows="4"${attrs} class="form-control${cssClass}"/> + %><${'#'}form:textarea path="${c.attrName}" rows="4"${attrs} class="form-control${cssClass}"/> <% } else if (c.showType == 'select' || c.showType == 'select_multiple') { var isMultiple = (c.showType == 'select_multiple'); - %> - <${'#'}form:select path="${c.attrName}" dictType="${c.optionMap['dictType']}"${isMultiple?' multiple="true"':''}${c.isRequired != '1'?' blankOption="true"':''} class="form-control${cssClass}" /> + %><${'#'}form:select path="${c.attrName}" dictType="${c.optionMap['dictType']}"${isMultiple?' multiple="true"':''}${c.isRequired != '1'?' blankOption="true"':''} class="form-control${cssClass}" /> <% } else if (c.showType == 'radio') { - %> - <${'#'}form:radio path="${c.attrName}" dictType="${c.optionMap['dictType']}" class="form-control${cssClass}" /> + %><${'#'}form:radio path="${c.attrName}" dictType="${c.optionMap['dictType']}" class="form-control${cssClass}" /> <% } else if (c.showType == 'checkbox') { - %> - <${'#'}form:checkbox path="${c.attrName}" dictType="${c.optionMap['dictType']}" class="form-control${cssClass}" /> + %><${'#'}form:checkbox path="${c.attrName}" dictType="${c.optionMap['dictType']}" class="form-control${cssClass}" /> <% } else if (c.showType == 'date' || c.showType == 'datetime') { var isTime = (c.showType == 'datetime'); - %> - <${'#'}form:input path="${c.attrName}" readonly="true" maxlength="20" class="form-control Wdate${cssClass}" + %><${'#'}form:input path="${c.attrName}" readonly="true" maxlength="20" class="form-control Wdate${cssClass}" dataFormat="date${isTime?'time':''}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd${isTime?' HH:mm':''}',isShowClear:${c.isRequired != '1'}});"/> <% } else if (c.showType == 'userselect') { - %> - <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('用户选择')}" + %><${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('用户选择')}" path="${c.attrName}" labelPath="${c.attrName2}" url="\${ctx}/sys/office/treeData?isLoadUser=true" class="${cssClass}" allowClear="true"/> <% } else if (c.showType == 'officeselect') { - %> - <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('机构选择')}" + %><${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('机构选择')}" path="${c.attrName}" labelPath="${c.attrName2}" url="\${ctx}/sys/office/treeData" class="${cssClass}" allowClear="true"/> <% } else if (c.showType == 'areaselect') { - %> - <${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}" + %><${'#'}form:treeselect id="${c.simpleAttrName}" title="\${text('区域选择')}" path="${c.attrName}" labelPath="${c.attrName2}" url="\${ctx}/sys/area/treeData" class="${cssClass}" allowClear="true"/> <% } - %> -
+ %> <% @@ -179,7 +168,7 @@ <% } // 输出上传图片控件 - if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload'])){ + if(toBoolean(table.optionMap['isImageUpload'])){ %>
@@ -195,7 +184,7 @@ <% } // 输出上传附件控件 - if(@ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){ + if(toBoolean(table.optionMap['isFileUpload'])){ %>
diff --git a/modules/core/src/main/resources/templates/modules/gen/query/viewForm.xml b/modules/core/src/main/resources/templates/modules/gen/query/viewForm.xml index f986a9a9..a722483d 100644 --- a/modules/core/src/main/resources/templates/modules/gen/query/viewForm.xml +++ b/modules/core/src/main/resources/templates/modules/gen/query/viewForm.xml @@ -7,7 +7,7 @@ 0){