honour.html 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 search-collapse">
  10. </div>
  11. <div class="btn-group-sm" id="toolbar" role="group">
  12. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="company:honour:add">
  13. <i class="fa fa-plus"></i> 添加
  14. </a>
  15. <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="company:honour:edit">
  16. <i class="fa fa-edit"></i> 修改
  17. </a>
  18. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="company:honour:remove">
  19. <i class="fa fa-remove"></i> 删除
  20. </a>
  21. </div>
  22. <div class="col-sm-12 select-table table-striped">
  23. <table id="bootstrap-table"></table>
  24. </div>
  25. </div>
  26. </div>
  27. <th:block th:include="include :: footer" />
  28. <script th:inline="javascript">
  29. var editFlag = [[${@permission.hasPermi('company:honour:edit')}]];
  30. var removeFlag = [[${@permission.hasPermi('company:honour:remove')}]];
  31. var prefix = ctx + "company/honour";
  32. $(function() {
  33. var options = {
  34. url: prefix + "/list",
  35. createUrl: prefix + "/add",
  36. updateUrl: prefix + "/edit/{id}",
  37. removeUrl: prefix + "/remove",
  38. modalName: "企业荣誉",
  39. columns: [{
  40. checkbox: true
  41. },
  42. {
  43. field : 'honourId',
  44. title : '商户荣誉id',
  45. visible: false
  46. },
  47. {
  48. field : 'companyId',
  49. title : '商户id',
  50. visible: false
  51. },
  52. {
  53. field : 'title',
  54. title : '荣誉标题'
  55. },
  56. {
  57. field : 'des',
  58. title : '荣誉描述'
  59. },
  60. {
  61. field : 'img',
  62. title : '荣誉图片',
  63. formatter: function(value, row, index) {
  64. // 图片预览(注意:如存储在本地直接获取数据库路径,如有配置context-path需要使用ctx+路径)
  65. // 如:/profile/upload/2019/08/08/3b7a839aced67397bac694d77611ce72.png
  66. return $.table.imageView(value,250,250);
  67. }
  68. },
  69. {
  70. field : 'remark',
  71. title : '备注'
  72. },
  73. {
  74. title: '操作',
  75. align: 'center',
  76. formatter: function(value, row, index) {
  77. var actions = [];
  78. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.honourId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  79. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.honourId + '\')"><i class="fa fa-remove"></i>删除</a>');
  80. return actions.join('');
  81. }
  82. }]
  83. };
  84. $.table.init(options);
  85. });
  86. </script>
  87. </body>
  88. </html>