add.html.vm 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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}-add">
  9. #foreach($column in $columns)
  10. #if($column.columnName != $primaryKey.columnName)
  11. #if(!${column.configInfo})
  12. <div class="form-group">
  13. <label class="col-sm-3 control-label">${column.columnComment}:</label>
  14. <div class="col-sm-8">
  15. <input id="${column.attrname}" name="${column.attrname}" class="form-control" type="text">
  16. </div>
  17. </div>
  18. #else
  19. #if(${column.configInfo.type} == "dict")
  20. <div class="form-group">
  21. <label class="col-sm-3 control-label">${column.columnComment}:</label>
  22. <div class="col-sm-8">
  23. <select name="${column.attrname}" class="form-control m-b" th:with="type=${@dict.getType('${column.configInfo.value}')}">
  24. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  25. </select>
  26. </div>
  27. </div>
  28. #elseif(${column.configInfo.type} == "date")
  29. <div class="form-group">
  30. <label class="col-sm-3 control-label">${column.columnComment}:</label>
  31. <div class="col-sm-8">
  32. <input id="${column.attrname}" name="${column.attrname}" class="form-control time-input" type="text">
  33. </div>
  34. </div>
  35. #elseif(${column.configInfo.type} == "fk")
  36. #end
  37. #end
  38. #end
  39. #end
  40. </form>
  41. </div>
  42. <div th:include="include::footer"></div>
  43. <script type="text/javascript">
  44. var prefix = ctx + "${moduleName}/${classname}"
  45. $("#form-${classname}-add").validate({
  46. rules:{
  47. xxxx:{
  48. required:true,
  49. },
  50. },
  51. focusCleanup: true
  52. });
  53. function submitHandler() {
  54. if ($.validate.form()) {
  55. $.operate.save(prefix + "/add", $('#form-${classname}-add').serialize());
  56. }
  57. }
  58. </script>
  59. </body>
  60. </html>