Commit d0e36c3a authored by jingnan's avatar jingnan 👀

首页增加我的消息

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