gift.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. <form id="role-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 礼物名称:<input type="text" name="name" placeholder="请输入礼物名称"/>
  15. </li>
  16. <li>
  17. 礼物状态:<select name="status" th:with="type=${@dict.getType('gift_status')}">
  18. <option value="">所有</option>
  19. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  20. </select>
  21. </li>
  22. <li>
  23. 礼物类型:<select name="type" th:with="type=${@dict.getType('gift_type')}">
  24. <option value="">所有</option>
  25. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  26. </select>
  27. </li>
  28. <li>
  29. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  30. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  31. </li>
  32. </ul>
  33. </div>
  34. </form>
  35. </div>
  36. <div class="btn-group-sm" id="toolbar" role="group">
  37. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mall:gift:add">
  38. <i class="fa fa-plus"></i> 新增
  39. </a>
  40. <a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mall:gift:batchDel">
  41. <i class="fa fa-remove"></i> 批量删除
  42. </a>
  43. <a class="btn btn-success" onclick="refresh()" shiro:hasPermission="mall:gift:refresh">
  44. <i class="fa fa-refresh"></i> 刷新缓存
  45. </a>
  46. </div>
  47. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  48. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  49. </div>
  50. </div>
  51. </div>
  52. <th:block th:include="include :: footer" />
  53. <script th:inline="javascript">
  54. var editFlag = [[${@permission.hasPermi('mall:gift:edit')}]];
  55. var removeFlag = [[${@permission.hasPermi('mall:gift:del')}]];
  56. var giftIsExpress = [[${@dict.getType('gift_is_express')}]];
  57. var giftIsCanGive = [[${@dict.getType('gift_is_can_give')}]];
  58. var giftIsTimeLimit = [[${@dict.getType('gift_is_time_limit')}]];
  59. var giftIsNoble = [[${@dict.getType('gift_is_noble')}]];
  60. var giftIsLatest = [[${@dict.getType('gift_is_latest')}]];
  61. var giftHasVgg = [[${@dict.getType('gift_has_vgg')}]];
  62. var giftHasEffect = [[${@dict.getType('gift_has_effect')}]];
  63. var giftStatus = [[${@dict.getType('gift_status')}]];
  64. var giftType = [[${@dict.getType('gift_type')}]];
  65. var prefix = ctx + "mall/gift";
  66. $(function() {
  67. var options = {
  68. url: prefix + "/list",
  69. createUrl: prefix + "/add",
  70. updateUrl: prefix + "/edit/{id}",
  71. removeUrl: prefix + "/remove",
  72. modalName: "礼物管理",
  73. height: $(window).height()-120,
  74. columns: [
  75. {
  76. field: 'id',
  77. align: 'center',
  78. checkbox: true
  79. },
  80. {
  81. field: 'giftId',
  82. title: '礼物ID'
  83. },
  84. {
  85. field: 'giftName',
  86. title: '礼物名称'
  87. },
  88. {
  89. field: 'giftStatus',
  90. title: '礼物状态',
  91. align : 'center',
  92. formatter: function(value, row, index) {
  93. return $.table.selectDictLabel(giftStatus, value);
  94. }
  95. },
  96. {
  97. field: 'giftType',
  98. title: '礼物类型',
  99. align : 'center',
  100. formatter: function(value, row, index) {
  101. return $.table.selectDictLabel(giftType, value);
  102. }
  103. },
  104. {
  105. field: 'goldPrice',
  106. title: '金币'
  107. },
  108. {
  109. field: 'hasEffect',
  110. title: '礼物特效',
  111. align : 'center',
  112. formatter: function(value, row, index) {
  113. return $.table.selectDictLabel(giftHasEffect, value);
  114. }
  115. },
  116. {
  117. field: 'hasVggPic',
  118. title: 'vgg特效',
  119. align: 'center',
  120. formatter: function(value, row, index) {
  121. return $.table.selectDictLabel(giftHasVgg, value);
  122. }
  123. },
  124. {
  125. field: 'isLatest',
  126. title: '最新礼物',
  127. align : 'center',
  128. formatter: function(value, row, index) {
  129. return $.table.selectDictLabel(giftIsLatest, value);
  130. }
  131. },
  132. {
  133. field: 'isNobleGift',
  134. title: '贵族礼物',
  135. align : 'center',
  136. formatter: function(value, row, index) {
  137. return $.table.selectDictLabel(giftIsNoble, value);
  138. }
  139. },
  140. {
  141. field: 'isTimeLimit',
  142. title: '限时礼物',
  143. align : 'center',
  144. formatter: function(value, row, index) {
  145. return $.table.selectDictLabel(giftIsTimeLimit, value);
  146. }
  147. },
  148. {
  149. field: 'isExpressGift',
  150. title: '表白礼物',
  151. align : 'center',
  152. formatter: function(value, row, index) {
  153. return $.table.selectDictLabel(giftIsExpress, value);
  154. }
  155. },
  156. {
  157. field: 'seqNo',
  158. title: '排序'
  159. },
  160. {
  161. field: 'startValidTime',
  162. title: '有效开始时间',
  163. align : 'center'
  164. },
  165. {
  166. field: 'endValidTime',
  167. title: '有效结束时间',
  168. align : 'center'
  169. },
  170. {
  171. field: 'createTime',
  172. title: '创建时间',
  173. align : 'center'
  174. },
  175. {
  176. title: '操作',
  177. align: 'center',
  178. formatter: function(value, row, index) {
  179. var actions = [];
  180. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.giftId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
  181. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.giftId + '\')"><i class="fa fa-remove"></i> 删除</a>');
  182. return actions.join('');
  183. }
  184. }]
  185. };
  186. $.table.init(options);
  187. });
  188. function refresh() {
  189. $.modal.confirm("确认要刷新缓存数据吗?", function() {
  190. $.operate.post(prefix + "/refresh");
  191. });
  192. }
  193. </script>
  194. </body>
  195. </html>