Commit d0e36c3a authored by jingnan's avatar jingnan 👀

首页增加我的消息

parent f0fda03e
......@@ -11,7 +11,10 @@
<!-- 左侧 -->
<div class="Left-pane">
<div v-for="(item, i) in cardList" :key="i" class="card" :class="item.title===activeTitle?'dee-active-card':''" @click="handClick(item.title)">
<div class="icon">
<el-badge v-if="item.title==='我的消息'&&messageInfo.unReadCount" :value="messageInfo.unReadCount" class="item">
<img :src="item.icon" alt="Icon">
</el-badge>
<div v-else class="icon">
<img :src="item.icon" alt="Icon">
</div>
<div class="title">
......@@ -27,7 +30,7 @@
@tabClick="tabClick"
>
<div :slot="activeTitle" style="height: 100%;">
<MyTask ref="myTask" />
<MyTask v-if="activeTitle!=='我的消息'" ref="myTask" />
</div>
<div slot="批量签审" style="height: 100%;">
<module-task-list ref="moduleTaskList" @goModuleTaskDetail="getTaskDetail" />
......@@ -77,8 +80,10 @@ import ApplyApp from './compontents/apply-app.vue'
import PersonalAssistant from './compontents/personal-assistant.vue'
import RightCenterPaneTop from './compontents/rightCenterPaneTop.vue'
import RightCenterPaneBottom from './compontents/rightCenterPaneBottom.vue'
import { get } from '@/utils/http'
export default {
name: 'NewHome',
components: { MyTask, ModuleTaskList, ApplyApp, PersonalAssistant, RightCenterPaneTop, RightCenterPaneBottom },
data() {
return {
......@@ -90,6 +95,10 @@ export default {
{
icon: '/icons/home/已办任务.png',
title: '已办任务'
},
{
icon: '/icons/home/message-icon.png',
title: '我的消息'
}
],
materialLists: [
......@@ -101,7 +110,8 @@ export default {
],
activeTitle: '我的待办',
userInfo: localStorage.getItem('user')
userInfo: localStorage.getItem('user'),
messageInfo: {}
}
},
computed: {
......@@ -115,6 +125,7 @@ export default {
watch: {},
created() {
// 初始化数据
this.getMessageInfo()
},
mounted() {
this.tabClick({ label: '单个签审' })
......@@ -134,6 +145,20 @@ export default {
this.$nextTick(() => {
if (title === '已办任务') {
this.$refs.myTask.getTasks(1, this.activeTitle)
} else if (title === '我的消息') {
this.$router.push({
path: `/dee-message/message/home`,
query: {
title: '我的消息'
}
})
this.$store.dispatch('menu/activeModel', {
appId: 'myMessage',
pageInfo: {
path: '/dee-message/message/home'
}
})
} else {
this.tabClick({ label: '单个签审' })
}
......@@ -146,6 +171,16 @@ export default {
path: `/task-detail-${this.id}`,
query: { id: this.id, insId: this.processInstanceId, title: this.title, showMenu: false }
})
},
getMessageInfo() {
const params = {
receiver: localStorage.getItem('userId')
}
get(`/Notify/findIsReadNum`, params).then(res => {
this.messageInfo = {
unReadCount: res.items.unReadCount
}
})
}
}
}
......
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