cgform_jspSubTemplate_one2many.ftl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. <script type="text/javascript">
  8. $('#add${entityName}Btn').linkbutton({
  9. iconCls: 'icon-add'
  10. });
  11. $('#del${entityName}Btn').linkbutton({
  12. iconCls: 'icon-remove'
  13. });
  14. $('#add${entityName}Btn').bind('click', function(){
  15. var tr = $("#add_${entityName?uncap_first}_table_template tr").clone();
  16. $("#add_${entityName?uncap_first}_table").append(tr);
  17. resetTrNum('add_${entityName?uncap_first}_table');
  18. return false;
  19. });
  20. $('#del${entityName}Btn').bind('click', function(){
  21. $("#add_${entityName?uncap_first}_table").find("input:checked").parent().parent().remove();
  22. resetTrNum('add_${entityName?uncap_first}_table');
  23. return false;
  24. });
  25. $(document).ready(function(){
  26. $(".datagrid-toolbar").parent().css("width","auto");
  27. if(location.href.indexOf("load=detail")!=-1){
  28. $(":input").attr("disabled","true");
  29. $(".datagrid-toolbar").hide();
  30. }
  31. <#-- update--begin--author:zhangjiaqiang date:20170614 for:去除表头固定功能 -->
  32. <#-- //将表格的表头固定
  33. $("#${entityName?uncap_first}_table").createhftable({
  34. height:'300px',
  35. width:'auto',
  36. fixFooter:false
  37. }); -->
  38. <#-- update--end--author:zhangjiaqiang date:20170614 for:去除表头固定功能 -->
  39. });
  40. </script>
  41. <div style="padding: 3px; height: 25px;width:auto;" class="datagrid-toolbar">
  42. <a id="add${entityName}Btn" href="#">添加</a> <a id="del${entityName}Btn" href="#">删除</a>
  43. </div>
  44. <table border="0" cellpadding="2" cellspacing="0" id="${entityName?uncap_first}_table">
  45. <tr bgcolor="#E6E6E6">
  46. <td align="center" bgcolor="#EEEEEE" style="width: 25px;">序号</td>
  47. <td align="center" bgcolor="#EEEEEE" style="width: 25px;">操作</td>
  48. <#list pageColumns as po>
  49. <#assign check = 0 >
  50. <#list foreignKeys as key>
  51. <#if fieldMeta[po.fieldName]==key?uncap_first>
  52. <#assign check = 1 >
  53. <#break>
  54. </#if>
  55. </#list>
  56. <#if check==0>
  57. <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
  58. ${po.content}
  59. </td>
  60. </#if>
  61. </#list>
  62. </tr>
  63. <tbody id="add_${entityName?uncap_first}_table">
  64. <#-- --author: jg_renjie ------start----date:20160328-------for: #1004 [代码生成器] coding生成一对多代码多个bug和解决办法 -->
  65. <c:if test="${"$"}{fn:length(${entityName?uncap_first}List) <= 0 }">
  66. <tr>
  67. <td align="center"><div style="width: 25px;" name="xh">1</div></td>
  68. <td align="center"><input style="width:20px;" type="checkbox" name="ck"/></td>
  69. <#list columns as po>
  70. <#if po.isShow=="N">
  71. <input name="${entityName?uncap_first}List[0].${po.fieldName}" type="hidden"/>
  72. </#if>
  73. </#list>
  74. <#list pageColumns as po>
  75. <#assign check = 0 >
  76. <#list foreignKeys as key>
  77. <#if fieldMeta[po.fieldName]==key?uncap_first>
  78. <#assign check = 1 >
  79. <#break>
  80. </#if>
  81. </#list>
  82. <#if check==0>
  83. <td align="left">
  84. <#if po.showType == "text">
  85. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" />>
  86. <#elseif po.showType=='password'>
  87. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="password" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" />>
  88. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  89. <t:dictSelect field="${entityName?uncap_first}List[0].${po.fieldName}" type="${po.showType?if_exists?html}" <@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>
  90. <#elseif po.showType=='date'>
  91. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="Wdate" onClick="WdatePicker()" style="width:120px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>>
  92. <#elseif po.showType=='datetime'>
  93. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width:120px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>>
  94. <#elseif po.showType=='file' || po.showType == 'image'>
  95. <input type="hidden" id="${entityName?uncap_first}List[0].${po.fieldName}" name="${entityName?uncap_first}List[0].${po.fieldName}" />
  96. <a target="_blank" id="${entityName?uncap_first}List[0].${po.fieldName}_href">未上传</a>
  97. <br>
  98. <input class="ui-button" type="button" value="上传附件" onclick="commonUpload(commonUploadDefaultCallBack,'${entityName?uncap_first}List\\[0\\]\\.${po.fieldName}')"/>
  99. <#else>
  100. <input name="${entityName?uncap_first}List[0].${po.fieldName}" maxlength="${po.length?c}" type="text" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> >
  101. </#if>
  102. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  103. </td>
  104. </#if>
  105. </#list>
  106. </tr>
  107. </c:if>
  108. <#-- --author: jg_renjie ------end----date:20160328-------for: #1004 [代码生成器] coding生成一对多代码多个bug和解决办法 -->
  109. <c:if test="${"$"}{fn:length(${entityName?uncap_first}List) > 0 }">
  110. <c:forEach items="${"$"}{${entityName?uncap_first}List}" var="poVal" varStatus="stuts">
  111. <tr>
  112. <td align="center"><div style="width: 25px;" name="xh">${'$'}{stuts.index+1 }</div></td>
  113. <td align="center"><input style="width:20px;" type="checkbox" name="ck" /></td>
  114. <#list columns as po>
  115. <#if po.isShow=="N">
  116. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" type="hidden" value="${'$'}{poVal.${po.fieldName} }"/>
  117. </#if>
  118. </#list>
  119. <#list pageColumns as po>
  120. <#assign check = 0 >
  121. <#list foreignKeys as key>
  122. <#if fieldMeta[po.fieldName]==key?uncap_first>
  123. <#assign check = 1 >
  124. <#break>
  125. </#if>
  126. </#list>
  127. <#if check==0>
  128. <td align="left">
  129. <#if po.showType == "text">
  130. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  131. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> value="${'$'}{poVal.${po.fieldName} }"/>
  132. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  133. <#elseif po.showType=='password'>
  134. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  135. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="password" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> value="${'$'}{poVal.${po.fieldName} }"/>
  136. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  137. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  138. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  139. <t:dictSelect field="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" type="${po.showType?if_exists?html}" <@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>
  140. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  141. <#elseif po.showType=='date'>
  142. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  143. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="Wdate" onClick="WdatePicker()" style="width:120px;" <@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"/>"/>
  144. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  145. <#elseif po.showType=='datetime'>
  146. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  147. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width:120px;" <@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"/>"/>
  148. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  149. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  150. <#elseif po.showType=='file' || po.showType == 'image'>
  151. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  152. <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} }"/>
  153. <c:if test="${'$'}{empty poVal.${po.fieldName}}">
  154. <a target="_blank" id="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}_href">未上传</a>
  155. </c:if>
  156. <c:if test="${'$'}{!empty poVal.${po.fieldName}}">
  157. <a href="${'$'}{poVal.${po.fieldName}}" target="_blank" id="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}_href">下载</a>
  158. </c:if>
  159. <br>
  160. <input class="ui-button" type="button" value="上传附件"
  161. onclick="commonUpload(commonUploadDefaultCallBack,'${entityName?uncap_first}List\\[${'$'}{stuts.index }\\]\\.${po.fieldName}')"/>
  162. <#else>
  163. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  164. <input name="${entityName?uncap_first}List[${'$'}{stuts.index }].${po.fieldName}" maxlength="${po.length?c}" type="text" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value="${'$'}{poVal.${po.fieldName} }"/>
  165. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  166. </#if>
  167. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  168. </td>
  169. </#if>
  170. </#list>
  171. </tr>
  172. </c:forEach>
  173. </c:if>
  174. </tbody>
  175. </table>