moments.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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. 动态ID:<input type="text" name="momentsId" placeholder="请输入动态ID"/>
  18. </li>
  19. <li>
  20. 状态:<select name="state" 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>
  26. 操作人:<input type="text" name="adminName" placeholder="请输入操作人"/>
  27. </li>
  28. <li class="select-time">
  29. <label>时间: </label>
  30. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime"/>
  31. <span>-</span>
  32. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
  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="batchPass()" shiro:hasPermission="dynamic:circle:dynamic:batch:pass">
  44. <i class="fa fa-check-circle"></i> 批量审核通过
  45. </a>
  46. <a class="btn btn-danger btn-xs" onclick="batchFail()" shiro:hasPermission="dynamic:circle:dynamic:batch:fail">
  47. <i class="fa fa-check-circle-o"></i> 批量审核不通过
  48. </a>
  49. </div>
  50. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  51. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  52. </div>
  53. </div>
  54. </div>
  55. <th:block th:include="include :: footer" />
  56. <script th:inline="javascript">
  57. var detailFlag = [[${@permission.hasPermi('dynamic:circle:dynamic:detail')}]];
  58. var passFlag = [[${@permission.hasPermi('dynamic:circle:dynamic:pass')}]];
  59. var failFlag = [[${@permission.hasPermi('dynamic:circle:dynamic:fail')}]];
  60. var reviewStatus = [[${@dict.getType('review_status')}]];
  61. var prefix = ctx + "dynamic/circle/dynamic";
  62. $(function() {
  63. var options = {
  64. url: prefix + "/list",
  65. modalName: "动态管理",
  66. height: $(window).height()-120,
  67. columns: [
  68. {
  69. field: 'pid',
  70. checkbox: true
  71. },
  72. {
  73. field: 'id',
  74. title: '动态ID'
  75. },
  76. {
  77. field: 'erBanNo',
  78. title: '卿卿号'
  79. },
  80. {
  81. field: 'nick',
  82. title: '昵称'
  83. },
  84. {
  85. field: 'picNum',
  86. title: '图'
  87. },
  88. {
  89. field: 'content',
  90. title: '配文'
  91. },
  92. {
  93. field: 'tape',
  94. title: '录音',
  95. align : 'center',
  96. formatter: function(value, row, index) {
  97. if(value != null) {
  98. return "<audio src='" + value + "' controls preload=\"none\"></audio>"
  99. }else{
  100. return value;
  101. }
  102. }
  103. },
  104. {
  105. field: 'topicTitle',
  106. title: '参与话题'
  107. },
  108. {
  109. field: 'state',
  110. title: '状态',
  111. align : 'center',
  112. formatter: function(value, row, index) {
  113. return $.table.selectDictLabel(reviewStatus, value);
  114. }
  115. },
  116. {
  117. field: 'adminName',
  118. title: '审核人'
  119. },
  120. {
  121. field: 'updateTime',
  122. title: '审核时间'
  123. },
  124. {
  125. field: 'createTime',
  126. title: '创建时间'
  127. },
  128. {
  129. field: 'commentNum',
  130. title: '评论数'
  131. },
  132. {
  133. field: 'likeNum',
  134. title: '点赞数',
  135. align : 'center'
  136. },
  137. {
  138. title: '操作',
  139. align: 'center',
  140. formatter: function(value, row, index) {
  141. var actions = [];
  142. actions.push('<a class="btn btn-primary btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-search"></i> 查看</a> ');
  143. if(row.state == 0){
  144. 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>');
  145. actions.push(' ');
  146. actions.push(' ');
  147. 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>');
  148. }else if(row.state == 1){
  149. 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>');
  150. } else if(row.state == 2){
  151. 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>');
  152. }
  153. return actions.join('');
  154. }
  155. }]
  156. };
  157. $.table.init(options);
  158. });
  159. function detail(id){
  160. var url = prefix + "/detail/" + id;
  161. $.modal.openView("查看动态详情",url,'900','650');
  162. }
  163. function fail(id) {
  164. $.modal.confirm("确认要审核不通过该记录吗?", function() {
  165. $.operate.post(prefix + "/fail?ids=" +id);
  166. });
  167. }
  168. function pass(id) {
  169. $.modal.confirm("确认要审核通过该记录吗?", function() {
  170. $.operate.post(prefix + "/pass?ids=" +id);
  171. });
  172. }
  173. /**
  174. * 批量审核通过
  175. */
  176. function batchPass(){
  177. var rows = $('#bootstrap-table').bootstrapTable('getSelections');
  178. if (rows.length == 0) {
  179. $.modal.alertWarning("请至少选择一条记录");
  180. return;
  181. }
  182. var ids = "";
  183. $.modal.confirm("确认要批量审核通过选中的" + rows.length + "条数据吗?", function() {
  184. for(var i=0;i < rows.length; i++){
  185. if(rows[i].pid == true) {
  186. ids += rows[i].id + ",";
  187. }
  188. }
  189. $.operate.post(prefix + "/batchPass?ids=" + ids);
  190. });
  191. }
  192. /**
  193. * 批量审核不通过
  194. */
  195. function batchFail() {
  196. var rows = $('#bootstrap-table').bootstrapTable('getSelections');
  197. if (rows.length == 0) {
  198. $.modal.alertWarning("请至少选择一条记录");
  199. return;
  200. }
  201. var ids = "";
  202. $.modal.confirm("确认要批量审核不通过选中的" + rows.length + "条数据吗?", function() {
  203. for(var i=0;i < rows.length; i++){
  204. if(rows[i].pid == true) {
  205. ids += rows[i].id + ",";
  206. }
  207. }
  208. $.operate.post(prefix + "/batchFail?ids=" + ids);
  209. });
  210. }
  211. </script>
  212. </body>
  213. </html>