pageAdd.ftl 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. #parse("content/base/back/common/head.vm")
  4. <body style='overflow:scroll;overflow-x:hidden'>
  5. <div class="container bs-docs-container" style="width:100%;">
  6. <div class="row">
  7. <div class="panel panel-default">
  8. <div class="panel-heading">
  9. <#-- update--begin--author:zhangjiaqiang date:20170524 for:美化p3列表页面的按钮 -->
  10. <button type="button" class="btn btn-primary" id="formSubmit"><span class="fa fa-save"></span> 保存</button>
  11. <button type="button" class="btn btn-default" id="formReturn" data-dismiss="modal" onclick="doUrl('$!{basePath}/${projectName}/${lowerName}.do?list')"><span class="fa fa-arrow-circle-left"></span> 返回</button>
  12. <#-- update--begin--author:zhangjiaqiang date:20170524 for:美化p3列表页面的按钮 -->
  13. </div>
  14. <div class="panel-body">
  15. <form class="form-horizontal" role="form" id="dailogForm" action="$!{basePath}/${projectName}/${lowerName}.do?doAdd" method="POST">
  16. <input type="hidden" id="btn_sub" class="btn_sub" />
  17. <#list columnDatas as item>
  18. <#if item.domainPropertyName != 'id'>
  19. <#if item.columnType == "datetime" ||item.columnType == "date" || item.columnType == "timestamp">
  20. <div class="form-group mno">
  21. <label for="inputEmail3" class="col-sm-2 control-label" style="text-align:left;">${item.columnComment}</label>
  22. <div class="col-sm-8">
  23. <input type="text" value="$!dateTool.format("yyyy-MM-dd",$!{${lowerName}.${item.domainPropertyName}})" name="${item.domainPropertyName}" id="${item.domainPropertyName}" class="form-control" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="background: url('$!{basePath}/plug-in-ui/images/datetime.png') no-repeat scroll right center transparent;" <#if item.nullable != 'Y'> datatype="*" </#if>/>
  24. </div>
  25. </div>
  26. <#else>
  27. <div class="form-group mno">
  28. <label for="inputEmail3" class="col-sm-2 control-label" style="text-align:left;">${item.columnComment}</label>
  29. <div class="col-sm-8">
  30. <input type="text" value="$!{${lowerName}.${item.domainPropertyName}}" name="${item.domainPropertyName}" id="${item.domainPropertyName}" class="form-control" <#if item.nullable != 'Y'> datatype="*" </#if>/>
  31. </div>
  32. </div>
  33. </#if>
  34. </#if>
  35. </#list>
  36. <div class="form-group mno">
  37. <ul id="tab_menu" class="nav nav-tabs">
  38. <#list subEntityList as sub>
  39. <li <#if sub_index == 0>class="active"</#if>>
  40. <a href="#${sub.paramData.lowerName}" data-toggle="tab">
  41. ${sub.paramData.codeName}
  42. </a>
  43. </li>
  44. </#list>
  45. </ul>
  46. <div id="tab_menu_content" class="tab-content">
  47. <#list subEntityList as sub>
  48. <div class="tab-pane fade in <#if sub_index == 0>active</#if>" id="${sub.paramData.lowerName}">
  49. <#-- update--begin--author:zhangjiaqiang date:20170524 for:美化p3列表页面的按钮 -->
  50. <button type="button" id="${sub.paramData.lowerName}_add" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加</button>
  51. <button type="button" id="${sub.paramData.lowerName}_del" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i> 删除</button>
  52. <#-- update--end--author:zhangjiaqiang date:20170524 for:美化p3列表页面的按钮 -->
  53. <table class="table table-striped" id="${sub.paramData.lowerName}_table" style="margin-top:15px;">
  54. <thead>
  55. <th>ID</th>
  56. <#list sub.paramData.columnDatas as item>
  57. <#if item.columnName?lower_case != 'id'>
  58. <th>${item.columnComment}</th>
  59. </#if>
  60. </#list>
  61. </thead>
  62. <tbody>
  63. </tbody>
  64. </table>
  65. </div>
  66. </#list>
  67. </div>
  68. </div>
  69. </form>
  70. <#list subEntityList as sub>
  71. <!-- ${sub.paramData.codeName}模板 -->
  72. <table style="display:none;">
  73. <tbody id="add_${sub.paramData.lowerName}_template">
  74. <tr>
  75. <#-- update--begin--author:zhangjiaqiang date:20170616 for:修订checkbox在IE下的兼容性 -->
  76. <td>
  77. <input type="checkbox" name="${sub.paramData.lowerName}Entities[#index#].idCheck" id="${sub.paramData.lowerName}Entities#index#_idCheck" />
  78. </td>
  79. <#-- update--begin--author:zhangjiaqiang date:20170616 for:修订checkbox在IE下的兼容性 -->
  80. <#list sub.paramData.columnDatas as item>
  81. <#if item.domainPropertyName != 'id'>
  82. <#if item.columnType == "datetime" ||item.columnType == "date" || item.columnType == "timestamp">
  83. <td>
  84. <input type="text" name="${sub.paramData.lowerName}Entities[#index#].${item.domainPropertyName}" maxlength="16" id="${sub.paramData.lowerName}Entities[#index#].${item.domainPropertyName}" class="form-control" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="background: url('$!{basePath}/plug-in-ui/images/datetime.png') no-repeat scroll right center transparent;" <#if item.nullable != 'Y'> datatype="*" </#if>/>
  85. </td>
  86. <#else>
  87. <td>
  88. <input type="text" name="${sub.paramData.lowerName}Entities[#index#].${item.domainPropertyName}" maxlength="16" id="${sub.paramData.lowerName}Entities[#index#].${item.domainPropertyName}" class="form-control" <#if item.nullable != 'Y'> datatype="*" </#if>/>
  89. </td>
  90. </#if>
  91. </#if>
  92. </#list>
  93. </tr>
  94. </tbody>
  95. </table>
  96. </#list>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </body>
  102. </html>
  103. <script type="text/javascript" src="$!{basePath}/plug-in-ui/js/Validform_v5.3.2.js"></script>
  104. <script type="text/javascript" src="$!{basePath}/plug-in-ui/js/forminit.p3.js"></script>
  105. <script type="text/javascript" src="$!{basePath}/${pageAddJsPath}"></script>
  106. <script type="text/javascript">
  107. jQuery(function(){
  108. <#list subEntityList as sub>
  109. var ${sub.paramData.lowerName}Tr = $("#add_${sub.paramData.lowerName}_template tr").clone();
  110. $("#${sub.paramData.lowerName}_table tbody").append(${sub.paramData.lowerName}Tr);
  111. resetTrNum('${sub.paramData.lowerName}_table');
  112. </#list>
  113. });
  114. </script>