mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-07 05:13:11 +00:00
perf: 优化阅读消息列表机制
This commit is contained in:
parent
9f186f1e9c
commit
2bebad1112
@ -68,7 +68,7 @@
|
||||
"vue-resize-observer": "^2.0.16",
|
||||
"vue-router": "^3.6.5",
|
||||
"vue-template-compiler": "~2.6.14",
|
||||
"vue-virtual-scroll-list-hi": "^2.3.5-5",
|
||||
"vue-virtual-scroll-list-hi": "^2.3.5-7",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
|
||||
@ -170,10 +170,7 @@ export default {
|
||||
if (!this.windowActive) {
|
||||
return;
|
||||
}
|
||||
if (!this.$el) {
|
||||
return;
|
||||
}
|
||||
if (this.$el.parentNode.classList.contains('inactive')) {
|
||||
if (!this.$el?.parentNode.classList.contains('item-enter')) {
|
||||
return;
|
||||
}
|
||||
// 标记已读
|
||||
|
||||
@ -148,7 +148,7 @@
|
||||
<VirtualList
|
||||
ref="scroller"
|
||||
class="dialog-scroller scrollbar-virtual"
|
||||
item-inactive-class="inactive"
|
||||
active-prefix="item"
|
||||
:class="scrollerClass"
|
||||
:data-key="'id'"
|
||||
:data-sources="allMsgs"
|
||||
@ -974,9 +974,6 @@ export default {
|
||||
}))
|
||||
if (item.label === '{UNREAD}') {
|
||||
item.label = this.$L(`未读消息${unread}条`)
|
||||
item.is_unread = unread > 1
|
||||
} else {
|
||||
item.is_unread = false
|
||||
}
|
||||
return item
|
||||
},
|
||||
@ -1217,8 +1214,13 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
positionMsg(msg) {
|
||||
if (msg && msg.is_unread === true) {
|
||||
positionMsg() {
|
||||
const {unread, position_msgs} = this.dialogData
|
||||
if (!$A.isArray(position_msgs) || unread < 2) {
|
||||
return
|
||||
}
|
||||
const msg = position_msgs.find(item => item.label === '{UNREAD}')
|
||||
if (msg) {
|
||||
this.unreadMsgId = msg.msg_id
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,7 +432,7 @@
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.inactive {
|
||||
.item-leave {
|
||||
pre, code {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user