mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 21:50:28 +08:00
26 lines
628 B
JavaScript
26 lines
628 B
JavaScript
|
|
Tea.context(function () {
|
||
|
|
this.updateAllRead = function () {
|
||
|
|
let that = this
|
||
|
|
teaweb.confirm("确定要设置所有的未读消息为已读吗?", function () {
|
||
|
|
that.$post("/messages/readAll")
|
||
|
|
.success(function () {
|
||
|
|
window.location = "/messages"
|
||
|
|
})
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
this.updatePageRead = function () {
|
||
|
|
let that = this
|
||
|
|
teaweb.confirm("确定要设置当前页的未读消息为已读吗?", function () {
|
||
|
|
let messageIds = []
|
||
|
|
that.messages.forEach(function (v) {
|
||
|
|
messageIds.push(v.id)
|
||
|
|
})
|
||
|
|
that.$post("/messages/readPage")
|
||
|
|
.params({
|
||
|
|
messageIds: messageIds
|
||
|
|
})
|
||
|
|
.refresh()
|
||
|
|
})
|
||
|
|
}
|
||
|
|
})
|