mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:同步2.1版本
This commit is contained in:
@@ -1 +1,47 @@
|
||||
export default {}
|
||||
import { FlowOperationController } from '@/api/flowController.js';
|
||||
|
||||
// 催办消息下拉个数
|
||||
const MESSAGE_SHOW_COUNT = 10;
|
||||
// 催办消息轮询间隔
|
||||
const MESSAGE_TIMER_INTERVAL = 10000;
|
||||
|
||||
// 获得消息列表数据
|
||||
function loadMessage (context, owner) {
|
||||
let params = {
|
||||
pageParam: {
|
||||
pageSize: MESSAGE_SHOW_COUNT,
|
||||
pageNum: 1
|
||||
}
|
||||
}
|
||||
FlowOperationController.listRemindingTask(owner, params, null, {
|
||||
showMask: false,
|
||||
showError: false
|
||||
}).then(res => {
|
||||
context.commit('setMessageList', res.data);
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
startMessage: (context, owner) => {
|
||||
if (context.state.messageTimer != null) {
|
||||
clearInterval(context.state.messageTimer);
|
||||
}
|
||||
|
||||
let timer = setInterval(() => {
|
||||
loadMessage(context, owner);
|
||||
}, MESSAGE_TIMER_INTERVAL);
|
||||
context.commit('setMessageTimer', timer);
|
||||
loadMessage(context, owner);
|
||||
},
|
||||
stopMessage: (context) => {
|
||||
if (context.state.messageTimer != null) {
|
||||
clearInterval(context.state.messageTimer);
|
||||
}
|
||||
context.commit('setMessageTimer', null);
|
||||
},
|
||||
reloadMessage: (context, owner) => {
|
||||
loadMessage(context, owner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,5 +82,8 @@ export default {
|
||||
},
|
||||
getCurrentColumnId: (state) => {
|
||||
return state.currentColumnId;
|
||||
},
|
||||
getMessageList: (state) => {
|
||||
return state.messageList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,5 +157,11 @@ export default {
|
||||
setCurrentColumnId: (state, columnId) => {
|
||||
if (setObjectToSessionStorage('currentColumnId', columnId)) state.currentColumnId = columnId;
|
||||
if (setObjectToSessionStorage('currentMenuId', null)) state.currentMenuId = null;
|
||||
},
|
||||
setMessageTimer: (state, timerHandler) => {
|
||||
state.messageTimer = timerHandler;
|
||||
},
|
||||
setMessageList: (state, messageList) => {
|
||||
state.messageList = messageList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +25,8 @@ export default {
|
||||
// 当前菜单
|
||||
currentMenuId: getObjectFromSessionStorage('currentMenuId', undefined),
|
||||
// 当前栏目
|
||||
currentColumnId: getObjectFromSessionStorage('currentColumnId', undefined)
|
||||
currentColumnId: getObjectFromSessionStorage('currentColumnId', undefined),
|
||||
// 消息列表
|
||||
messageTimeer: null,
|
||||
messageList: []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user