This commit is contained in:
hanjian
2024-09-08 20:32:09 +08:00
parent 2874b1c139
commit de770f0b33
7 changed files with 88 additions and 16 deletions

View File

@@ -35,6 +35,30 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dialog
title="消息通知"
:visible.sync="msgVisible"
width="40%">
<el-table
:data="msgTableData"
border
style="width: 100%">
<el-table-column
prop="name"
label="消息通知类型">
</el-table-column>
<el-table-column
prop="count"
label="消息通知数量">
</el-table-column>
<el-table-column label="操作" width="100" >
<template slot-scope="scope">
<el-button type="text"@click="handleToMsgView(scope.row)">前往查看</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</div>
</template>
@@ -46,6 +70,7 @@ import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import Search from '@/components/HeaderSearch'
import { getUserMsgCount } from '@/api/my_business/workflow'
export default {
components: {
@@ -82,6 +107,12 @@ export default {
return this.$store.state.user.unreadMsgNumber ? this.$store.state.user.unreadMsgNumber : 0
},
},
data() {
return {
msgVisible: false,
msgTableData: []
}
},
methods: {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
@@ -99,8 +130,30 @@ export default {
},
// 跳转到消息中心
toMyCartPage() {
this.$router.push({ path: '/message', query: {'states':'1'} })
getUserMsgCount().then(res => {
this.msgTableData = [];
let msgItem = {};
msgItem['type'] = 'msg';
msgItem['name'] = '消息中心数量';
msgItem['count'] = res.msgCount;
let taskItem = {};
taskItem['type'] = 'task';
taskItem['name'] = '代办消息数量';
taskItem['count'] = res.taskCount;
this.msgTableData.push(msgItem);
this.msgTableData.push(taskItem);
}).catch(error => {
})
this.msgVisible = true;
},
handleToMsgView(row){
this.msgVisible = false;
if(row.type === 'msg'){
this.$router.push({ path: '/message', query: {'states':'1'} })
} else {
this.$router.push({ path: '/workstuff/dispose'})
}
}
}
}
</script>