image.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. $(function() {
  18. var options = {
  19. url: prefix + "/list",
  20. showSearch: false,
  21. showRefresh: false,
  22. showToggle: false,
  23. showColumns: false,
  24. columns: [{
  25. checkbox: true
  26. },
  27. {
  28. field : 'userId',
  29. title : '用户ID'
  30. },
  31. {
  32. field : 'userCode',
  33. title : '用户编号'
  34. },
  35. {
  36. field : 'userName',
  37. title : '用户姓名'
  38. },
  39. {
  40. title: '图片',
  41. formatter: function(value, row, index) {
  42. // 图片自由组合
  43. // 'img/profile.jpg' - 'http://ruoyi.vip/' 变成 http://ruoyi.vip/img/profile.jpg
  44. // 'xbd.png' - 'http://ruoyi.vip/' 变成 http://ruoyi.vip/ruoyi.jpg
  45. if(index % 2 == 0){
  46. return $.table.imageView('img/profile.jpg', 'http://ruoyi.vip/');
  47. }else {
  48. return $.table.imageView('ruoyi.png', 'http://ruoyi.vip/');
  49. }
  50. }
  51. },
  52. {
  53. field : 'userPhone',
  54. title : '用户手机'
  55. },
  56. {
  57. field : 'userEmail',
  58. title : '用户邮箱'
  59. },
  60. {
  61. field : 'userBalance',
  62. title : '用户余额'
  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>