block.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. 封禁IP:<input type="text" name="ip" placeholder="请输入IP"/>
  21. </li>
  22. <li>
  23. 封禁类型:<select name="type" th:with="type=${@dict.getType('block_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="add()" shiro:hasPermission="users:block: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:block:unblock')}]];
  49. var bannedType = [[${@dict.getType('block_type')}]];
  50. var bannedTime = [[${@dict.getType('banned_time')}]];
  51. var bannedStatus = [[${@dict.getType('banned_status')}]];
  52. var prefix = ctx + "users/block";
  53. $(function() {
  54. var options = {
  55. url: prefix + "/list",
  56. createUrl: prefix + "/add",
  57. unblockUrl: prefix + "/unblock/{id}",
  58. modalName: "封禁列表",
  59. height: 600,
  60. columns: [
  61. {
  62. field: 'id',
  63. title: 'ID'
  64. },
  65. {
  66. field: 'erBanNo',
  67. title: '卿卿号'
  68. },
  69. {
  70. field: 'uid',
  71. title: 'uid',
  72. align : 'center'
  73. },
  74. {
  75. field: 'phone',
  76. title: '手机',
  77. align : 'center'
  78. },
  79. {
  80. field: 'deviceId',
  81. title: '设备号',
  82. align : 'center'
  83. },
  84. {
  85. field: 'ip',
  86. title: '封禁IP',
  87. align : 'center'
  88. },
  89. {
  90. field: 'bannedType',
  91. title: '封禁类型',
  92. align : 'center',
  93. formatter: function(value, row, index) {
  94. return $.table.selectDictLabel(bannedType, value);
  95. }
  96. },
  97. {
  98. field: 'bannedTime',
  99. title: '封禁时间',
  100. align : 'center',
  101. formatter: function(value, row, index) {
  102. return $.table.selectDictLabel(bannedTime, value);
  103. }
  104. },
  105. {
  106. field: 'bannedStatus',
  107. title: '封禁状态',
  108. align: 'center',
  109. formatter: function(value, row, index) {
  110. return $.table.selectDictLabel(bannedStatus, value);
  111. }
  112. },
  113. {
  114. field: 'bannedDesc',
  115. title: '封禁原因',
  116. align: 'center'
  117. },
  118. {
  119. field: 'adminName',
  120. title: '操作人',
  121. align : 'center'
  122. },
  123. {
  124. field: 'createTime',
  125. title: '创建时间',
  126. align : 'center'
  127. },
  128. {
  129. title: '操作',
  130. align: 'center',
  131. formatter: function(value, row, index) {
  132. var actions = [];
  133. if(row.bannedStatus == 1){
  134. actions.push('<a class="btn btn-success btn-xs ' + unblockFlag + '" href="javascript:void(0)" onclick="unblock(\'' + row.id + '\',\'' + row.erBanNo + '\')"><i class="fa fa-minus-circle"></i> 解封</a> ');
  135. }
  136. return actions.join('');
  137. }
  138. }]
  139. };
  140. $.table.init(options);
  141. });
  142. function unblock(id,erBanNo){
  143. $.modal.confirm("确认要解封该用户吗?", function() {
  144. $.operate.post(prefix + "/unblock?blockId=" + id + "&erBanNo=" + erBanNo);
  145. })
  146. }
  147. function add(){
  148. var url = prefix + "/add";
  149. $.modal.open("新增封禁信息",url,'800','400');
  150. }
  151. </script>
  152. </body>
  153. </html>