🐛 消息标记已读问题修复

This commit is contained in:
ronger 2021-04-27 21:12:16 +08:00
parent 2d844b1d8b
commit 739c180043

View File

@ -9,7 +9,8 @@
<el-col style="font-size: 12px;color: #7f828b;">{{ notification.createdTime }}</el-col> <el-col style="font-size: 12px;color: #7f828b;">{{ notification.createdTime }}</el-col>
</el-col> </el-col>
<el-col :xs="8" :sm="4" :xl="4" class="text-right" style="padding-right: 1rem;"> <el-col :xs="8" :sm="4" :xl="4" class="text-right" style="padding-right: 1rem;">
<el-link rel="nofollow" v-if="notification.hasRead === '0'" :underline="false" @click="read(notification.idNotification)"> <el-link rel="nofollow" v-if="notification.hasRead === '0'" :underline="false"
@click="read(notification.idNotification)">
<i class="el-icon-check"></i> 标记已读 <i class="el-icon-check"></i> 标记已读
</el-link> </el-link>
</el-col> </el-col>
@ -21,7 +22,8 @@
<el-col style="font-size: 12px;color: #7f828b;">{{ notification.createdTime }}</el-col> <el-col style="font-size: 12px;color: #7f828b;">{{ notification.createdTime }}</el-col>
</el-col> </el-col>
<el-col :xs="8" :sm="4" :xl="4" class="text-right" style="padding-right: 1rem;"> <el-col :xs="8" :sm="4" :xl="4" class="text-right" style="padding-right: 1rem;">
<el-link rel="nofollow" v-if="notification.hasRead === '0'" :underline="false" @click="read(notification.idNotification)"> <el-link rel="nofollow" v-if="notification.hasRead === '0'" :underline="false"
@click="read(notification.idNotification)">
<i class="el-icon-check"></i> 标记已读 <i class="el-icon-check"></i> 标记已读
</el-link> </el-link>
</el-col> </el-col>
@ -86,7 +88,7 @@
let _ts = this; let _ts = this;
this.$axios.$put('/api/notification/read/' + id).then(function () { this.$axios.$put('/api/notification/read/' + id).then(function () {
_ts.$store.commit('notification/updateState', true) _ts.$store.commit('notification/updateState', true)
_ts.currentChange(1); _ts.$store.dispatch('notification/fetchList', {page: 1})
}).catch(error => console.log(error)); }).catch(error => console.log(error));
}, },
onRouter(notification) { onRouter(notification) {