banner.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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('Banner管理')" />
  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. <form id="role-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 跳转类型:<select name="skipType" th:with="type=${@dict.getType('skip_type')}">
  15. <option value="">所有</option>
  16. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  17. </select>
  18. </li>
  19. <li>
  20. 状态:<select name="bannerStatus" th:with="type=${@dict.getType('activation_type')}">
  21. <option value="">所有</option>
  22. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  23. </select>
  24. </li>
  25. <li>
  26. 显示位置:<select name="viewType" th:with="type=${@dict.getType('banner_view_position')}">
  27. <option value="">所有</option>
  28. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  29. </select>
  30. </li>
  31. <li>
  32. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  33. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  34. </li>
  35. </ul>
  36. </div>
  37. </form>
  38. </div>
  39. <div class="btn-group-sm" id="toolbar" role="group">
  40. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="operation:banner:add">
  41. <i class="fa fa-plus"></i> 新增
  42. </a>
  43. </div>
  44. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  45. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  46. </div>
  47. </div>
  48. </div>
  49. <th:block th:include="include :: footer" />
  50. <script th:inline="javascript">
  51. var editFlag = [[${@permission.hasPermi('operation:banner:edit')}]];
  52. var removeFlag = [[${@permission.hasPermi('operation:banner:del')}]];
  53. var skipType = [[${@dict.getType('skip_type')}]];
  54. var activationType = [[${@dict.getType('activation_type')}]];
  55. var bannerViewPosition = [[${@dict.getType('banner_view_position')}]];
  56. var isNewsType = [[${@dict.getType('is_news_type')}]];
  57. var osType = [[${@dict.getType('system_type')}]];
  58. var prefix = ctx + "operation/banner";
  59. $(function() {
  60. var options = {
  61. url: prefix + "/list",
  62. createUrl: prefix + "/add",
  63. updateUrl: prefix + "/edit/{id}",
  64. removeUrl: prefix + "/remove",
  65. modalName: "banner信息",
  66. height: $(window).height()-120,
  67. columns: [
  68. {
  69. field: 'bannerId',
  70. title: 'bannerId'
  71. },
  72. {
  73. field: 'bannerName',
  74. title: '名称'
  75. },
  76. {
  77. field: 'bannerPic',
  78. title: 'banner图',
  79. align : 'center',
  80. formatter:function (value,row,index) {
  81. return "<img src='" + value + "' width='70' height='60'>";
  82. }
  83. },
  84. {
  85. field: 'skipType',
  86. title: '推荐类型',
  87. align : 'center',
  88. formatter: function(value, row, index) {
  89. return $.table.selectDictLabel(skipType, value);
  90. }
  91. },
  92. {
  93. field: 'seqNo',
  94. title: '排序',
  95. align : 'center'
  96. },
  97. {
  98. field: 'bannerStatus',
  99. title: '状态',
  100. align : 'center',
  101. formatter: function(value, row, index) {
  102. return $.table.selectDictLabel(activationType, value);
  103. }
  104. },
  105. {
  106. field: 'osType',
  107. title: '平台',
  108. align : 'center',
  109. formatter: function(value, row, index) {
  110. return $.table.selectDictLabel(osType, value);
  111. }
  112. },
  113. {
  114. field: 'isNewUser',
  115. title: '新用户',
  116. align : 'center',
  117. formatter: function(value, row, index) {
  118. return $.table.selectDictLabel(isNewsType, value);
  119. }
  120. },
  121. {
  122. field: 'viewType',
  123. title: '显示位置',
  124. align : 'center',
  125. formatter: function(value, row, index) {
  126. return $.table.selectDictLabel(bannerViewPosition, value);
  127. }
  128. },
  129. {
  130. field: 'startTime',
  131. title: '开始时间',
  132. align : 'center'
  133. },
  134. {
  135. field: 'endTime',
  136. title: '结束时间',
  137. align : 'center'
  138. },
  139. {
  140. field: 'createTiem',
  141. title: '创建时间',
  142. align : 'center'
  143. },
  144. {
  145. title: '操作',
  146. align: 'center',
  147. formatter: function(value, row, index) {
  148. var actions = [];
  149. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bannerId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
  150. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.bannerId + '\')"><i class="fa fa-remove"></i> 删除</a>');
  151. return actions.join('');
  152. }
  153. }]
  154. };
  155. $.table.init(options);
  156. });
  157. </script>
  158. </body>
  159. </html>