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-resize-observer": "^2.0.16",
|
||||||
"vue-router": "^3.6.5",
|
"vue-router": "^3.6.5",
|
||||||
"vue-template-compiler": "~2.6.14",
|
"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",
|
"vuedraggable": "^2.24.3",
|
||||||
"vuex": "^3.6.2"
|
"vuex": "^3.6.2"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -170,10 +170,7 @@ export default {
|
|||||||
if (!this.windowActive) {
|
if (!this.windowActive) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.$el) {
|
if (!this.$el?.parentNode.classList.contains('item-enter')) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.$el.parentNode.classList.contains('inactive')) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 标记已读
|
// 标记已读
|
||||||
|
|||||||
@ -148,7 +148,7 @@
|
|||||||
<VirtualList
|
<VirtualList
|
||||||
ref="scroller"
|
ref="scroller"
|
||||||
class="dialog-scroller scrollbar-virtual"
|
class="dialog-scroller scrollbar-virtual"
|
||||||
item-inactive-class="inactive"
|
active-prefix="item"
|
||||||
:class="scrollerClass"
|
:class="scrollerClass"
|
||||||
:data-key="'id'"
|
:data-key="'id'"
|
||||||
:data-sources="allMsgs"
|
:data-sources="allMsgs"
|
||||||
@ -974,9 +974,6 @@ export default {
|
|||||||
}))
|
}))
|
||||||
if (item.label === '{UNREAD}') {
|
if (item.label === '{UNREAD}') {
|
||||||
item.label = this.$L(`未读消息${unread}条`)
|
item.label = this.$L(`未读消息${unread}条`)
|
||||||
item.is_unread = unread > 1
|
|
||||||
} else {
|
|
||||||
item.is_unread = false
|
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
},
|
},
|
||||||
@ -1217,8 +1214,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
positionMsg(msg) {
|
positionMsg() {
|
||||||
if (msg && msg.is_unread === true) {
|
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
|
this.unreadMsgId = msg.msg_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -432,7 +432,7 @@
|
|||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inactive {
|
.item-leave {
|
||||||
pre, code {
|
pre, code {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user