importTable.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. <form id="gen-form">
  10. <input type="hidden" id="projectId" name="projectId" th:value="${modelProject.id}">
  11. <!-- <div class="col-sm-12 search-collapse">-->
  12. <!-- <div class="select-list">-->
  13. <!-- <ul>-->
  14. <!-- <li>-->
  15. <!-- 表名称:<input type="text" name="entityName"/>-->
  16. <!-- </li>-->
  17. <!-- <li>-->
  18. <!-- 表逻辑名:<input type="text" name="entityCode"/>-->
  19. <!-- </li>-->
  20. <!-- <li>-->
  21. <!-- <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
  22. <!-- <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
  23. <!-- </li>-->
  24. <!-- </ul>-->
  25. <!-- </div>-->
  26. <!-- </div>-->
  27. </form>
  28. <div class="col-sm-12 select-table table-striped">
  29. <table id="bootstrap-table"></table>
  30. </div>
  31. </div>
  32. </div>
  33. <th:block th:include="include :: footer" />
  34. <script type="text/javascript">
  35. var prefix = ctx + "model/modelEntity";
  36. $(function() {
  37. var options = {
  38. url: prefix + "/db/list",
  39. pagination: false,
  40. showSearch: false,
  41. showRefresh: false,
  42. showToggle: false,
  43. showColumns: false,
  44. clickToSelect: true,
  45. rememberSelected: true,
  46. uniqueId: "entityCode",
  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: 'entityName',
  59. title: '表名称',
  60. formatter: function(value, row, index) {
  61. return $.table.tooltip(value);
  62. }
  63. },
  64. {
  65. field: 'entityCode',
  66. title: '表逻辑名',
  67. formatter: function(value, row, index) {
  68. return $.table.tooltip(value);
  69. }
  70. },
  71. ]
  72. };
  73. $.table.init(options);
  74. });
  75. /* 导入表结构-选择表结构-提交 */
  76. function submitHandler() {
  77. var rows = $.table.selectColumns("entityCode");
  78. if (rows.length == 0) {
  79. $.modal.alertWarning("请至少选择一条记录");
  80. return;
  81. }
  82. var projectId = $("#projectId").val();
  83. var data = {
  84. "projectId": projectId,
  85. "entityCode": rows.join()
  86. };
  87. $.operate.save(prefix + "/importTable", data);
  88. }
  89. </script>
  90. </body>
  91. </html>