banned.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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="deviceId" placeholder="请输入设备号"/>
  18. </li>
  19. <li>
  20. 禁言类型:<select name="type" th:with="type=${@dict.getType('banned_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. 操作人:<input type="text" name="adminName" placeholder="请输入操作人"/>
  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="add()" shiro:hasPermission="users:banned:add">
  38. <i class="fa fa-plus"></i> 新增
  39. </a>
  40. </div>
  41. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  42. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  43. </div>
  44. </div>
  45. </div>
  46. <th:block th:include="include :: footer" />
  47. <script th:inline="javascript">
  48. var unblockFlag = [[${@permission.hasPermi('users:banned:unblock')}]];
  49. var overruleFlag = [[${@permission.hasPermi('users:banned:overrule')}]];
  50. var bannedType = [[${@dict.getType('banned_type')}]];
  51. var bannedTime = [[${@dict.getType('banned_time')}]];
  52. var bannedStatus = [[${@dict.getType('banned_status')}]];
  53. var prefix = ctx + "users/banned";
  54. $(function() {
  55. var options = {
  56. url: prefix + "/list",
  57. createUrl: prefix + "/add",
  58. unblockUrl: prefix + "/unblock/{id}",
  59. modalName: "禁言",
  60. height: 600,
  61. columns: [
  62. {
  63. field: 'id',
  64. title: 'ID'
  65. },
  66. {
  67. field: 'erbanNo',
  68. title: '卿卿号'
  69. },
  70. {
  71. field: 'uid',
  72. title: 'uid',
  73. align : 'center'
  74. },
  75. {
  76. field: 'phone',
  77. title: '手机',
  78. align : 'center'
  79. },
  80. {
  81. field: 'deviceId',
  82. title: '设备号',
  83. align : 'center'
  84. },
  85. {
  86. field: 'bannedType',
  87. title: '禁言类型',
  88. align : 'center',
  89. formatter: function(value, row, index) {
  90. return $.table.selectDictLabel(bannedType, value);
  91. }
  92. },
  93. {
  94. field: 'bannedStartTime',
  95. title: '禁言开始时间',
  96. align : 'center'
  97. },
  98. {
  99. field: 'bannedEndTime',
  100. title: '禁言结束时间',
  101. align : 'center'
  102. },
  103. {
  104. field: 'bannedStatus',
  105. title: '禁言状态',
  106. align: 'center',
  107. formatter: function(value, row, index) {
  108. return $.table.selectDictLabel(bannedStatus, value);
  109. }
  110. },
  111. {
  112. field: 'blockTime',
  113. title: '封禁时间',
  114. align : 'center',
  115. formatter: function(value, row, index) {
  116. return $.table.selectDictLabel(bannedTime, value);
  117. }
  118. },
  119. {
  120. field: 'bannedMinute',
  121. title: '禁言时长(分钟)',
  122. align : 'center'
  123. },
  124. {
  125. field: 'bannedDesc',
  126. title: '禁言原因',
  127. align: 'center'
  128. },
  129. {
  130. field: 'adminName',
  131. title: '操作人',
  132. align : 'center'
  133. },
  134. {
  135. field: 'createTime',
  136. title: '时间',
  137. align : 'center'
  138. },
  139. {
  140. title: '操作',
  141. align: 'center',
  142. formatter: function(value, row, index) {
  143. var actions = [];
  144. if(row.bannedStatus == 1){
  145. actions.push('<a class="btn btn-success btn-xs ' + unblockFlag + '" href="javascript:void(0)" onclick="unblock(\'' + row.id + '\')"><i class="fa fa-minus-circle"></i> 解封</a> ');
  146. }
  147. if(row.bannedStatus == 2){
  148. actions.push('<a class="btn btn-primary btn-xs ' + overruleFlag + '" href="javascript:void(0)" onclick="overrule(\'' + row.id + '\')"><i class="fa fa-reply-all"></i> 驳回</a> ');
  149. }
  150. return actions.join('');
  151. }
  152. }]
  153. };
  154. $.table.init(options);
  155. });
  156. function unblock(id){
  157. $.modal.confirm("确认要解封该用户吗?", function() {
  158. $.operate.post(prefix + "/unblock?bannedId=" + id);
  159. })
  160. }
  161. /**
  162. * 驳回
  163. * @param id
  164. */
  165. function overrule(id){
  166. $.modal.confirm("确认要驳回该记录吗?", function() {
  167. $.operate.post(prefix + "/overrule?bannedId=" + id);
  168. });
  169. }
  170. function add(){
  171. var url = prefix + "/add";
  172. $.modal.open("新增禁言信息",url,'800','400');
  173. }
  174. </script>
  175. </body>
  176. </html>