'123'
This commit is contained in:
parent
9681fd1a48
commit
ad34d7e219
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -9,6 +10,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.ruoyi.common.constant.WebsocketConst;
|
||||
import com.ruoyi.framework.websocket.WebSocketServer;
|
||||
import com.ruoyi.framework.websocket.WebSocketUsers;
|
||||
import com.ruoyi.system.domain.SysNoticeUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
@ -28,6 +30,8 @@ import com.ruoyi.common.enums.BusinessType;
|
|||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
|
||||
import javax.websocket.Session;
|
||||
|
||||
/**
|
||||
* 公告 信息操作处理
|
||||
*
|
||||
|
@ -79,7 +83,12 @@ public class SysNoticeController extends BaseController
|
|||
obj.put(WebsocketConst.MSG_ID, notice.getNoticeId());
|
||||
obj.put(WebsocketConst.MSG_TITLE, notice.getNoticeTitle());
|
||||
obj.put(WebsocketConst.MSG_CONTENT, notice.getNoticeContent());
|
||||
WebSocketUsers.sendMessageToUsersByText(obj.toString());
|
||||
if(!"3".equals(notice.getNoticeType())){//系统通知 或 通知公告
|
||||
WebSocketUsers.sendMessageToUsersByText(obj.toString());
|
||||
SysNoticeUser sysNoticeUser = new SysNoticeUser();
|
||||
sysNoticeUser.setNoticeId(notice.getNoticeId());
|
||||
sysNoticeUser.setUserId(notice.getNoticeId());
|
||||
}
|
||||
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.ruoyi.system.domain;
|
||||
|
||||
public class SysNoticeUser {
|
||||
private Long noticeId;
|
||||
private Long userId;
|
||||
|
||||
public Long getNoticeId() {
|
||||
return noticeId;
|
||||
}
|
||||
|
||||
public void setNoticeId(Long noticeId) {
|
||||
this.noticeId = noticeId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
<el-dropdown-menu slot="dropdown">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" style="width:100%">
|
||||
<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" :key="index">
|
||||
<el-link :underline="false" @click="clickNote(item)" :style="index==0?'': 'margin-top :15px'">{{item.noticeTitle}}</el-link>
|
||||
</el-dropdown-item>
|
||||
<el-link :underline="false" style="margin-top :15px" v-if="noticeData.length>5" type="primary">更多消息</el-link>
|
||||
|
@ -39,12 +39,6 @@
|
|||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
readFlag: '0'
|
||||
},
|
||||
noteTotal: '',
|
||||
// 公告
|
||||
sysLog: [],
|
||||
|
@ -67,12 +61,14 @@
|
|||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.noticeData = []
|
||||
this.sysLog = []
|
||||
this.noticeData = [];
|
||||
this.sysLog = [];
|
||||
navbarNoticelist(this.queryParams).then(res => {
|
||||
console.log(res[1])
|
||||
this.noticeData = res[1]?res[1]:[];
|
||||
this.sysLog = res[2]?res[2]:[];
|
||||
var noticeData = res[1]?res[1]:[];
|
||||
this.noticeData = noticeData.slice(0,5);
|
||||
|
||||
var sysLog = res[2]?res[2]:[];
|
||||
this.sysLog = sysLog.slice(0,5);
|
||||
|
||||
this.noteTotal = this.noticeData.length+this.sysLog.length;
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue