提交 a7da8ebc 编写于 作者: lyf's avatar lyf

修改vux

上级 8756edd3
......@@ -80,6 +80,7 @@ const main = {
state.showAdvice = obj;
},
updateNoticeList(state, obj) {
console.log(11111);
state.noticeList = obj;
},
updateIsSuperAdmin(state, obj) {
......
......@@ -37,8 +37,9 @@ const socket = {
});
socketClient.on('diagnose_call_push_event', (socket) => {
console.log('diagnose_call_push_event---', socket);
console.log('context.state.noticeList',context.state.noticeList)
const l = context.state.noticeList;
console.log('context.state.noticeList', window._VM.$store);
const l = window._VM.$store.state.main.noticeList;
if (l.length >= 5) {
l.shift();
}
......@@ -47,15 +48,16 @@ const socket = {
context.commit('main/updateNoticeList', l, { root: true });
console.log('n--------', n);
const { path } = window._VM.$route;
const operateUserId = context.state.soketQuest.operateUserId
? context.state.soketQuest.operateUserId
const operateUserId = window._VM.$store.state.main.soketQuest.operateUserId
? window._VM.$store.state.main.soketQuest.operateUserId
: '';
if (
path &&
String(path).indexOf('workbench') > -1 &&
n.operateUserId == operateUserId
) {
context.commit('socket/SET_NOTIFY', context, n, { root: true });
console.log(11111)
context.commit('SET_NOTIFY', n);
}
});
socketClient.on('ping', function () {
......@@ -85,7 +87,7 @@ const socket = {
window.socketClient = payload;
state.socketClient = payload;
},
SET_NOTIFY: (state, context, payload) => {
SET_NOTIFY: (state, payload) => {
console.log('--payload', payload);
const doms = document.getElementsByClassName('el-notification');
if (doms.length >= 5) return;
......@@ -119,7 +121,7 @@ const socket = {
});
return false;
}
context.dispatch('gotoInquiry', payload);
window._VM.$store.dispatch('main/gotoInquiry', payload);
cn.close();
},
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册