car.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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('car_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('car_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. 购买类型:<select name="buyType" th:with="type=${@dict.getType('buy_type')}">
  30. <option value="">所有</option>
  31. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  32. </select>
  33. </li>
  34. <li>
  35. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  36. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  37. </li>
  38. </ul>
  39. </div>
  40. </form>
  41. </div>
  42. <div class="btn-group-sm" id="toolbar" role="group">
  43. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mall:car:add">
  44. <i class="fa fa-plus"></i> 新增
  45. </a>
  46. <a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mall:car:batchDel">
  47. <i class="fa fa-remove"></i> 批量删除
  48. </a>
  49. <a class="btn btn-success" onclick="refresh()" shiro:hasPermission="mall:car:refresh">
  50. <i class="fa fa-refresh"></i> 刷新缓存
  51. </a>
  52. </div>
  53. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  54. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  55. </div>
  56. </div>
  57. </div>
  58. <th:block th:include="include :: footer" />
  59. <script th:inline="javascript">
  60. var editFlag = [[${@permission.hasPermi('mall:car:edit')}]];
  61. var removeFlag = [[${@permission.hasPermi('mall:car:del')}]];
  62. var giftIsTimeLimit = [[${@dict.getType('gift_is_time_limit')}]];
  63. var giftHasVgg = [[${@dict.getType('gift_has_vgg')}]];
  64. var carStatus = [[${@dict.getType('car_status')}]];
  65. var carType = [[${@dict.getType('car_type')}]];
  66. var buyType = [[${@dict.getType('buy_type')}]];
  67. var prefix = ctx + "mall/car";
  68. $(function() {
  69. var options = {
  70. url: prefix + "/list",
  71. createUrl: prefix + "/add",
  72. updateUrl: prefix + "/edit/{id}",
  73. removeUrl: prefix + "/remove",
  74. modalName: "座驾管理",
  75. height: $(window).height()-120,
  76. columns: [
  77. {
  78. field: 'id',
  79. align: 'center',
  80. checkbox: true
  81. },
  82. {
  83. field: 'carId',
  84. title: '座驾Id'
  85. },
  86. {
  87. field: 'carName',
  88. title: '座驾名称'
  89. },
  90. {
  91. field: 'allowPurse',
  92. title: '座驾类型',
  93. align : 'center',
  94. formatter: function(value, row, index) {
  95. return $.table.selectDictLabel(carType, value);
  96. }
  97. },
  98. {
  99. field: 'buyType',
  100. title: '购买类型',
  101. align : 'center',
  102. formatter: function(value, row, index) {
  103. return $.table.selectDictLabel(buyType, value);
  104. }
  105. },
  106. {
  107. field: 'carStatus',
  108. title: '座驾状态',
  109. align : 'center',
  110. formatter: function(value, row, index) {
  111. return $.table.selectDictLabel(carStatus, value);
  112. }
  113. },
  114. {
  115. field: 'leftLevel',
  116. title: '等级限制'
  117. },
  118. {
  119. field: 'goldPrice',
  120. title: '座驾金币'
  121. },
  122. {
  123. field: 'hasVggPic',
  124. title: 'vgg特效',
  125. align: 'center',
  126. formatter: function(value, row, index) {
  127. return $.table.selectDictLabel(giftHasVgg, value);
  128. }
  129. },
  130. {
  131. field: 'isTimeLimit',
  132. title: '限时座驾',
  133. align : 'center',
  134. formatter: function(value, row, index) {
  135. return $.table.selectDictLabel(giftIsTimeLimit, value);
  136. }
  137. },
  138. {
  139. field: 'effectiveTime',
  140. title: '时长(天)'
  141. },
  142. {
  143. field: 'seqNo',
  144. title: '排序',
  145. align : 'center'
  146. },
  147. {
  148. field: 'createTime',
  149. title: '创建时间',
  150. align : 'center'
  151. },
  152. {
  153. title: '操作',
  154. align: 'center',
  155. formatter: function(value, row, index) {
  156. var actions = [];
  157. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.carId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
  158. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.carId + '\')"><i class="fa fa-remove"></i> 删除</a>');
  159. return actions.join('');
  160. }
  161. }]
  162. };
  163. $.table.init(options);
  164. });
  165. function refresh() {
  166. $.modal.confirm("确认要刷新缓存数据吗?", function() {
  167. $.operate.post(prefix + "/refresh");
  168. });
  169. }
  170. </script>
  171. </body>
  172. </html>