1 <?xml version="1.0" encoding="utf-8"?> 2 <template> 3 <name>viewForm</name> 4 <filePath>src/main/webapp/WEB-INF/views/${lastPackageName}/${moduleName}/${subModuleName}</filePath> 5 <fileName>${className}Form.jsp</fileName> 6 <content><![CDATA[ 7 <%@ page contentType="text/html;charset=UTF-8" %> 8 <%@ include file="/WEB-INF/views/include/taglib.jsp"%> 9 <html> 10 <head> 11 <title>${functionNameSimple}管理</title> 12 <meta name="decorator" content="default"/> 13 <script type="text/javascript"> 14 $(document).ready(function() { 15 //$("#name").focus(); 16 $("#inputForm").validate({ 17 submitHandler: function(form){ 18 loading('正在提交,请稍等...'); 19 form.submit(); 20 }, 21 errorContainer: "#messageBox", 22 errorPlacement: function(error, element) { 23 $("#messageBox").text("输入有误,请先更正。"); 24 if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){ 25 error.appendTo(element.parent().parent()); 26 } else { 27 error.insertAfter(element); 28 } 29 } 30 }); 31 }); 32 </script> 33 </head> 34 <body> 35 <ul class="nav nav-tabs"> 36 <li><a href="${r"${ctx}"}/${urlPrefix}/">${functionNameSimple}列表</a></li> 37 <li class="active"><a href="${r"${ctx}"}/${urlPrefix}/form?id=${"${"+className+".id}"}">${functionNameSimple}<shiro:hasPermission name="${permissionPrefix}:edit">${r"${not empty "+className+".id?'修改':'添加'}"}</shiro:hasPermission><shiro:lacksPermission name="${permissionPrefix}:edit">查看</shiro:lacksPermission></a></li> 38 </ul><br/> 39 <form:form id="inputForm" modelAttribute="${className}" action="${r"${ctx}"}/${urlPrefix}/save" method="post" class="form-horizontal"> 40 <form:hidden path="id"/> 41 <sys:message content="${r"${message}"}"/> 42 <table class="table-form"> 43 <#list table.columnList as c> 44 <#if c.isEdit?? && c.isEdit == "1" && c.isNotBaseField> 45 <#if c_index%2==1> 46 <tr> 47 </#if> 48 <td class = "tit">${c.comments}:</td> 49 <td> 50 <#if c.showType == "input"> 51 <form:input path="${c.javaFieldId}" htmlEscape="false"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if> class="input-xlarge <#if c.isNull != "1">required</#if><#if c.javaType == "Long" || c.javaType == "Integer"> digits</#if><#if c.javaType == "Double"> number</#if>"/> 52 <#elseif c.showType == "textarea"> 53 <form:textarea path="${c.javaFieldId}" htmlEscape="false" rows="4"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if> class="input-xxlarge <#if c.isNull != "1">required</#if>"/> 54 <#elseif c.showType == "select"> 55 <form:select path="${c.javaFieldId}" class="input-xlarge <#if c.isNull != "1">required</#if>"> 56 <form:option value="" label=""/> 57 <form:options items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false"/> 58 </form:select> 59 <#elseif c.showType == "checkbox"> 60 <form:checkboxes path="${c.javaFieldId}" items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false" class="<#if c.isNull != "1">required</#if>"/> 61 <#elseif c.showType == "radiobox"> 62 <form:radiobuttons path="${c.javaFieldId}" items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false" class="<#if c.isNull != "1">required</#if>"/> 63 <#elseif c.showType == "dateselect"> 64 <input name="${c.javaFieldId}" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate <#if c.isNull != "1">required</#if>" 65 value="<fmt:formatDate value="${"$"}{${className}.${c.javaFieldId}}" pattern="yyyy-MM-dd HH:mm:ss"/>" 66 onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> 67 <#elseif c.showType == "userselect"> 68 <sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}" 69 title="用户" url="/sys/office/treeData?type=3" cssClass="<#if c.isNull != "1">required</#if>" allowClear="true" notAllowSelectParent="true"/> 70 <#elseif c.showType == "officeselect"> 71 <sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}" 72 title="部门" url="/sys/office/treeData?type=2" cssClass="<#if c.isNull != "1">required</#if>" allowClear="true" notAllowSelectParent="true"/> 73 <#elseif c.showType == "areaselect"> 74 <sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}" 75 title="区域" url="/sys/area/treeData" cssClass="<#if c.isNull != "1">required</#if>" allowClear="true" notAllowSelectParent="true"/> 76 <#elseif c.showType == "fileselect"> 77 <form:hidden id="${c.simpleJavaField}" path="${c.javaFieldId}" htmlEscape="false"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if> class="input-xlarge"/> 78 <sys:ckfinder input="${c.simpleJavaField}" type="files" uploadPath="/${moduleName}<#if subModuleName != "">/${subModuleName}</#if>/${className}" selectMultiple="true"/> 79 </#if> 80 <#if c.isNull != "1"> 81 <span class="help-inline"><font color="red">*</font> </span> 82 </#if> 83 </td> 84 <#if c_index%2==0 > 85 </tr> 86 </#if> 87 </#if> 88 <#if c.isEdit?? && c.isEdit == "1" && c.simpleJavaField == 'remarks'> 89 <tr> 90 <td class = "tit">${c.comments}:</td> 91 <td> 92 <#if c.showType == "input"> 93 <form:input path="${c.javaFieldId}" htmlEscape="false"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if> class="input-xlarge <#if c.isNull != "1">required</#if><#if c.javaType == "Long" || c.javaType == "Integer"> digits</#if><#if c.javaType == "Double"> number</#if>"/> 94 <#elseif c.showType == "textarea"> 95 <form:textarea path="${c.javaFieldId}" htmlEscape="false" rows="4"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if> class="input-xxlarge <#if c.isNull != "1">required</#if>"/> 96 <#elseif c.showType == "select"> 97 <form:select path="${c.javaFieldId}" class="input-xlarge <#if c.isNull != "1">required</#if>"> 98 <form:option value="" label=""/> 99 <form:options items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false"/> 100 </form:select> 101 <#elseif c.showType == "checkbox"> 102 <form:checkboxes path="${c.javaFieldId}" items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false" class="<#if c.isNull != "1">required</#if>"/> 103 <#elseif c.showType == "radiobox"> 104 <form:radiobuttons path="${c.javaFieldId}" items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false" class="<#if c.isNull != "1">required</#if>"/> 105 <#elseif c.showType == "dateselect"> 106 <input name="${c.javaFieldId}" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate <#if c.isNull != "1">required</#if>" 107 value="<fmt:formatDate value="${"$"}{${className}.${c.javaFieldId}}" pattern="yyyy-MM-dd HH:mm:ss"/>" 108 onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> 109 <#elseif c.showType == "userselect"> 110 <sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}" 111 title="用户" url="/sys/office/treeData?type=3" cssClass="<#if c.isNull != "1">required</#if>" allowClear="true" notAllowSelectParent="true"/> 112 <#elseif c.showType == "officeselect"> 113 <sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}" 114 title="部门" url="/sys/office/treeData?type=2" cssClass="<#if c.isNull != "1">required</#if>" allowClear="true" notAllowSelectParent="true"/> 115 <#elseif c.showType == "areaselect"> 116 <sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}" 117 title="区域" url="/sys/area/treeData" cssClass="<#if c.isNull != "1">required</#if>" allowClear="true" notAllowSelectParent="true"/> 118 <#elseif c.showType == "fileselect"> 119 <form:hidden id="${c.simpleJavaField}" path="${c.javaFieldId}" htmlEscape="false"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if> class="input-xlarge"/> 120 <sys:ckfinder input="${c.simpleJavaField}" type="files" uploadPath="/${moduleName}<#if subModuleName != "">/${subModuleName}</#if>/${className}" selectMultiple="true"/> 121 </#if> 122 </td> 123 </tr> 124 </#if> 125 </#list> 126 </table> 127 <div class="form-actions"> 128 <shiro:hasPermission name="${permissionPrefix}:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/> </shiro:hasPermission> 129 <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/> 130 </div> 131 </form:form> 132 </body> 133 </html>]]> 134 </content> 135 </template>