Commit 77558614 authored by dragondean@qq.com's avatar dragondean@qq.com

角标优化

parent 0e7c5761
......@@ -70,3 +70,10 @@ export function taskTodoCount(){
}
)
}
// 用户角标数据
export function userMark(){
return request({
url:'/system/user/profile/user-mark',
})
}
......@@ -20,7 +20,7 @@
<el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unreadMessage" @click="notRead"></el-image>
</el-badge>
<el-badge :value="notDownload ? notDownload : '' " class="right-menu-item badge">
<el-badge :value="downloadCnt ? downloadCnt : '' " class="right-menu-item badge">
<el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unDownload" @click="handleDownload"></el-image>
</el-badge>
......@@ -106,7 +106,7 @@ export default {
if(process.env.NODE_ENV != 'development'){
setInterval(() => {
this.updateMessage()
}, 10000)
}, 20000)
}
this.updateMessage()
......@@ -148,7 +148,10 @@ export default {
},
matterNum(){
return this.$store.state.user.matterNum
}
},
downloadCnt(){
return this.$store.state.user.download
}
},
watch:{
lang(val){
......@@ -162,8 +165,7 @@ export default {
this.$router.push('/system/download')
},
updateMessage(){
this.$store.dispatch('getNotMessage');
this.$store.dispatch('getToDoList');
this.$store.dispatch('getUserBadge');
},
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
......
import {login, logout, getInfo, socialLogin, socialLogin2} from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import {getNotReadInternalMessageTotal,} from '@/api/system/internalMessage'
import {taskTodoCount} from "@/api/bpm/task";
import {taskTodoCount, userMark} from "@/api/bpm/task";
const user = {
state: {
......@@ -12,7 +12,8 @@ const user = {
roles: [],
permissions: [],
notMessage:0,
matterNum:0
matterNum:0,
download: 0
},
mutations: {
......@@ -39,6 +40,9 @@ const user = {
},
SET_TODO:(state, matterNum) => {
state.matterNum = matterNum;
},
SET_DOWNLOAD(state, cnt){
state.download = cnt;
}
},
......@@ -178,6 +182,19 @@ const user = {
reject(err)
})
})
},
// 获取用户角标,包括未读消息、待办事项,下载数据
getUserBadge({commit}){
return new Promise((resolve,reject) =>{
userMark().then(r => {
commit('SET_TODO',r.data.todoCount)
commit('SET_UNREAD',r.data.notReadInternalMessageCount)
commit('SET_DOWNLOAD',r.data.fileWaitDownCount + r.data.fileMakeQueuingCount + r.data.fileMakeProgressCount)
resolve()
}).catch(err => {
reject(err)
})
})
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment