export.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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"></table>
  11. </div>
  12. </div>
  13. </div>
  14. <div th:include="include :: footer"></div>
  15. <th:block th:include="include :: bootstrap-table-export-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. showSearch: false,
  23. showRefresh: false,
  24. showToggle: false,
  25. showColumns: false,
  26. showExport: true,
  27. exportOptions: {
  28. ignoreColumn: [0, 8] //忽略第一列和最后一列
  29. },
  30. columns: [{
  31. checkbox: true
  32. },
  33. {
  34. field : 'userId',
  35. title : '用户ID'
  36. },
  37. {
  38. field : 'userCode',
  39. title : '用户编号'
  40. },
  41. {
  42. field : 'userName',
  43. title : '用户姓名'
  44. },
  45. {
  46. field : 'userPhone',
  47. title : '用户手机'
  48. },
  49. {
  50. field : 'userEmail',
  51. title : '用户邮箱'
  52. },
  53. {
  54. field : 'userBalance',
  55. title : '用户余额'
  56. },
  57. {
  58. field: 'status',
  59. title: '用户状态',
  60. align: 'center',
  61. formatter: function(value, row, index) {
  62. return $.table.selectDictLabel(datas, value);
  63. }
  64. },
  65. {
  66. title: '操作',
  67. align: 'center',
  68. formatter: function(value, row, index) {
  69. var actions = [];
  70. actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
  71. actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
  72. return actions.join('');
  73. }
  74. }]
  75. };
  76. $.table.init(options);
  77. });
  78. </script>
  79. </body>
  80. </html>