1008510583_run.jsp 9.8 KB

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