Commit 25f2196c authored by 徐一鸣's avatar 徐一鸣

消息通知fixed

parent 50031e21
......@@ -103,6 +103,7 @@ export default {
pageSize: 10,
currentPage: 1,
initDisabled: false,
allMeassageCount: 0,
}),
computed: {
...mapState({
......@@ -145,6 +146,8 @@ export default {
if (data.success === 1) {
if (unread) {
this.setUnreadMessageCount(data.data.total || 0);
} else {
this.allMeassageCount = data.data.total;
}
typeof callback === "function" && callback(data.data);
}
......@@ -201,7 +204,6 @@ export default {
this.initList(); // 刷新列表
if (!this.unread) {
console.log("刷新未读消息数");
this.getMessage({
unread: true,
});
......@@ -246,14 +248,27 @@ export default {
this.removeAction([item.id]);
},
readAll() {
if (this.unreadMessageCount === 0) {
this.$message.warning("暂无未读消息");
return;
}
this.readAction([]);
},
removeAll() {
if (this.allMeassageCount === 0) {
this.$message.warning("暂无消息通知");
return;
}
this.removeAction([]);
},
},
created() {
this.initList();
this.getMessage({
unread: false, // 初始化消息总数
});
},
};
</script>
......
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