users_avatar.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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="erBanNo" placeholder="请输入卿卿号"/>
  15. </li>
  16. <li>
  17. 操作人:<input type="text" name="adminName" placeholder="请输入操作人"/>
  18. </li>
  19. <li>
  20. 状态:<select name="status" th:with="type=${@dict.getType('review_status')}">
  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 class="select-time">
  26. <label>创建时间: </label>
  27. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
  28. <span>-</span>
  29. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
  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="batchReviewSuccess()" shiro:hasPermission="users:avatar:batch:review:success">
  41. <i class="fa fa-toggle-on"></i> 批量审核通过
  42. </a>
  43. <a class="btn btn-success" onclick="batchReviewFail()" shiro:hasPermission="users:avatar:batch:review:fail">
  44. <i class="fa fa-toggle-off"></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 reviewSuccessFlag = [[${@permission.hasPermi('users:avatar:review:success')}]];
  55. var reviewFailFlag = [[${@permission.hasPermi('users:avatar:review:fail')}]];
  56. var reviewType = [[${@dict.getType('review_status')}]];
  57. var prefix = ctx + "users/avatar";
  58. $(function() {
  59. var options = {
  60. url: prefix + "/list",
  61. modalName: "用户头像列表",
  62. height: $(window).height()-120,
  63. columns: [
  64. {
  65. field: 'id',
  66. checkbox: true
  67. },
  68. {
  69. field: 'uid',
  70. title: 'uid'
  71. },
  72. {
  73. field: 'erBanNo',
  74. title: '卿卿号'
  75. },
  76. {
  77. field: 'nick',
  78. title: '昵称',
  79. align : 'center'
  80. },
  81. {
  82. field: 'avatar',
  83. title: '目前头像',
  84. align : 'center',
  85. formatter:function (value,row,index) {
  86. // return $.table.imageView(value, value);
  87. return "<img src='" + value + "' width='70' height='60'>";
  88. }
  89. },
  90. {
  91. field: 'newAvatar',
  92. title: '最新头像',
  93. align : 'center',
  94. formatter:function (value,row,index) {
  95. return "<img src='" + value + "' width='70' height='60'>";
  96. // return $.table.imageView(value, value);
  97. }
  98. },
  99. {
  100. field: 'avatarStatus',
  101. title: '状态',
  102. align : 'center',
  103. formatter: function(value, row, index) {
  104. return $.table.selectDictLabel(reviewType, value);
  105. }
  106. },
  107. {
  108. field: 'createTime',
  109. title: '创建时间',
  110. align : 'center'
  111. },
  112. {
  113. field: 'updateTime',
  114. title: '审核时间',
  115. align : 'center'
  116. },
  117. {
  118. field: 'adminName',
  119. title: '操作人',
  120. align : 'center'
  121. },
  122. {
  123. title: '操作',
  124. align: 'center',
  125. formatter: function(value, row, index) {
  126. var actions = [];
  127. if(row.avatarStatus == 0){
  128. actions.push('<a class="btn btn-success btn-xs ' + reviewSuccessFlag + '" href="javascript:void(0)" onclick="reviewSuccess(\'' + row.uid + '\')"><i class="fa fa-toggle-on"></i> 审核通过</a>');
  129. actions.push(" ");
  130. actions.push('<a class="btn btn-danger btn-xs ' + reviewFailFlag + '" href="javascript:void(0)" onclick="reviewFail(\'' + row.uid + '\')"><i class="fa fa-toggle-off"></i> 审核不通过</a> ');
  131. }
  132. if(row.avatarStatus == 1){
  133. actions.push('<a class="btn btn-success btn-xs ' + reviewFailFlag + '" href="javascript:void(0)" onclick="reviewFail(\'' + row.uid + '\')"><i class="fa fa-toggle-off"></i> 审核不通过</a> ');
  134. }
  135. if(row.avatarStatus == 2){
  136. actions.push('<a class="btn btn-success btn-xs ' + reviewSuccessFlag + '" href="javascript:void(0)" onclick="reviewSuccess(\'' + row.uid + '\')"><i class="fa fa-toggle-on"></i> 审核通过</a> ');
  137. }
  138. return actions.join('');
  139. }
  140. }]
  141. };
  142. $.table.init(options);
  143. });
  144. /**
  145. * 批量审核通过
  146. */
  147. function batchReviewSuccess() {
  148. var rows = $('#bootstrap-table').bootstrapTable('getSelections');
  149. if (rows.length == 0) {
  150. $.modal.alertWarning("请至少选择一条记录");
  151. return;
  152. }
  153. var ids = "";
  154. $.modal.confirm("确认要批量审核通过选中的" + rows.length + "条数据吗?", function() {
  155. for(var i=0;i < rows.length; i++){
  156. if(rows[i].id == true) {
  157. ids += rows[i].uid + ",";
  158. }
  159. }
  160. $.operate.post(prefix + "/batchReviewSuccess?ids=" + ids);
  161. });
  162. }
  163. /**
  164. * 批量审核不通过
  165. */
  166. function batchReviewFail() {
  167. var rows = $('#bootstrap-table').bootstrapTable('getSelections');
  168. if (rows.length == 0) {
  169. $.modal.alertWarning("请至少选择一条记录");
  170. return;
  171. }
  172. var ids = "";
  173. $.modal.confirm("确认要批量审核不通过选中的" + rows.length + "条数据吗?", function() {
  174. for(var i=0;i < rows.length; i++){
  175. if(rows[i].id == true) {
  176. ids += rows[i].uid + ",";
  177. }
  178. }
  179. $.operate.post(prefix + "/batchReviewFail?ids=" + ids);
  180. });
  181. }
  182. /**
  183. * 审核失败
  184. */
  185. function reviewFail(uid) {
  186. $.modal.confirm("确认要审核不通过该记录吗?", function() {
  187. $.operate.post(prefix + "/reviewFail?uid=" + uid);
  188. });
  189. }
  190. /**
  191. * 审核成功
  192. */
  193. function reviewSuccess(uid){
  194. $.modal.confirm("确认要审核通过该记录吗?", function() {
  195. $.operate.post(prefix + "/reviewSuccess?uid=" + uid);
  196. });
  197. }
  198. </script>
  199. </body>
  200. </html>