edit.html.vm 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('修改${tableComment}')" />
  5. </head>
  6. <body class="white-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  8. <form class="form-horizontal m" id="form-${classname}-edit" th:object="${${classname}}">
  9. <input id="${primaryKey.attrname}" name="${primaryKey.attrname}" th:field="*{${primaryKey.attrname}}" type="hidden">
  10. #foreach($column in $columns)
  11. #if($column.columnName != $primaryKey.columnName)
  12. #if(!${column.configInfo})
  13. <div class="form-group">
  14. <label class="col-sm-3 control-label">${column.columnComment}:</label>
  15. <div class="col-sm-8">
  16. <input id="${column.attrname}" name="${column.attrname}" th:field="*{${column.attrname}}" class="form-control" type="text">
  17. </div>
  18. </div>
  19. #else
  20. #if(${column.configInfo.type} == "dict")
  21. <div class="form-group">
  22. <label class="col-sm-3 control-label">${column.columnComment}:</label>
  23. <div class="col-sm-8">
  24. <select name="${column.attrname}" class="form-control m-b" th:with="type=${@dict.getType('${column.configInfo.value}')}">
  25. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{${column.attrname}}"></option>
  26. </select>
  27. </div>
  28. </div>
  29. #elseif(${column.configInfo.type} == "date")
  30. <div class="form-group">
  31. <label class="col-sm-3 control-label">${column.columnComment}:</label>
  32. <div class="col-sm-8">
  33. <input id="${column.attrname}" name="${column.attrname}" th:field="*{${column.attrname}}" class="form-control time-input" type="text">
  34. </div>
  35. </div>
  36. #elseif(${column.configInfo.type} == "fk")
  37. #end
  38. #end
  39. #end
  40. #end
  41. </form>
  42. </div>
  43. <div th:include="include::footer"></div>
  44. <script type="text/javascript">
  45. var prefix = ctx + "${moduleName}/${classname}";
  46. $("#form-${classname}-edit").validate({
  47. rules:{
  48. xxxx:{
  49. required:true,
  50. },
  51. },
  52. focusCleanup: true
  53. });
  54. function submitHandler() {
  55. if ($.validate.form()) {
  56. $.operate.save(prefix + "/edit", $('#form-${classname}-edit').serialize());
  57. }
  58. }
  59. </script>
  60. </body>
  61. </html>