message.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. 消息类型:<select name="type" th:with="type=${@dict.getType('message_type')}">
  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. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  24. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  25. </li>
  26. </ul>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="btn-group-sm" id="toolbar" role="group">
  31. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="users:message:add">
  32. <i class="fa fa-plus"></i> 新增
  33. </a>
  34. </div>
  35. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  36. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  37. </div>
  38. </div>
  39. </div>
  40. <th:block th:include="include :: footer" />
  41. <script th:inline="javascript">
  42. var revokeFlag = [[${@permission.hasPermi('users:message:revoke')}]];
  43. var messageType = [[${@dict.getType('message_type')}]];
  44. var receiveType = [[${@dict.getType('receive_type')}]];
  45. var skipType = [[${@dict.getType('skip_type')}]];
  46. var prefix = ctx + "users/message";
  47. $(function() {
  48. var options = {
  49. url: prefix + "/list",
  50. createUrl: prefix + "/add",
  51. revokeUrl: prefix + "/revoke/{id}",
  52. modalName: "消息",
  53. height: 600,
  54. columns: [
  55. {
  56. field: 'recordId',
  57. title: 'ID'
  58. },
  59. {
  60. field: 'fromAccid',
  61. title: '发送人'
  62. },
  63. {
  64. field: 'toAccids',
  65. title: '接收人',
  66. align : 'center'
  67. },
  68. {
  69. field: 'msgType',
  70. title: '消息类型',
  71. align : 'center',
  72. formatter: function(value, row, index) {
  73. return $.table.selectDictLabel(messageType, value);
  74. }
  75. },
  76. {
  77. field: 'toObjType',
  78. title: '指定对象',
  79. align : 'center',
  80. formatter: function(value, row, index) {
  81. return $.table.selectDictLabel(receiveType, value);
  82. }
  83. },
  84. {
  85. field: 'toErbanNos',
  86. title: '指定卿卿号',
  87. align : 'center'
  88. },
  89. {
  90. field: 'title',
  91. title: '标题',
  92. align : 'center'
  93. },
  94. {
  95. field: 'skipUri',
  96. title: '跳转',
  97. align : 'center'
  98. },
  99. {
  100. field: 'picUrl',
  101. title: '图片',
  102. align : 'center',
  103. formatter:function (value,row,index) {
  104. // return $.table.imageView(value, value);
  105. return "<img src='" + value + "' width='70' height='60'>";
  106. }
  107. },
  108. {
  109. field: 'msgDesc',
  110. title: '消息内容',
  111. align : 'center'
  112. },
  113. {
  114. field: 'skipType',
  115. title: '跳转类型',
  116. align : 'center',
  117. formatter: function(value, row, index) {
  118. return $.table.selectDictLabel(skipType, value);
  119. }
  120. },
  121. {
  122. field: 'adminName',
  123. title: '操作人',
  124. align : 'center'
  125. },
  126. {
  127. field: 'crateTime',
  128. title: '创建时间',
  129. align : 'center'
  130. }
  131. // ,
  132. //
  133. // {
  134. // title: '操作',
  135. // align: 'center',
  136. // formatter: function(value, row, index) {
  137. // var actions = [];
  138. // // if(row.status == 1){
  139. // // actions.push('<a class="btn btn-success btn-xs ' + revokeFlag + '" href="javascript:void(0)" onclick="revoke(\'' + row.id + '\')"><i class="fa fa-minus-circle"></i> 撤回</a> ');
  140. // // }
  141. // return actions.join('');
  142. // }
  143. // }
  144. ]
  145. };
  146. $.table.init(options);
  147. });
  148. function revoke(id){
  149. $.modal.confirm("确认要撤销该消息吗?", function() {
  150. $.operate.post(prefix + "/revoke?recordId=" + id);
  151. })
  152. }
  153. </script>
  154. </body>
  155. </html>