1004610284_edit.jsp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <html>
  2. <head>
  3. <style>
  4. .gray-bg {
  5. background-color: #f5f6fa !important;
  6. }
  7. .msg-list {
  8. box-sizing: border-box;
  9. width: 100%;
  10. padding: 20px;
  11. }
  12. .msg-list dl {
  13. margin-bottom: 20px;
  14. background-color: #fff;
  15. border-radius: 6px;
  16. overflow: hidden;
  17. transition: all .5s;
  18. }
  19. .msg-list dl:hover {
  20. box-shadow: 5px 3px 3px #eee;
  21. }
  22. .msg-list dl:last-child {
  23. margin-bottom: 0;
  24. }
  25. .msg-list dt,
  26. .msg-list dt img {
  27. width: 100%;
  28. }
  29. .msg-list dt {
  30. text-align: center;
  31. }
  32. .msg-list dd {
  33. padding: 0 20px;
  34. color: #666;
  35. }
  36. .msg-list-title,
  37. .msg-list-desc {
  38. display: -webkit-box;
  39. -webkit-box-orient: vertical;
  40. -webkit-line-clamp: 2;
  41. overflow: hidden;
  42. }
  43. .msg-list .msg-list-title {
  44. font-size: 14px;
  45. color: #000;
  46. line-height: 24px;
  47. margin: 12px 0 6px;
  48. position: relative;
  49. }
  50. .msg-list-title i {
  51. display: inline-block;
  52. width: 6px;
  53. height: 6px;
  54. border-radius: 50%;
  55. background-color: #f56c6c;
  56. position: absolute;
  57. top: 10px;
  58. left: 10px;
  59. }
  60. .msg-list .msg-list-desc {
  61. -webkit-line-clamp: 3;
  62. line-height: 20px;
  63. font-size: 12px;
  64. }
  65. .msg-list .msg-list-time {
  66. margin-top: 10px;
  67. font-size: 14px;
  68. padding-top: 10px;
  69. padding-bottom: 10px;
  70. position: relative;
  71. overflow: hidden;
  72. }
  73. .msg-list .msg-list-time::before {
  74. content: "";
  75. position: absolute;
  76. top: 0;
  77. left: 15px;
  78. width: calc(100% - 30px);
  79. height: 1px;
  80. background-color: #eee;
  81. }
  82. .msg-list-time i {
  83. font-style: normal;
  84. float: right;
  85. margin-top: 1px;
  86. }
  87. .msg-list-time .el-icon-arrow-right {
  88. font-size: 16px;
  89. margin-left: 3px;
  90. }
  91. .layui-laypage a,
  92. .layui-laypage span,
  93. .layui-laypage input,
  94. .layui-laypage button {
  95. background-color: transparent;
  96. }
  97. .image-slot {
  98. color: #ccc;
  99. }
  100. .image-slot i {
  101. font-size: 36px;
  102. padding-top: 20px;
  103. padding-bottom: 10px;
  104. }
  105. .el-form {
  106. height: calc(100% - 50px - 55px);
  107. overflow-y: auto;
  108. }
  109. .space-tbs .tab-right .el-button {
  110. padding-top: 6px;
  111. padding-bottom: 6px;
  112. }
  113. .space-tbs .tab-right .el-button i,
  114. .space-tbs .tab-right .el-button span {
  115. vertical-align: middle;
  116. }
  117. </style>
  118. </head>
  119. <body>
  120. <c:if test="${empty sysMsgList}">
  121. <div id="space-content">
  122. </c:if>
  123. <c:if test="${not empty sysMsgList}">
  124. <div id="space-content" class="gray-bg">
  125. </c:if>
  126. <div class="space-tbs">
  127. <el-tabs v-model="obj.viewCode" @tab-click="space.forms.submit();">
  128. <el-tab-pane label="全部" name=""></el-tab-pane>
  129. <el-tab-pane label="已读" name="10000"></el-tab-pane>
  130. <el-tab-pane label="未读" name="10010"></el-tab-pane>
  131. </el-tabs>
  132. <div class="tab-right">
  133. <div class="tabs-right-search">
  134. <el-input placeholder="搜索关键字" v-model="obj.title" size="small" clearable>
  135. <i slot="suffix" class="el-input__icon el-icon-search space-search-icon"
  136. onclick="space.forms.submit();"></i>
  137. </el-input>
  138. </div>
  139. <div class="tabs-right-btns">
  140. <el-button type="primary" icon="spaceicon icon-quanbuyidu"
  141. plain
  142. size="small"
  143. @click="confirmAll">
  144. 全部已读
  145. </el-button>
  146. </div>
  147. </div>
  148. </div>
  149. <el-form action="@service{name:'system_message_list', page:'sys_msg.msg_list'}@" method="post" ref="obj" :model="obj">
  150. <!-- 列表 -->
  151. <div id="msgList" class="msg-list">
  152. <c:forEach items="${sysMsgList }" var="item">
  153. <c:if test="${item.token != '' && item.token != null}">
  154. <dl id="${item.smid}" style="cursor: pointer;" data-view="${item.isView}" @click="clickFun('${item.destinationTitle}', '${item.width}', '${item.height}', '${item.token}')">
  155. </c:if>
  156. <c:if test="${item.token == '' || item.token == null}">
  157. <dl id="${item.smid}" data-view="${item.isView}">
  158. </c:if>
  159. <c:if test="${item.thumbnail != null}">
  160. <dt>
  161. <el-image src="${item.thumbnail}" >
  162. <div slot="error" class="image-slot">
  163. <i class="el-icon-picture-outline"></i>
  164. <p>图片加载失败</p>
  165. </div>
  166. </el-image>
  167. </dt>
  168. </c:if>
  169. <dd class="msg-list-title">
  170. <!-- 未读有i,已读没有i -->
  171. <i id="i_${item.smid}" v-if="!${item.isView}"></i>
  172. ${item.title}
  173. </dd>
  174. <dd class="msg-list-desc">
  175. ${item.desc}
  176. </dd>
  177. <dd class="msg-list-time">
  178. <span>${item.source}</span>
  179. <i class="el-icon-arrow-right" v-show="${item.token != '' && item.token != null}"></i>
  180. <i>${item.create_time}</i>
  181. </dd>
  182. </dl>
  183. </c:forEach>
  184. <c:if test="${empty sysMsgList}">
  185. <div class="no-data"></div>
  186. </c:if>
  187. </div>
  188. </el-form>
  189. <app:appPage />
  190. </div>
  191. </body>
  192. <script>
  193. $(function() {
  194. var len = $("#appPageDiv").children().length;
  195. if(len > 0) {
  196. $(".el-form").css({
  197. 'height': 'calc(100% - 50px - 55px)'
  198. })
  199. }else {
  200. $(".el-form").css({
  201. 'height': 'calc(100% - 70px)'
  202. })
  203. }
  204. })
  205. </script>
  206. <script type="text/javascript">
  207. space.vue = new Vue({
  208. el: space.appContent,
  209. data: function() {
  210. return {
  211. obj: {
  212. title: '${title}',
  213. viewCode: '${viewCode}',
  214. rowCountPerPage: "20"
  215. },
  216. }
  217. },
  218. methods: {
  219. clickFun: function(title, width, height, token) {
  220. space.plugins.layer.openPage({
  221. open: true,
  222. title: title,
  223. width: width,
  224. height: height,
  225. url: token,
  226. refresh: false
  227. });
  228. },
  229. confirmAll:function () {
  230. var index = top.layer.confirm("标记所有消息为已读, 是否继续?", {
  231. anim: 5,
  232. isOutAnim: false,
  233. title: "提示",
  234. btn: ['确定', '取消'] //按钮
  235. }, function () {
  236. space.utils.ajax({
  237. url: '@service{ name:`system_message_all_have_read` }@',
  238. dataType: 'json',
  239. callback: function(data) {
  240. if(data.code == "success") {
  241. top.layer.close(index);
  242. space.forms.submit();
  243. }else{
  244. space.message.error(data.msg);
  245. }
  246. }
  247. });
  248. }, function () {
  249. });
  250. }
  251. },
  252. mounted: function() {
  253. $("#msgList").find("dl").on("click", function() {
  254. var view = $(this).attr("data-view");
  255. if(view == "true") {
  256. return;
  257. }
  258. var that = this;
  259. var id = $(this).attr("id");
  260. if(space.utils.isNull(id)) {
  261. console.error("未获取到消息ID")
  262. return;
  263. }
  264. space.utils.ajax({
  265. url: '@service{ name:`system_message_have_read` }@',
  266. data: {
  267. smid: id
  268. },
  269. dataType: 'json',
  270. callback: function(data) {
  271. if(data.code == "success") {
  272. $(that).attr("data-view", "true");
  273. $("#i_" + id).remove();
  274. }else{
  275. space.message.error(data.msg);
  276. }
  277. }
  278. });
  279. });
  280. $("#appPageDiv").show();
  281. }
  282. })
  283. </script>
  284. </html>