From 29ef0803996530dc01e06c66f6e24655fa898517 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sat, 5 Aug 2023 12:51:38 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B5=81=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/manage/components/DialogWrapper.vue | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 0818ab528..f9c6da7c9 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -505,7 +505,7 @@ - + @@ -1380,13 +1380,16 @@ export default { } else if (data.type === 'replace') { item.msg.text = data.text } - if (tail <= 55) { - this.operatePreventScroll++ - this.$refs.scroller.scrollToBottom(); - setTimeout(_ => { - this.operatePreventScroll-- - }, 50) - } + 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") - if( window.innerWidth < 426 ){ - this.goForward({name: 'manage-approve-details', query: { id: domAudits[0].getAttribute("data-id") } }); - }else{ - this.approveDetailsShow = true; - this.$nextTick(()=>{ - this.approveDetails = {id:dataId}; - }) + 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: approveElement.getAttribute("data-id")}}); + } else { + this.approveDetailsShow = true; + this.$nextTick(() => { + this.approveDetails = {id: dataId}; + }) + } + break; } - return; + if (approveElement.classList.contains('dialog-item')) { + break; + } + approveElement = approveElement.parentElement; } switch (target.nodeName) {