消息通知-添加详情页及更多展示页
This commit is contained in:
parent
62ebf974a4
commit
3985b78ba3
|
@ -7,6 +7,8 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.ruoyi.common.constant.WebsocketConst;
|
import com.ruoyi.common.constant.WebsocketConst;
|
||||||
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.framework.websocket.WebSocket;
|
import com.ruoyi.framework.websocket.WebSocket;
|
||||||
import com.ruoyi.system.domain.NoticeUserSelect;
|
import com.ruoyi.system.domain.NoticeUserSelect;
|
||||||
import com.ruoyi.system.domain.SysNoticeUser;
|
import com.ruoyi.system.domain.SysNoticeUser;
|
||||||
|
@ -77,8 +79,8 @@ public class SysNoticeController extends BaseController
|
||||||
notice.setCreateBy(getUsername());
|
notice.setCreateBy(getUsername());
|
||||||
noticeService.insertNotice(notice);
|
noticeService.insertNotice(notice);
|
||||||
//推送消息插入中间表
|
//推送消息插入中间表
|
||||||
String userName = getLoginUser().getUsername();//当前登陆者
|
LoginUser loginUser = getLoginUser();//当前登陆者
|
||||||
insertNoticeUser(userName,notice,noticeService,null);
|
insertNoticeUser(loginUser,notice,noticeService,null);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return error("系统异常");
|
return error("系统异常");
|
||||||
}
|
}
|
||||||
|
@ -113,19 +115,46 @@ public class SysNoticeController extends BaseController
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/navbarNoticelist")
|
@GetMapping("/navbarNoticelist")
|
||||||
public Map<String, List<SysNotice>> navbarNoticelist()
|
public Map<String, List<SysNoticeUser>> navbarNoticelist()
|
||||||
{
|
{
|
||||||
String userName = getLoginUser().getUsername();//当前登陆者
|
String userName = getLoginUser().getUsername();//当前登陆者
|
||||||
List<SysNotice> list = noticeService.navbarNoticelist(userName);
|
List<SysNoticeUser> list = noticeService.navbarNoticelist(userName);
|
||||||
Map<String, List<SysNotice>> groupedByNoticeType = list.stream()
|
Map<String, List<SysNoticeUser>> groupedByNoticeType = list.stream()
|
||||||
.collect(Collectors.groupingBy(SysNotice::getNoticeType));
|
.collect(Collectors.groupingBy(SysNoticeUser::getNoticeType));
|
||||||
for(String key:groupedByNoticeType.keySet()){
|
for(String key:groupedByNoticeType.keySet()){
|
||||||
List<SysNotice> lt = groupedByNoticeType.get(key);
|
List<SysNoticeUser> lt = groupedByNoticeType.get(key);
|
||||||
lt.sort((t1, t2) -> t2.getCreateTime().compareTo(t1.getCreateTime()));
|
lt.sort((t1, t2) -> t2.getSendTime().compareTo(t1.getSendTime()));
|
||||||
}
|
}
|
||||||
return groupedByNoticeType;
|
return groupedByNoticeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航面板 消息通知-更多
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/navbarNoticeMorelist")
|
||||||
|
public List<Map<String, Object>> navbarNoticeMorelist(SysNoticeUser sysNoticeUser)
|
||||||
|
{
|
||||||
|
String userName = getLoginUser().getUsername();//当前登陆者
|
||||||
|
String noticeType = sysNoticeUser.getNoticeType();//消息类型
|
||||||
|
List<SysNoticeUser> list = noticeService.navbarNoticeMorelist(userName,noticeType);
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
|
||||||
|
|
||||||
|
Map<String, List<SysNoticeUser>> groupedByNoticeType = list.stream()
|
||||||
|
.collect(Collectors.groupingBy(SysNoticeUser::getSendTimeFormat));
|
||||||
|
for(String key:groupedByNoticeType.keySet()){
|
||||||
|
List<SysNoticeUser> lt = groupedByNoticeType.get(key);
|
||||||
|
lt.sort((t1, t2) -> t2.getSendTime().compareTo(t1.getSendTime()));
|
||||||
|
map = new HashMap<>();
|
||||||
|
map.put("date",key);
|
||||||
|
map.put("data",lt);
|
||||||
|
listMap.add(map);
|
||||||
|
}
|
||||||
|
return listMap;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导航面板 消息通知 获取详细信息
|
* 导航面板 消息通知 获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ -149,11 +178,11 @@ public class SysNoticeController extends BaseController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送消息插入中间表
|
* 推送消息插入中间表
|
||||||
* @param userName 发送对象排除自身
|
* @param loginUser 发送对象排除自身
|
||||||
* @param notice 发送信息对象
|
* @param notice 发送信息对象
|
||||||
* @param noticeService 接口
|
* @param noticeService 接口
|
||||||
*/
|
*/
|
||||||
public static void insertNoticeUser(String userName,SysNotice notice,ISysNoticeService noticeService,List<String> userNames) throws IOException {
|
public static void insertNoticeUser(LoginUser loginUser,SysNotice notice,ISysNoticeService noticeService,List<String> userNames) throws IOException {
|
||||||
List<SysNoticeUser> sysNoticeUsers = new ArrayList<SysNoticeUser>();
|
List<SysNoticeUser> sysNoticeUsers = new ArrayList<SysNoticeUser>();
|
||||||
|
|
||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
|
@ -166,12 +195,15 @@ public class SysNoticeController extends BaseController
|
||||||
|
|
||||||
SysNoticeUser sysNoticeUser = null;
|
SysNoticeUser sysNoticeUser = null;
|
||||||
CopyOnWriteArraySet<WebSocket> webSocketSet = WebSocket.getWebSocketSet();//获取在线用户
|
CopyOnWriteArraySet<WebSocket> webSocketSet = WebSocket.getWebSocketSet();//获取在线用户
|
||||||
|
Date sendTime = DateUtils.getNowDate();
|
||||||
for (WebSocket item : webSocketSet) {
|
for (WebSocket item : webSocketSet) {
|
||||||
String username = item.sid;
|
String username = item.sid;
|
||||||
if(!username.equals(userName)){
|
if(!username.equals(loginUser.getUsername())){
|
||||||
sysNoticeUser = new SysNoticeUser();
|
sysNoticeUser = new SysNoticeUser();
|
||||||
sysNoticeUser.setNoticeId(notice.getNoticeId());
|
sysNoticeUser.setNoticeId(notice.getNoticeId());
|
||||||
sysNoticeUser.setUserId(username);
|
sysNoticeUser.setUserId(username);
|
||||||
|
sysNoticeUser.setSendUser(loginUser.getUser().getNickName());
|
||||||
|
sysNoticeUser.setSendTime(sendTime);
|
||||||
sysNoticeUsers.add(sysNoticeUser);
|
sysNoticeUsers.add(sysNoticeUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,12 +217,15 @@ public class SysNoticeController extends BaseController
|
||||||
}
|
}
|
||||||
SysNoticeUser sysNoticeUser = null;
|
SysNoticeUser sysNoticeUser = null;
|
||||||
CopyOnWriteArraySet<WebSocket> webSocketSet = WebSocket.getWebSocketSet();//获取在线用户
|
CopyOnWriteArraySet<WebSocket> webSocketSet = WebSocket.getWebSocketSet();//获取在线用户
|
||||||
|
Date sendTime = DateUtils.getNowDate();
|
||||||
for (WebSocket item : webSocketSet) {
|
for (WebSocket item : webSocketSet) {
|
||||||
String username = item.sid;
|
String username = item.sid;
|
||||||
if(userNames.contains(username)){
|
if(userNames.contains(username)){
|
||||||
sysNoticeUser = new SysNoticeUser();
|
sysNoticeUser = new SysNoticeUser();
|
||||||
sysNoticeUser.setNoticeId(notice.getNoticeId());
|
sysNoticeUser.setNoticeId(notice.getNoticeId());
|
||||||
sysNoticeUser.setUserId(username);
|
sysNoticeUser.setUserId(username);
|
||||||
|
sysNoticeUser.setSendUser(loginUser.getUser().getNickName());
|
||||||
|
sysNoticeUser.setSendTime(sendTime);
|
||||||
sysNoticeUsers.add(sysNoticeUser);
|
sysNoticeUsers.add(sysNoticeUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,19 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class SysNoticeUser {
|
public class SysNoticeUser {
|
||||||
private Long noticeId;
|
private Long noticeId;
|
||||||
|
|
||||||
|
private String noticeTitle;
|
||||||
|
private String noticeType;
|
||||||
private String userId;
|
private String userId;
|
||||||
private String isRead;
|
private String isRead;
|
||||||
|
|
||||||
|
private String sendUser;
|
||||||
|
private Date sendTime;
|
||||||
|
|
||||||
public Long getNoticeId() {
|
public Long getNoticeId() {
|
||||||
return noticeId;
|
return noticeId;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +26,14 @@ public class SysNoticeUser {
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNoticeType() { return noticeType; }
|
||||||
|
|
||||||
|
public void setNoticeType(String noticeType) { this.noticeType = noticeType; }
|
||||||
|
|
||||||
|
public String getNoticeTitle() { return noticeTitle; }
|
||||||
|
|
||||||
|
public void setNoticeTitle(String noticeTitle) { this.noticeTitle = noticeTitle; }
|
||||||
|
|
||||||
public void setUserId(String userId) {
|
public void setUserId(String userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
@ -24,4 +41,14 @@ public class SysNoticeUser {
|
||||||
public String getIsRead() { return isRead; }
|
public String getIsRead() { return isRead; }
|
||||||
|
|
||||||
public void setIsRead(String isRead) { this.isRead = isRead; }
|
public void setIsRead(String isRead) { this.isRead = isRead; }
|
||||||
|
|
||||||
|
public String getSendUser() { return sendUser; }
|
||||||
|
|
||||||
|
public void setSendUser(String sendUser) { this.sendUser = sendUser; }
|
||||||
|
|
||||||
|
public Date getSendTime() { return sendTime; }
|
||||||
|
|
||||||
|
public void setSendTime(Date sendTime) { this.sendTime = sendTime; }
|
||||||
|
|
||||||
|
public String getSendTimeFormat() { return new SimpleDateFormat("yyyy-MM-dd").format(sendTime); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import com.ruoyi.system.domain.NoticeUserSelect;
|
import com.ruoyi.system.domain.NoticeUserSelect;
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
import com.ruoyi.system.domain.SysNoticeUser;
|
import com.ruoyi.system.domain.SysNoticeUser;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告表 数据层
|
* 通知公告表 数据层
|
||||||
|
@ -65,7 +66,15 @@ public interface SysNoticeMapper
|
||||||
* 消息推送信息获取
|
* 消息推送信息获取
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysNotice> navbarNoticelist(String userName);
|
List<SysNoticeUser> navbarNoticelist(String userName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航面板 消息通知-更多
|
||||||
|
* @param userName
|
||||||
|
* @param noticeType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysNoticeUser> navbarNoticeMorelist(@Param("userName") String userName,@Param("noticeType") String noticeType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量插入消息-用户 中间表
|
* 批量插入消息-用户 中间表
|
||||||
|
|
|
@ -65,7 +65,15 @@ public interface ISysNoticeService
|
||||||
* 导航面板 消息通知
|
* 导航面板 消息通知
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysNotice> navbarNoticelist(String userName);
|
List<SysNoticeUser> navbarNoticelist(String userName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航面板 消息通知-更多
|
||||||
|
* @param userName
|
||||||
|
* @param noticeType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysNoticeUser> navbarNoticeMorelist(String userName, String noticeType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量插入消息-用户 中间表
|
* 批量插入消息-用户 中间表
|
||||||
|
|
|
@ -120,10 +120,21 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysNotice> navbarNoticelist(String userName) {
|
public List<SysNoticeUser> navbarNoticelist(String userName) {
|
||||||
return noticeMapper.navbarNoticelist(userName);
|
return noticeMapper.navbarNoticelist(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导航面板 消息通知-更多
|
||||||
|
* @param userName
|
||||||
|
* @param noticeType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysNoticeUser> navbarNoticeMorelist(String userName, String noticeType) {
|
||||||
|
return noticeMapper.navbarNoticeMorelist(userName,noticeType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量插入消息-用户 中间表
|
* 批量插入消息-用户 中间表
|
||||||
* @param sysNoticeUsers
|
* @param sysNoticeUsers
|
||||||
|
|
|
@ -86,8 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="navbarNoticelist" resultMap="SysNoticeResult">
|
<select id="navbarNoticelist" resultType="SysNoticeUser">
|
||||||
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
|
select a.notice_id noticeId, a.notice_title noticeTitle, a.notice_type noticeType,b.sendUser,b.sendTime
|
||||||
from sys_notice a
|
from sys_notice a
|
||||||
inner join sys_user_notice b on a.notice_id = b.noticeId
|
inner join sys_user_notice b on a.notice_id = b.noticeId
|
||||||
<where>
|
<where>
|
||||||
|
@ -98,13 +98,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="navbarNoticeMorelist" resultType="SysNoticeUser">
|
||||||
|
select a.notice_id noticeId, a.notice_title noticeTitle, a.notice_type noticeType,b.sendUser,b.sendTime,b.isRead
|
||||||
|
from sys_notice a
|
||||||
|
inner join sys_user_notice b on a.notice_id = b.noticeId
|
||||||
|
<where>
|
||||||
|
and b.userId = #{userName}
|
||||||
|
and a.notice_type = #{noticeType}
|
||||||
|
and CONVERT(date, a.create_time) = CONVERT(date, GETDATE())
|
||||||
|
and a.status = '0'
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertNoticeUserBatch">
|
<insert id="insertNoticeUserBatch">
|
||||||
insert into sys_user_notice(noticeId,userId)
|
insert into sys_user_notice(noticeId,userId,sendUser,sendTime)
|
||||||
values
|
values
|
||||||
<foreach collection="list" item="item" index="index" separator=",">
|
<foreach collection="list" item="item" index="index" separator=",">
|
||||||
(
|
(
|
||||||
#{item.noticeId,jdbcType=INTEGER},
|
#{item.noticeId,jdbcType=INTEGER},
|
||||||
#{item.userId,jdbcType=VARCHAR}
|
#{item.userId,jdbcType=VARCHAR},
|
||||||
|
#{item.sendUser,jdbcType=VARCHAR},
|
||||||
|
#{item.sendTime,jdbcType=TIMESTAMP}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
@ -52,6 +52,15 @@ export function navbarNoticelist(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导航面板 消息通知-更多
|
||||||
|
export function navbarNoticeMorelist(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/navbarNoticeMorelist',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 导航面板 消息通知 获取详细信息
|
// 导航面板 消息通知 获取详细信息
|
||||||
export function getNavbarNotice(noticeId) {
|
export function getNavbarNotice(noticeId) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -9,28 +9,25 @@
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-tabs v-model="activeName" @tab-click="handleClick" style="width:100%">
|
<el-tabs v-model="activeName" @tab-click="handleClick" style="width:100%">
|
||||||
<el-tab-pane label="系统通知" name="first">
|
<el-tab-pane label="系统通知" name="first">
|
||||||
<el-dropdown-item v-for="(item,index) in noticeData" :key="index">
|
<el-dropdown-item v-for="(item,index) in noticeData.slice(0,5)" :key="index">
|
||||||
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :15px'">{{item.noticeTitle}}</el-link>
|
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :10px'">{{item.noticeTitle}}</el-link>
|
||||||
|
<el-link :underline="false" style="color:#AAAAAA">{{parseTime(item.sendTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</el-link>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<!--
|
<el-link :underline="false" @click="moreNote('1')" style="margin-top :10px" type="primary">更多消息</el-link>
|
||||||
<el-link :underline="false" style="margin-top :15px" v-if="noticeData.length>5" type="primary">更多消息</el-link>
|
|
||||||
-->
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="系统公告" name="second">
|
<el-tab-pane label="系统公告" name="second">
|
||||||
<el-dropdown-item v-for="(item,index) in sysLog" :key="index">
|
<el-dropdown-item v-for="(item,index) in sysLog.slice(0,5)" :key="index">
|
||||||
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :15px'">{{item.noticeTitle}}</el-link>
|
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :10px'">{{item.noticeTitle}}</el-link>
|
||||||
|
<el-link :underline="false" style="color:#AAAAAA">{{parseTime(item.sendTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</el-link>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<!--
|
<el-link :underline="false" @click="moreNote('2')" style="margin-top :10px" type="primary">更多消息</el-link>
|
||||||
<el-link v-if="sysLog.length>5" type="primary">更多消息</el-link>
|
|
||||||
-->
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="业务通知" name="third">
|
<el-tab-pane label="业务通知" name="third">
|
||||||
<el-dropdown-item v-for="(item,index) in businessData" :key="index">
|
<el-dropdown-item v-for="(item,index) in businessData.slice(0,5)" :key="index">
|
||||||
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :15px'">{{item.noticeTitle}}</el-link>
|
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :10px'">{{item.noticeTitle}}</el-link>
|
||||||
|
<el-link :underline="false" style="color:#AAAAAA">{{parseTime(item.sendTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</el-link>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<!--
|
<el-link :underline="false" @click="moreNote('3')" style="margin-top :10px" type="primary">更多消息</el-link>
|
||||||
<el-link :underline="false" style="margin-top :15px" v-if="noticeData.length>5" type="primary">更多消息</el-link>
|
|
||||||
-->
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
|
@ -62,10 +59,37 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog class="noteMore" :title="noteMoreTitle" :visible.sync="noteMoreVisible" width="780px" append-to-body>
|
||||||
|
<div class="block">
|
||||||
|
<el-timeline>
|
||||||
|
<el-timeline-item :timestamp="item.date" placement="top" v-for="(item,index) in noteMore" :key="index">
|
||||||
|
<el-card v-for="(item,index) in item.data" :key="index" :style="index==0?'': 'margin-top :10px'">
|
||||||
|
<h3>{{item.noticeTitle}}</h3>
|
||||||
|
<p>{{item.sendUser}} 提交于 {{parseTime(item.sendTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</p>
|
||||||
|
<div style="width:100%;height:1px;margin:0px auto;padding:0px;overflow:hidden;background-color: #c0c4ccab"></div>
|
||||||
|
<el-link :underline="false" @click="clickNote(item)" style="color:#46a6ff;margin-top :10px">详情</el-link>
|
||||||
|
</el-card>
|
||||||
|
</el-timeline-item>
|
||||||
|
</el-timeline>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
<style>
|
||||||
|
/* 弹窗设置 */
|
||||||
|
.noteMore .el-dialog__body {
|
||||||
|
padding: 10px 10px;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 14px;
|
||||||
|
word-break: break-all;
|
||||||
|
overflow-y: auto; /* 自动显示垂直滚动条 */
|
||||||
|
height: 600px;
|
||||||
|
max-height: 680px; /* 设置最大高度,根据需要调整 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { navbarNoticelist } from '@/api/system/notice';
|
import { navbarNoticelist, navbarNoticeMorelist } from '@/api/system/notice';
|
||||||
import { getNavbarNotice} from "@/api/system/notice";
|
import { getNavbarNotice} from "@/api/system/notice";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -81,14 +105,23 @@
|
||||||
noticeData: [],
|
noticeData: [],
|
||||||
// 业务消息
|
// 业务消息
|
||||||
businessData: [],
|
businessData: [],
|
||||||
|
|
||||||
|
// 消息-更多数据
|
||||||
|
noteMore: [],
|
||||||
|
|
||||||
websock: null,
|
websock: null,
|
||||||
lockReconnect: false,
|
lockReconnect: false,
|
||||||
|
|
||||||
//弹窗设置
|
//弹窗设置
|
||||||
noteTitle: '',
|
noteTitle: '',
|
||||||
noteVisible: false,
|
noteVisible: false,
|
||||||
|
|
||||||
|
noteMoreTitle: '',
|
||||||
|
noteMoreVisible: false,
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
//查询参数
|
||||||
|
queryParams:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -107,14 +140,11 @@
|
||||||
this.noticeData = [];
|
this.noticeData = [];
|
||||||
this.sysLog = [];
|
this.sysLog = [];
|
||||||
navbarNoticelist(this.queryParams).then(res => {
|
navbarNoticelist(this.queryParams).then(res => {
|
||||||
var noticeData = res[1]?res[1]:[];
|
this.noticeData = res[1]?res[1]:[];
|
||||||
this.noticeData = noticeData.slice(0,5);
|
|
||||||
|
|
||||||
var sysLog = res[2]?res[2]:[];
|
this.sysLog = res[2]?res[2]:[];
|
||||||
this.sysLog = sysLog.slice(0,5);
|
|
||||||
|
|
||||||
var businessData = res[3]?res[3]:[];
|
this.businessData = res[3]?res[3]:[];
|
||||||
this.businessData = businessData.slice(0,5);
|
|
||||||
|
|
||||||
this.noteTotal = this.noticeData.length+this.sysLog.length+this.businessData.length;
|
this.noteTotal = this.noticeData.length+this.sysLog.length+this.businessData.length;
|
||||||
})
|
})
|
||||||
|
@ -130,6 +160,17 @@
|
||||||
this.getList()
|
this.getList()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 显示更多消息 */
|
||||||
|
moreNote(noticeType){
|
||||||
|
this.queryParams.noticeType = noticeType;
|
||||||
|
navbarNoticeMorelist(this.queryParams).then(response => {
|
||||||
|
console.log(response)
|
||||||
|
this.noteMoreTitle = noticeType=='1'?"系统通知消息":noticeType=='2'?"系统公告消息":"业务通知消息";
|
||||||
|
this.noteMoreVisible = true
|
||||||
|
this.noteMore = response
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
initWebSocket() {
|
initWebSocket() {
|
||||||
var userName = this.$store.state.user.name;
|
var userName = this.$store.state.user.name;
|
||||||
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
|
|
Loading…
Reference in New Issue