From 63f0a2058dd5b77e5f638b9d5bcff699d79f95ae Mon Sep 17 00:00:00 2001 From: cherishsince Date: Tue, 18 Jun 2024 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E5=88=A0?= =?UTF-8?q?=E9=99=A4=20image=20task=20=E5=88=86=E9=A1=B5=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=20top=20=E5=89=8D=E5=A4=9A=E5=B0=91=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/image/ImageTask.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/views/ai/image/ImageTask.vue b/src/views/ai/image/ImageTask.vue index a2dc3873..6ceb7e0f 100644 --- a/src/views/ai/image/ImageTask.vue +++ b/src/views/ai/image/ImageTask.vue @@ -57,7 +57,8 @@ const getImageList = async () => { text: '加载中...' }) const { list } = await ImageApi.getImageList({pageNo: pageNo.value, pageSize: pageSize.value}) - imageList.value.push.apply(imageList.value, list) + // imageList.value.push.apply(imageList.value, list) + imageList.value = list } finally { if (imageTaskLoadingInstance.value) { imageTaskLoadingInstance.value.close(); @@ -118,14 +119,15 @@ const downloadImage = async (imageUrl) => { } const handleTabsScroll = async () => { - if (imageTaskRef.value) { - const { scrollTop, scrollHeight, clientHeight } = imageTaskRef.value; - if (scrollTop + clientHeight >= scrollHeight - 20 && !imageTaskLoading.value) { - console.log('分页') - pageNo.value = pageNo.value + 1 - await getImageList(); - } - } + // todo 先不分页,只显示 top 前多少 + // if (imageTaskRef.value) { + // const { scrollTop, scrollHeight, clientHeight } = imageTaskRef.value; + // if (scrollTop + clientHeight >= scrollHeight - 20 && !imageTaskLoading.value) { + // console.log('分页') + // pageNo.value = pageNo.value + 1 + // await getImageList(); + // } + // } } /** 暴露组件方法 */