cgform_jspSubTemplate_one2many.ftl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  4. <#include "../../ui/datatype.ftl"/>
  5. <#include "../../ui/dictInfo.ftl"/>
  6. <#-- update--end--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  7. <!-- <h4>分类标题</h4> -->
  8. <div class="row">
  9. <div class="col-md-12 layout-header">
  10. <button id="addBtn_${entityName}" type="button" class="btn btn-default">添加</button>
  11. <button id="delBtn_${entityName}" type="button" class="btn btn-default">删除</button>
  12. <script type="text/javascript">
  13. $('#addBtn_${entityName}').bind('click', function(){
  14. var tr = $("#add_${entityName?uncap_first}_table_template tr").clone();
  15. $("#add_${entityName?uncap_first}_table").append(tr);
  16. resetTrNum('add_${entityName?uncap_first}_table');
  17. return false;
  18. });
  19. $('#delBtn_${entityName}').bind('click', function(){
  20. $("#add_${entityName?uncap_first}_table").find("input:checked").parent().parent().remove();
  21. resetTrNum('add_${entityName?uncap_first}_table');
  22. return false;
  23. });
  24. $(document).ready(function(){
  25. if(location.href.indexOf("load=detail")!=-1){
  26. $(":input").attr("disabled","true");
  27. $(".datagrid-toolbar").hide();
  28. }
  29. resetTrNum('add_${entityName?uncap_first}_table');
  30. });
  31. </script>
  32. </div>
  33. </div>
  34. <div style="margin: 0 15px; background-color: white;">
  35. <!-- Table -->
  36. <table id="${entityName?uncap_first}_table" class="table table-bordered table-hover" style="margin-bottom: 0;">
  37. <thead>
  38. <tr>
  39. <th style="white-space:nowrap;width:50px;">序号</th>
  40. <th style="white-space:nowrap;width:50px;">操作</th>
  41. <#list pageColumns as po>
  42. <#assign check = 0 >
  43. <#list foreignKeys as key>
  44. <#if fieldMeta[po.fieldName]==key?uncap_first>
  45. <#assign check = 1 >
  46. <#break>
  47. </#if>
  48. </#list>
  49. <#if check==0>
  50. <th>
  51. ${po.content}
  52. </th>
  53. </#if>
  54. </#list>
  55. </tr>
  56. </thead>
  57. <tbody id="add_${entityName?uncap_first}_table">
  58. <c:if test="${"$"}{fn:length(${entityName?uncap_first}List) <= 0 }">
  59. <tr>
  60. <th scope="row"><div name="xh"></div></th>
  61. <td><input style="width:20px;" type="checkbox" name="ck"/></td>
  62. <#list columns as po>
  63. <#if po.isShow=="N">
  64. <input name="${entityName?uncap_first}List[0].${po.fieldName}" type="hidden"/>
  65. </#if>
  66. </#list>
  67. <#list pageColumns as po>
  68. <#assign check = 0 >
  69. <#list foreignKeys as key>
  70. <#if fieldMeta[po.fieldName]==key?uncap_first>
  71. <#assign check = 1 >
  72. <#break>
  73. </#if>
  74. </#list>
  75. <#if check==0>
  76. <td>
  77. <#if po.showType == "text">
  78. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  79. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
  80. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  81. <#elseif po.showType=='password'>
  82. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  83. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="password" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
  84. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  85. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  86. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  87. <t:dictSelect field="${entityName?uncap_first}List[0].${po.fieldName}" type="${po.showType?if_exists?html}" extendJson="{class:'form-control',style:'width:150px'}" <@datatype inputCheck="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> <@dictInfo dictTable="${po.dictTable}" dictField="${po.dictField}" dictText="${po.dictText}" /> defaultVal="${'$'}{${entityName?uncap_first}Page.${po.fieldName}}" hasLabel="false" title="${po.content}"></t:dictSelect>
  88. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  89. <#elseif po.showType=='date'>
  90. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  91. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" onClick="WdatePicker()" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
  92. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  93. <#elseif po.showType=='datetime'>
  94. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  95. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
  96. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  97. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  98. <#elseif po.showType=='file' || po.showType == 'image'>
  99. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  100. <input type="hidden" id="${entityName?uncap_first}List[0].${po.fieldName}" name="${entityName?uncap_first}List[0].${po.fieldName}" />
  101. <a target="_blank" id="${entityName?uncap_first}List[0].${po.fieldName}_href">未上传</a>
  102. <#-- update--begin--author:zhangjiaqiang date:20170614 for:修订上传附件按钮的大小 -->
  103. <input class="btn btn-sm btn-success" style="margin-left:10px;" type="button" value="上传附件"
  104. onclick="commonUpload(commonUploadDefaultCallBack,'${entityName?uncap_first}List\\[0\\]\\.${po.fieldName}')"/>
  105. <#-- update--end--author:zhangjiaqiang date:20170614 for:修订上传附件按钮的大小 -->
  106. <#else>
  107. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  108. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> />
  109. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  110. </#if>
  111. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  112. </td>
  113. </#if>
  114. </#list>
  115. </tr>
  116. </c:if>
  117. <c:if test="${"$"}{fn:length(${entityName?uncap_first}List) > 0 }">
  118. <c:forEach items="${"$"}{${entityName?uncap_first}List}" var="poVal" varStatus="stuts">
  119. <tr>
  120. <th scope="row"><div name="xh">${'$'}{stuts.index+1 }</div></th>
  121. <td><input style="width:20px;" type="checkbox" name="ck"/></td>
  122. <#list columns as po>
  123. <#if po.isShow=="N">
  124. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" type="hidden" value="${'$'}{poVal.${po.fieldName} }"/>
  125. </#if>
  126. </#list>
  127. <#list pageColumns as po>
  128. <#assign check = 0 >
  129. <#list foreignKeys as key>
  130. <#if fieldMeta[po.fieldName]==key?uncap_first>
  131. <#assign check = 1 >
  132. <#break>
  133. </#if>
  134. </#list>
  135. <#if check==0>
  136. <td align="left">
  137. <#if po.showType == "text">
  138. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  139. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value="${'$'}{poVal.${po.fieldName} }"/>
  140. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  141. <#elseif po.showType=='password'>
  142. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  143. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="password" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value="${'$'}{poVal.${po.fieldName} }"/>
  144. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  145. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  146. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  147. <t:dictSelect field="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" type="${po.showType?if_exists?html}" extendJson="{class:'form-control',style:'width:150px'}" <@datatype inputCheck="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> <@dictInfo dictTable="${po.dictTable}" dictField="${po.dictField}" dictText="${po.dictText}" /> defaultVal="${'$'}{poVal.${po.fieldName} }" hasLabel="false" title="${po.content}"></t:dictSelect>
  148. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  149. <#elseif po.showType=='date'>
  150. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  151. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" onClick="WdatePicker()" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value="<fmt:formatDate value='${'$'}{poVal.${po.fieldName}}' type="date" pattern="yyyy-MM-dd"/>"/>
  152. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  153. <#elseif po.showType=='datetime'>
  154. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  155. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value="<fmt:formatDate value='${'$'}{poVal.${po.fieldName}}' type="date" pattern="yyyy-MM-dd hh:mm:ss"/>"/>
  156. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  157. <#elseif po.showType=='file' || po.showType == 'image'>
  158. <input type="hidden" id="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" value="${'$'}{poVal.${po.fieldName} }"/>
  159. <c:if test="${'$'}{empty poVal.${po.fieldName}}">
  160. <a target="_blank" id="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}_href">未上传</a>
  161. </c:if>
  162. <c:if test="${'$'}{!empty poVal.${po.fieldName}}">
  163. <a href="${'$'}{poVal.${po.fieldName}}" target="_blank" id="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}_href">下载</a>
  164. </c:if>
  165. <#-- update--begin--author:zhangjiaqiang date:20170614 for:修订上传附件按钮的大小 -->
  166. <input class="btn btn-sm btn-success" style="margin-left:10px;" type="button" value="上传附件" onclick="commonUpload(commonUploadDefaultCallBack,'${entityName?uncap_first}List\\[${'$'}{stuts.index }\\]\\.${po.fieldName}')"/>
  167. <#-- update--begin--author:zhangjiaqiang date:20170614 for:修订上传附件按钮的大小 -->
  168. <#else>
  169. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  170. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value="${'$'}{poVal.${po.fieldName} }"/>
  171. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  172. </#if>
  173. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  174. </td>
  175. </#if>
  176. </#list>
  177. </tr>
  178. </c:forEach>
  179. </c:if>
  180. </tbody>
  181. </table>