beetl新增toBoolean函数,简化调用;此项升级注意:一定要同步更新beetl-core.properties文件。
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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");
|
||||
<% } %>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<content><![CDATA[
|
||||
<%
|
||||
var extLibs = '';
|
||||
if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload']) || @ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){
|
||||
if(toBoolean(table.optionMap['isImageUpload']) || toBoolean(table.optionMap['isFileUpload'])){
|
||||
extLibs = extLibs + ',\'fileupload\'';
|
||||
}
|
||||
if(table.childList.~size > 0){
|
||||
|
||||
@@ -77,7 +77,7 @@ $('#dataGrid').dataGrid({
|
||||
<% }else{ %>
|
||||
\<% if(hasPermi('${permissionPrefix}:edit')){ %>
|
||||
actions.push('<a href="\${ctx}/${urlPrefix}/form?${idParam}" class="btnList" title="\${text("编辑${functionNameSimple}")}"><i class="fa fa-pencil"></i></a> ');
|
||||
<% if(@ObjectUtils.toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="\${ctx}/${urlPrefix}/disable?${idParam}" class="btnList" title="\${text("停用${functionNameSimple}")}" data-confirm="\${text("确认要停用该${functionNameSimple}吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
}
|
||||
@@ -85,7 +85,7 @@ $('#dataGrid').dataGrid({
|
||||
actions.push('<a href="\${ctx}/${urlPrefix}/enable?${idParam}" class="btnList" title="\${text("启用${functionNameSimple}")}" data-confirm="\${text("确认要启用该${functionNameSimple}吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||
}
|
||||
<% } %>
|
||||
<% if(@ObjectUtils.toBoolean(table.optionMap['isHaveDelete'])){ %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDelete'])){ %>
|
||||
actions.push('<a href="\${ctx}/${urlPrefix}/delete?${idParam}" class="btnList" title="\${text("删除${functionNameSimple}")}" data-confirm="\${text("确认要删除该${functionNameSimple}<% if(table.isTreeEntity){ %>及所有子${functionNameSimple}<% } %>吗?")}"<% if(table.isTreeEntity){ %> data-deltreenode="'+row.id+'"<% } %>><i class="fa fa-trash-o"></i></a> ');
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<label class="control-label col-sm-${gridRowCol[1]}" title="">
|
||||
<span class="required ${c.isNull == '1' ? 'hide' : ''}">*</span> \${text('${c.columnLabel}')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-${gridRowCol[2]}">
|
||||
<%
|
||||
<%
|
||||
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"/>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</div>
|
||||
%></div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
@@ -179,7 +168,7 @@
|
||||
<%
|
||||
}
|
||||
// 输出上传图片控件
|
||||
if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload'])){
|
||||
if(toBoolean(table.optionMap['isImageUpload'])){
|
||||
%>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
@@ -195,7 +184,7 @@
|
||||
<%
|
||||
}
|
||||
// 输出上传附件控件
|
||||
if(@ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){
|
||||
if(toBoolean(table.optionMap['isFileUpload'])){
|
||||
%>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<content><![CDATA[
|
||||
<%
|
||||
var extLibs = '';
|
||||
if(@ObjectUtils.toBoolean(table.optionMap['isImageUpload']) || @ObjectUtils.toBoolean(table.optionMap['isFileUpload'])){
|
||||
if(toBoolean(table.optionMap['isImageUpload']) || toBoolean(table.optionMap['isFileUpload'])){
|
||||
extLibs = extLibs + ',\'fileupload\'';
|
||||
}
|
||||
if(table.childList.~size > 0){
|
||||
|
||||
Reference in New Issue
Block a user