浏览代码

Merge remote-tracking branch 'origin/master'

shaun-sheep 4 年之前
父节点
当前提交
b1fc34a0bf
共有 2 个文件被更改,包括 11 次插入8 次删除
  1. 7 7
      src/layout/components/Navbar/MessageSever/msmq.ts
  2. 4 1
      src/store/modules/user.ts

+ 7 - 7
src/layout/components/Navbar/MessageSever/msmq.ts

@@ -20,17 +20,17 @@ class MSMQ {
     } catch (err) {
       return 0;
     }
-    if(data.ProjectId && projects.some((item) => {return item.id == data.ProjectId})) { //判断消息是否是当前用户拥有的项目
-      if(!data.UserList || (userId && data.UserList && data.UserList.includes(userId))){//判断消息接收人是否是当前用户
-        if(data.Module && data.Module == 'Model'){ //模型文件的消息触发模型文件列表刷新事件
+    if(data.projectId && projects.some((item) => {return item.id == data.projectId})) { //判断消息是否是当前用户拥有的项目
+      if(!data.userList || (userId && data.userList && data.userList.includes(userId))){//判断消息接收人是否是当前用户
+        if(data.module && data.module == 'Model'){ //模型文件的消息触发模型文件列表刷新事件
           Bus.$emit('modelStatusChange', data)
         }
-        if(data.Type != 'Refresh'){//消息列表可见消息(注类型为'Refresh'的消息用来驱动对应服务刷新,消息中心[用户]不可见)
+        if(data.type != 'Refresh'){//消息列表可见消息(注类型为'Refresh'的消息用来驱动对应服务刷新,消息中心[用户]不可见)
           Notification({ 
-            title: `${data.Title?data.Title:''}`, 
+            title: `${data.title?data.title:''}`, 
             dangerouslyUseHTMLString: true, 
-            message: `【${this.moduleMap[data.Module]?this.moduleMap[data.Module]:data.Module}】${data.Content?data.Content.Message?data.Content.Message:'':''}`,
-            type: this.msgTypeMap[data.Type]?this.msgTypeMap[data.Type]:'info'
+            message: `【${this.moduleMap[data.module]?this.moduleMap[data.module]:data.module}】${data.content?.message?data.content.message:''}`,
+            type: this.msgTypeMap[data.type]?this.msgTypeMap[data.type]:'info'
           })
           // Notification.info({ title: '消息',dangerouslyUseHTMLString: true, message: `项目编号:${data.projectId}<br>消息类型:${data.type}<br>描述信息:${data.description}<br>` })
           unreadNum++

+ 4 - 1
src/store/modules/user.ts

@@ -30,7 +30,10 @@ class User extends VuexModule implements IUserState {
     public userId = "06328a53c69a41bb8f5bb1a552c6e8d6";
     public group = "WD";// 集团
     public projectId = "Pj4403070003";// 深圳龙岗万达广场
-    public projects: any[] = [];// 用户项目列表
+    public projects: any[] = [{
+        id: "Pj4403070003",
+        name: "深圳龙岗万达广场"
+    }];// 用户项目列表
     public avatar = "";
     public introduction = "";
     public roles: string[] = [];