12345678910111213141516171819202122 |
- import { Notification } from 'element-ui';
- import Bus from '@/utils/bus.js'
- const MSMQ = {
- handleMsg (message, projects, unreadNum ) {
- let data
- try {
- data = JSON.parse(message.body)
- } catch (err) {}
- // if(projects.some((item) => {return item.id == data.projectId})) { //判断消息是否是当前用户拥有的项目
- unreadNum++
- if(message.headers.destination == '/topic/model.manage'){ //模型文件的消息触发模型文件列表刷新事件
- Bus.$emit('modelStatusChange', data)
- }
- // Notification.info({ title: '消息',dangerouslyUseHTMLString: true, message: `项目编号:${data.projectId}<br>消息类型:${data.type}<br>描述信息:${data.description}<br>` })
- Notification.info({ title: '消息', dangerouslyUseHTMLString: true, message: `${JSON.stringify(data)}` })
- return unreadNum
- // }
- }
- }
- export default MSMQ
|