importTable.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('导入表结构')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="gen-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 表名称:<input type="text" name="tableName"/>
  15. </li>
  16. <li>
  17. 表描述:<input type="text" name="tableComment"/>
  18. </li>
  19. <li>
  20. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  21. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  22. </li>
  23. </ul>
  24. </div>
  25. </form>
  26. </div>
  27. <div class="col-sm-12 select-table table-striped">
  28. <table id="bootstrap-table"></table>
  29. </div>
  30. </div>
  31. </div>
  32. <th:block th:include="include :: footer" />
  33. <script type="text/javascript">
  34. var prefix = ctx + "tool/gen";
  35. $(function() {
  36. var options = {
  37. url: prefix + "/db/list",
  38. sortName: "createTime",
  39. sortOrder: "desc",
  40. showSearch: false,
  41. showRefresh: false,
  42. showToggle: false,
  43. showColumns: false,
  44. clickToSelect: true,
  45. rememberSelected: true,
  46. uniqueId: "tableName",
  47. columns: [{
  48. field: 'state',
  49. checkbox: true
  50. },
  51. {
  52. title: "序号",
  53. formatter: function (value, row, index) {
  54. return $.table.serialNumber(index);
  55. }
  56. },
  57. {
  58. field: 'tableName',
  59. title: '表名称',
  60. sortable: true,
  61. formatter: function(value, row, index) {
  62. return $.table.tooltip(value);
  63. }
  64. },
  65. {
  66. field: 'tableComment',
  67. title: '表描述',
  68. sortable: true,
  69. formatter: function(value, row, index) {
  70. return $.table.tooltip(value);
  71. }
  72. },
  73. {
  74. field: 'createTime',
  75. title: '创建时间',
  76. sortable: true
  77. },
  78. {
  79. field: 'updateTime',
  80. title: '更新时间',
  81. sortable: true
  82. }]
  83. };
  84. $.table.init(options);
  85. });
  86. /* 导入表结构-选择表结构-提交 */
  87. function submitHandler() {
  88. var rows = $.table.selectColumns("tableName");
  89. if (rows.length == 0) {
  90. $.modal.alertWarning("请至少选择一条记录");
  91. return;
  92. }
  93. var data = {"tables": rows.join()};
  94. $.operate.save(prefix + "/importTable", data);
  95. }
  96. </script>
  97. </body>
  98. </html>