data.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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('加载data数据')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 select-table table-striped">
  10. <table id="bootstrap-table"></table>
  11. </div>
  12. </div>
  13. </div>
  14. <div th:include="include :: footer"></div>
  15. <script th:inline="javascript">
  16. var datas = [[${@dict.getType('sys_normal_disable')}]];
  17. $(function() {
  18. var options = {
  19. data: [[${users}]],
  20. sidePagination: "client",
  21. showSearch: false,
  22. showRefresh: false,
  23. showToggle: false,
  24. showColumns: false,
  25. columns: [{
  26. checkbox: true
  27. },
  28. {
  29. field : 'userId',
  30. title : '用户ID'
  31. },
  32. {
  33. field : 'userCode',
  34. title : '用户编号'
  35. },
  36. {
  37. field : 'userName',
  38. title : '用户姓名'
  39. },
  40. {
  41. field : 'userPhone',
  42. title : '用户手机'
  43. },
  44. {
  45. field : 'userEmail',
  46. title : '用户邮箱'
  47. },
  48. {
  49. field : 'userBalance',
  50. title : '用户余额'
  51. },
  52. {
  53. field: 'status',
  54. title: '用户状态',
  55. align: 'center',
  56. formatter: function(value, row, index) {
  57. return $.table.selectDictLabel(datas, value);
  58. }
  59. },
  60. {
  61. title: '操作',
  62. align: 'center',
  63. formatter: function(value, row, index) {
  64. var actions = [];
  65. actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
  66. actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
  67. return actions.join('');
  68. }
  69. }]
  70. };
  71. $.table.init(options);
  72. });
  73. </script>
  74. </body>
  75. </html>