perf: 优化数据流推送消息页面滚动

This commit is contained in:
kuaifan 2023-08-05 12:51:38 +08:00
parent 459bce93c1
commit 29ef080399

View File

@ -1380,13 +1380,16 @@ export default {
} else if (data.type === 'replace') {
item.msg.text = data.text
}
if (tail <= 55) {
this.$nextTick(_ => {
const {tail: newTail} = this.scrollInfo()
if (tail <= 10 && newTail != tail) {
this.operatePreventScroll++
this.$refs.scroller.scrollToBottom();
setTimeout(_ => {
this.operatePreventScroll--
}, 50)
}
})
}
},
@ -2513,18 +2516,24 @@ export default {
}
//
let domAudits = $(target).parents(".open-approve-details")
if( domAudits.length > 0 ){
let dataId = domAudits[0].getAttribute("data-id")
let approveElement = target;
while (approveElement) {
if (approveElement.classList.contains('open-approve-details')) {
const dataId = approveElement.getAttribute("data-id")
if (window.innerWidth < 426) {
this.goForward({name: 'manage-approve-details', query: { id: domAudits[0].getAttribute("data-id") } });
this.goForward({name: 'manage-approve-details', query: {id: approveElement.getAttribute("data-id")}});
} else {
this.approveDetailsShow = true;
this.$nextTick(() => {
this.approveDetails = {id: dataId};
})
}
return;
break;
}
if (approveElement.classList.contains('dialog-item')) {
break;
}
approveElement = approveElement.parentElement;
}
switch (target.nodeName) {