comment.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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="keyWord" placeholder="请输入关键词"/>
  15. </li>
  16. <li>
  17. 状态:<select name="state" th:with="type=${@dict.getType('review_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. 操作人:<input type="text" name="adminName" placeholder="请输入操作人"/>
  24. </li>
  25. <li class="select-time">
  26. <label>时间: </label>
  27. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime"/>
  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="batchPass()" shiro:hasPermission="dynamic:circle:comment:batch:pass">
  41. <i class="fa fa-check-circle"></i> 批量审核通过
  42. </a>
  43. <a class="btn btn-danger btn-xs" onclick="batchFail()" shiro:hasPermission="dynamic:circle:comment:batch:fail">
  44. <i class="fa fa-check-circle-o"></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 replyFlag = [[${@permission.hasPermi('dynamic:circle:comment:reply')}]];
  55. var passFlag = [[${@permission.hasPermi('dynamic:circle:comment:pass')}]];
  56. var failFlag = [[${@permission.hasPermi('dynamic:circle:comment:fail')}]];
  57. var reviewStatus = [[${@dict.getType('review_status')}]];
  58. var prefix = ctx + "dynamic/circle/comment";
  59. $(function() {
  60. var options = {
  61. url: prefix + "/list",
  62. modalName: "动态管理",
  63. height: $(window).height()-120,
  64. columns: [
  65. {
  66. field: 'pid',
  67. checkbox: true
  68. },
  69. {
  70. field: 'id',
  71. visible: false,
  72. title: 'ID'
  73. },
  74. {
  75. field: 'momentsId',
  76. title: '动态ID'
  77. },
  78. {
  79. field: 'fromErBanNo',
  80. title: '评论人卿卿号'
  81. },
  82. {
  83. field: 'fromNick',
  84. title: '评论人昵称'
  85. },
  86. {
  87. field: 'content',
  88. title: '内容'
  89. },
  90. {
  91. field: 'state',
  92. title: '状态',
  93. align : 'center',
  94. formatter: function(value, row, index) {
  95. return $.table.selectDictLabel(reviewStatus, value);
  96. }
  97. },
  98. {
  99. field: 'adminName',
  100. title: '审核人'
  101. },
  102. {
  103. field: 'updateTime',
  104. title: '审核时间'
  105. },
  106. {
  107. field: 'createTime',
  108. title: '创建时间'
  109. },
  110. {
  111. title: '操作',
  112. align: 'center',
  113. formatter: function(value, row, index) {
  114. var actions = [];
  115. actions.push('<a class="btn btn-primary btn-xs ' + replyFlag + '" href="javascript:void(0)" onclick="reply(\'' + row.id + '\')"><i class="fa fa-search"></i> 查看回复</a> ');
  116. if(row.state == 0){
  117. actions.push('<a class="btn btn-success btn-xs ' + passFlag + '" href="javascript:void(0)" onclick="pass(\'' + row.id + '\')"><i class="fa fa-check-circle"></i> 审核通过</a>');
  118. actions.push(' ');
  119. actions.push(' ');
  120. actions.push('<a class="btn btn-danger btn-xs ' + failFlag + '" href="javascript:void(0)" onclick="fail(\'' + row.id + '\')"><i class="fa fa-check-circle-o"></i> 审核不通过</a>');
  121. }else if(row.state == 1){
  122. actions.push('<a class="btn btn-danger btn-xs ' + failFlag + '" href="javascript:void(0)" onclick="fail(\'' + row.id + '\')"><i class="fa fa-check-circle-o"></i> 审核不通过</a>');
  123. } else if(row.state == 2){
  124. actions.push('<a class="btn btn-success btn-xs ' + passFlag + '" href="javascript:void(0)" onclick="pass(\'' + row.id + '\')"><i class="fa fa-check-circle"></i> 审核通过</a>');
  125. }
  126. return actions.join('');
  127. }
  128. }]
  129. };
  130. $.table.init(options);
  131. });
  132. function reply(id){
  133. var url = prefix + "/reply/" + id;
  134. $.modal.openView("查看评论回复",url,'1300','650');
  135. }
  136. function fail(id) {
  137. $.modal.confirm("确认要审核不通过该记录吗?", function() {
  138. $.operate.post(prefix + "/fail?ids=" +id);
  139. });
  140. }
  141. function pass(id) {
  142. $.modal.confirm("确认要审核通过该记录吗?", function() {
  143. $.operate.post(prefix + "/pass?ids=" +id);
  144. });
  145. }
  146. /**
  147. * 批量审核通过
  148. */
  149. function batchPass(){
  150. var rows = $('#bootstrap-table').bootstrapTable('getSelections');
  151. if (rows.length == 0) {
  152. $.modal.alertWarning("请至少选择一条记录");
  153. return;
  154. }
  155. var ids = "";
  156. $.modal.confirm("确认要批量审核通过选中的" + rows.length + "条数据吗?", function() {
  157. for(var i=0;i < rows.length; i++){
  158. if(rows[i].pid == true) {
  159. ids += rows[i].id + ",";
  160. }
  161. }
  162. $.operate.post(prefix + "/batchPass?ids=" + ids);
  163. });
  164. }
  165. /**
  166. * 批量审核不通过
  167. */
  168. function batchFail() {
  169. var rows = $('#bootstrap-table').bootstrapTable('getSelections');
  170. if (rows.length == 0) {
  171. $.modal.alertWarning("请至少选择一条记录");
  172. return;
  173. }
  174. var ids = "";
  175. $.modal.confirm("确认要批量审核不通过选中的" + rows.length + "条数据吗?", function() {
  176. for(var i=0;i < rows.length; i++){
  177. if(rows[i].pid == true) {
  178. ids += rows[i].id + ",";
  179. }
  180. }
  181. $.operate.post(prefix + "/batchFail?ids=" + ids);
  182. });
  183. }
  184. </script>
  185. </body>
  186. </html>