cookie.html 2.2 KB

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