| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <html>
- <head>
- <style>
- body{
- background-color: #f5f6fa;
- }
- #space-content{
- background-color: transparent;
- }
- .msg-list{
- box-sizing: border-box;
- width: 100%;
- padding: 20px;
- }
- .msg-list dl{
- margin-bottom: 20px;
- background-color: #fff;
- border-radius: 6px;
- overflow: hidden;
- }
- .msg-list dl:last-child{
- margin-bottom: 0;
- }
- .msg-list dt,
- .msg-list dt img{
- width: 100%;
- }
- .msg-list dt{
- text-align: center;
- }
- .msg-list dd{
- padding: 0 20px;
- color: #666;
- }
- .msg-list-title,
- .msg-list-desc{
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .msg-list .msg-list-title{
- font-size: 16px;
- color: #000;
- line-height: 24px;
- margin: 12px 0 6px;
- position: relative;
- }
- .msg-list-title i{
- display: inline-block;
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background-color: #f56c6c;
- position: absolute;
- top: 10px;
- left: 10px;
- }
- .msg-list .msg-list-desc{
- -webkit-line-clamp: 2;
- line-height: 20px;
- font-size: 12px;
- }
- .msg-list .msg-list-time{
- margin-top: 10px;
- font-size: 14px;
- padding-top: 10px;
- padding-bottom: 10px;
- position: relative;
- overflow: hidden;
- }
- .msg-list .msg-list-time::before{
- content: "";
- position: absolute;
- top: 0;
- left: 15px;
- width: calc(100% - 30px);
- height: 1px;
- background-color: #eee;
- }
- .msg-list-time i{
- font-style: normal;
- float: right;
- margin-top: 1px;
- }
- .layui-laypage a, .layui-laypage span,
- .layui-laypage input, .layui-laypage button{
- background-color: transparent;
- }
- .image-slot{
- color: #ccc;
- }
- .image-slot i{
- font-size: 36px;
- padding-top: 20px;
- padding-bottom: 10px;
- }
- </style>
- </head>
- <body>
- <div id="space-content">
- <el-form action="@service{name:'system_message_list', page:'sys_msg.msg_list'}@" method="post" ref="obj" :model="obj">
- <div id="msgList" class="msg-list">
- <c:forEach items="${sysMsgList }" var="item">
- <c:if test="${item.jump_flag == 'true'}">
- <dl id="${item.smid}" style="cursor: pointer;" data-view="${item.isView}" onclick='@service{ name: "${item.name }", page: "${item.page }", nameTranslate: "false", pageTranslate: "false", show: "true", params: `${item.params}`}@'>
- </c:if>
- <c:if test="${item.jump_flag == 'false'}">
- <dl id="${item.smid}" data-view="${item.isView}">
- </c:if>
- <c:if test="${item.thumbnail != null}">
- <dt>
- <el-image src="${item.thumbnail}" >
- <div slot="error" class="image-slot">
- <i class="el-icon-picture-outline"></i>
- <p>图片加载失败</p>
- </div>
- </el-image>
- </dt>
- </c:if>
- <dd class="msg-list-title">
- <!-- 未读有i,已读没有i -->
- <i id="i_${item.smid}" v-if="!${item.isView}"></i>
- ${item.title}
- </dd>
- <dd class="msg-list-desc">
- ${item.desc}
- </dd>
- <dd class="msg-list-time">
- <span>${item.source}</span>
- <i>${item.create_time}</i>
- </dd>
- </dl>
- </c:forEach>
- <c:if test="${empty sysMsgList}">
- <div class="no-data"></div>
- </c:if>
- </div>
- </el-form>
- <app:appPage />
- </div>
- </body>
- <script type="text/javascript">
- space.vue = new Vue({
- el: space.appContent,
- data: function() {
- return {
- obj: {
- rowCountPerPage: "20"
- }
- }
- },
- methods: {
- clickFun: function(isView, name) {
- }
- },
- mounted: function() {
- $("#msgList").find("dl").on("click", function() {
-
- var view = $(this).attr("data-view");
- if(view == "true") {
- return;
- }
-
- var that = this;
- var id = $(this).attr("id");
- if(space.utils.isNull(id)) {
- console.error("未获取到消息ID")
- return;
- }
- space.utils.ajax({
- url: '@service{ name:`system_message_have_read` }@',
- data: {
- smid: id
- },
- dataType: 'json',
- callback: function(data) {
- if(data.code == "success") {
- $(that).attr("data-view", "true");
- $("#i_" + id).remove();
- }else{
- space.message.error(data.msg);
- }
- }
- });
- });
- }
- })
- </script>
- <script>
- function layReady(layIndex) {
-
- var readAllEle = document.createElement("i");
- readAllEle.className = 'spaceicon icon-quanbuyidu lay-window-icon';
- readAllEle.title = "全部已读";
- readAllEle.onclick = function() {
- var index = top.layer.confirm("标记所有消息为已读, 是否继续?", {
- anim: 5,
- isOutAnim: false,
- title: "提示",
- btn: ['确定', '取消'] //按钮
- }, function () {
- space.utils.ajax({
- url: '@service{ name:`system_message_all_have_read` }@',
- dataType: 'json',
- callback: function(data) {
- if(data.code == "success") {
- top.layer.close(index);
- space.forms.submit();
- }else{
- space.message.error(data.msg);
- }
- }
- });
- }, function () {
- });
-
- }
- var titleEle = top.$("#layui-layer" + layIndex).append(readAllEle);
- }
- </script>
- </html>
|