flowEdit.ftl 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <#include "../function.ftl">
  2. <#include "../variable.ftl">
  3. <#assign classVar=class?uncap_first>
  4. <#assign pkVar=convertUnderLine(pk) >
  5. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  6. <%@include file="/commons/include/html_doctype.html" %>
  7. <html>
  8. <head>
  9. <%@include file="/commons/page/codegen.jsp" %>
  10. <#if hasSub?exists && hasSub==true>
  11. <script type="text/javascript" src="<#noparse>${</#noparse>ctx}/js/plugins/artTemplate/artTemplate.js"></script>
  12. </#if>
  13. <script type="text/javascript" src="<#noparse>${</#noparse>ctx}/js/${cAlias}/${app}/${module}/${classVar}.js"></script>
  14. </head>
  15. <body>
  16. <!-- 顶部按钮 -->
  17. <div class="wrapper wrapper-content animated fadeInRight col-sm-12">
  18. <div class="panel-form">
  19. <form class="form-horizontal" id="${classVar}Form" action="save.htm" method="post">
  20. <div>
  21. <#list commonList as col>
  22. <#assign colName=convertUnderLine(col.columnName)>
  23. <div class="form-group">
  24. <label class="col-sm-2 control-label">${col.getComment()}<#if col.isNotNull><span class="required">*</span></#if>:</label>
  25. <div class="col-sm-10">
  26. <input type="text" class="form-control" id="${colName}" name="m:${classVar}:${colName}" value="<#noparse>${</#noparse>${classVar}.${colName}}" validate="{<#if col.isNotNull>required:true<#else>required:false</#if><#if col.colType=='String'&& col.length<1000>,maxlength:${col.length}</#if><#if col.colType=='Integer'|| col.colType=='Long'||col.colType=='Float'>,number:true<#if col.scale!=0>,maxDecimalLen:${col.scale}</#if><#if col.precision!=0>,maxIntLen:${col.precision}</#if></#if>}"/>
  27. </div>
  28. </div>
  29. </#list>
  30. <input type="hidden" name="m:${classVar}:${pkVar}" value="<#noparse>${</#noparse>${classVar}.${pkVar}}" />
  31. </div>
  32. <#-- 子表部分 -->
  33. <#if hasSub?exists && hasSub==true>
  34. <#list model.subTableList as subTable>
  35. <div class="form-group">
  36. <div class="col-sm-12">
  37. <table name="s:${subTable.variables.classVar}" class="table table-bordered">
  38. <caption>
  39. <div class="fr-table-header-label">${subTable.getTabComment()}</div>
  40. <div class="fr-table-tools">
  41. <a class="btn btn-primary fa fa-add js-add-record" href="javascript:void(0);">添加</a>
  42. <a class="btn btn-primary fa fa-remove js-remove-record" href="javascript:void(0);">删除</a>
  43. </div>
  44. </caption>
  45. <thead>
  46. <tr>
  47. <td>
  48. <label class="checkbox-inline" style="padding-top: 0px; ">
  49. <input class="ibps" type="checkbox" name="s:${subTable.variables.classVar}">
  50. <span class="lbl"></span>
  51. </label>
  52. </td>
  53. <#list subTable.columnList as col>
  54. <#assign colName=convertUnderLine(col.columnName)>
  55. <#assign foreignKey=convertUnderLine(subTable.foreignKey)>
  56. <#if (!col.isPK && foreignKey != colName)>
  57. <td>${col.comment}</td>
  58. </#if>
  59. </#list>
  60. <td>管理</td>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <c:forEach var="${subTable.variables.classVar}Po" varStatus="status" items="<#noparse>${</#noparse>${classVar}.${subTable.variables.classVar}PoList}">
  65. <tr>
  66. <td>
  67. <label class="checkbox-inline" style="padding-top: 0px; ">
  68. <input class="ibps" type="checkbox" name="s:${subTable.variables.classVar}">
  69. <span class="lbl"></span>
  70. </label>
  71. </td>
  72. <#list subTable.columnList as col>
  73. <#assign colName=convertUnderLine(col.columnName)>
  74. <#assign foreignKey=convertUnderLine(subTable.foreignKey)>
  75. <#if (!col.isPK && foreignKey != colName)>
  76. <td>
  77. <input type="text" class="form-control" name="s:${subTable.variables.classVar}:${colName}" value="<#noparse>${</#noparse>${subTable.variables.classVar}Po.${colName}}" validate="{<#if col.isNotNull>required:true<#else>required:false</#if><#if col.colType=='String'&& col.length<1000>,maxlength:${col.length}</#if><#if col.colType=='Integer'|| col.colType=='Long'||col.colType=='Float'>,number:true<#if col.scale!=0>,maxDecimalLen:${col.scale}</#if><#if col.precision!=0>,maxIntLen:${col.precision}</#if></#if>}"/>
  78. </td>
  79. </#if>
  80. </#list>
  81. <td class="fr_table_col_remove" width="45px">
  82. <a title="删除" class="btn btn-xs btn-outline btn-row js-remove-row" href="javascript:void(0);">
  83. <i class=" fa fa-times-circle-o fa-lg fa-font-red"></i>
  84. </a>
  85. </td>
  86. </tr>
  87. </c:forEach>
  88. </tbody>
  89. </table>
  90. </div>
  91. </div>
  92. </#list>
  93. <#-- 子表编辑模板 -->
  94. <#list model.subTableList as subTable>
  95. <script type="text/html" id="s:${subTable.variables.classVar}:TrTemplate">
  96. <tr>
  97. <td>
  98. <label class="checkbox-inline" style="padding-top: 0px; ">
  99. <input class="ibps" type="checkbox" name="s:${subTable.variables.classVar}">
  100. <span class="lbl"></span>
  101. </label>
  102. </td>
  103. <#list subTable.columnList as col>
  104. <#assign colName=convertUnderLine(col.columnName)>
  105. <#assign foreignKey=convertUnderLine(subTable.foreignKey)>
  106. <#if (!col.isPK && foreignKey != colName)>
  107. <td>
  108. <input type="text" class="form-control" name="s:${subTable.variables.classVar}:${colName}" value="" validate="{<#if col.isNotNull>required:true<#else>required:false</#if><#if col.colType=='String'&& col.length<1000>,maxlength:${col.length}</#if><#if col.colType=='Integer'|| col.colType=='Long'||col.colType=='Float'>,number:true<#if col.scale!=0>,maxDecimalLen:${col.scale}</#if><#if col.precision!=0>,maxIntLen:${col.precision}</#if></#if>}"/>
  109. </td>
  110. </#if>
  111. </#list>
  112. <td class="fr_table_col_remove" width="45px">
  113. <a title="删除" class="btn btn-xs btn-outline btn-row js-remove-row" href="javascript:void(0);">
  114. <i class=" fa fa-times-circle-o fa-lg fa-font-red"></i>
  115. </a>
  116. </td>
  117. </tr>
  118. </script>
  119. </#list>
  120. </#if>
  121. </form>
  122. </div>
  123. </div>
  124. </body>
  125. </html>