button.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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="ordinary-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 用户名称:<input type="text" name="userName"/>
  15. </li>
  16. <li>
  17. <a class="btn btn-primary btn-rounded btn-sm" onclick="query()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  18. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  19. </li>
  20. </ul>
  21. </div>
  22. </form>
  23. </div>
  24. <div class="col-sm-12 select-table table-striped">
  25. <table id="bootstrap-table"></table>
  26. </div>
  27. </div>
  28. </div>
  29. <div th:include="include :: footer"></div>
  30. <script th:inline="javascript">
  31. var prefix = ctx + "demo/table";
  32. var datas = [[${@dict.getType('sys_normal_disable')}]];
  33. function query() {
  34. var options = {
  35. url: prefix + "/list",
  36. showSearch: false,
  37. showRefresh: false,
  38. showToggle: false,
  39. showColumns: false,
  40. columns: [{
  41. checkbox: true
  42. },
  43. {
  44. field : 'userId',
  45. title : '用户ID'
  46. },
  47. {
  48. field : 'userCode',
  49. title : '用户编号'
  50. },
  51. {
  52. field : 'userName',
  53. title : '用户姓名'
  54. },
  55. {
  56. field : 'userPhone',
  57. title : '用户手机'
  58. },
  59. {
  60. field : 'userEmail',
  61. title : '用户邮箱'
  62. },
  63. {
  64. field : 'userBalance',
  65. title : '用户余额'
  66. },
  67. {
  68. field: 'status',
  69. title: '用户状态',
  70. align: 'center',
  71. formatter: function(value, row, index) {
  72. return $.table.selectDictLabel(datas, value);
  73. }
  74. },
  75. {
  76. title: '操作',
  77. align: 'center',
  78. formatter: function(value, row, index) {
  79. var actions = [];
  80. actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
  81. actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
  82. return actions.join('');
  83. }
  84. }]
  85. };
  86. $.table.init(options);
  87. }
  88. </script>
  89. </body>
  90. </html>