From 40b67a09ca97a5a80c4be37036ee9c110a09da04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Wed, 12 Apr 2023 09:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E8=AD=A6=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E9=97=B4=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/index.vue | 53 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 0802ba8..99e68c2 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -111,9 +111,9 @@ -
i +
@@ -223,40 +223,33 @@ export default { this.warringList = [] let i = 1 let timeout = null - let first = false - let timeoutF = () => { - timeout = setInterval(() => { - if (i >= listLength) { - first = true - clearInterval(timeout) - } - if (this.warringWaitList.length > 0) { - this.warringList.splice(this.warringList.length, 0, this.warringWaitList.splice(0, 1)[0]) - } - i++ - }, 1000) - } - timeoutF() + let first = true + this.warringList = this.warringWaitList + // let timeoutF = () => { + // timeout = setInterval(() => { + // if (i >= listLength) { + // first = true + // clearInterval(timeout) + // } + // if (this.warringWaitList.length > 0) { + // this.warringList.splice(this.warringList.length, 0, this.warringWaitList.splice(0, 1)[0]) + // } + // i++ + // }, 1000) + // } + // timeoutF() setInterval(() => { - console.log(1) if (first && this.warringWaitList.length > 0) { - if (this.warringList.length >= listLength) { - this.warringList.splice(0, 1) - } - setTimeout(() => { - this.warringList.splice(this.warringList.length, 0, this.warringWaitList.splice(0, 1)[0]) - }, 500) + let lastData = this.warringList.splice(0, 1) + setTimeout(()=>{ + this.warringList.splice(this.warringList.length, 0, lastData[0] || this.warringWaitList.splice(0, 1)[0]) + },200) } - }, 1000) - - // console.log(this.warringList) - // console.log(domList.at(-1)) - - // domParent.scrollTop += 100 + }, 2000) }) setInterval(() => { this.setInfo() - }, 10 * 1000) + }, 60 * 1000) // }) }, beforeDestroy() {