export.html 2.3 KB

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