copy.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('复制数据')" />
  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-modelEntity-copy">
  9. <input type="hidden" id="projectId" name="projectId" th:value="${modelProject.id}">
  10. <input type="hidden" id="orgEntityId" name="orgEntityId" th:value="${modelProject.orgEntityid}">
  11. <div class="form-group">
  12. <label class="col-sm-3 control-label is-required">表名称:</label>
  13. <div class="col-sm-8">
  14. <input id="entityName" name="entityName" th:field="*{entityName}" placeholder="表名称" class="form-control" type="text" required>
  15. </div>
  16. </div>
  17. <div class="form-group">
  18. <label class="col-sm-3 control-label is-required">表逻辑名:</label>
  19. <div class="col-sm-8">
  20. <input id="entityCode" name="entityCode" th:field="*{entityCode}" placeholder="m_tablename" class="form-control" type="text" required>
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="col-sm-3 control-label">描述:</label>
  25. <div class="col-sm-8">
  26. <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
  27. </div>
  28. </div>
  29. </form>
  30. </div>
  31. <th:block th:include="include :: footer" />
  32. <script th:inline="javascript">
  33. var prefix = ctx + "model/modelEntity"
  34. $("#form-modelEntity-add").validate({
  35. onkeyup: false,
  36. rules:{
  37. entityCode:{
  38. maxlength: 50,
  39. remote: {
  40. url: prefix + "/checkEntityCodeUnique",
  41. type: "post",
  42. dataType: "json",
  43. data: {
  44. "projectId":$("#projectId").val(),
  45. "entityCode": function() {
  46. return $.common.trim($("#entityCode").val());
  47. }
  48. },
  49. dataFilter: function(data, type) {
  50. return $.validate.unique(data);
  51. }
  52. }
  53. },
  54. entityName:{
  55. maxlength: 25
  56. },
  57. remark:{
  58. maxlength: 100
  59. },
  60. },
  61. messages: {
  62. "entityCode": {
  63. remote: "数据表已经存在"
  64. },
  65. },
  66. focusCleanup: true
  67. });
  68. function submitHandler() {
  69. if ($.validate.form()) {
  70. $.operate.save(prefix + "/copy", $('#form-modelEntity-copy').serialize());
  71. }
  72. }
  73. </script>
  74. </body>
  75. </html>