From 0b8301cc1cad6575f6cc92ffc861724ef02a1b6e Mon Sep 17 00:00:00 2001 From: cherishsince Date: Tue, 28 May 2024 09:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91Ai=20Image?= =?UTF-8?q?=20=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/image/ImageTask.vue | 11 ++++++++++- src/views/ai/image/index.vue | 2 -- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/views/ai/image/ImageTask.vue b/src/views/ai/image/ImageTask.vue index d38fe077..aface604 100644 --- a/src/views/ai/image/ImageTask.vue +++ b/src/views/ai/image/ImageTask.vue @@ -17,6 +17,7 @@ import ImageTaskCard from './ImageTaskCard.vue' import {bool} from "vue-types"; const imageList = ref([]) // image 列表 +const imageListInterval = ref() // image 列表定时器,刷新列表 const showTaskDetail = ref(false) // 是否显示 task 详情 /** @@ -56,12 +57,20 @@ const handlerImageBtnClick = async (type, imageDetail: ImageDetailVO) => { await handlerDrawerOpen() } } - // defineExpose({getImageList}) // onMounted(async () => { + // 获取 image 列表 await getImageList() + // 自动刷新 image 列表 + imageListInterval.value = setInterval(async () => { + await getImageList() + }, 3000) +}) +// +onUnmounted(async () => { + }) diff --git a/src/views/ai/image/index.vue b/src/views/ai/image/index.vue index ad29d6e0..b3afeafa 100644 --- a/src/views/ai/image/index.vue +++ b/src/views/ai/image/index.vue @@ -29,7 +29,6 @@ const selectModel = ref('DALL3绘画') const modelOptions = ['DALL3绘画', 'MJ绘画'] const drawIn = ref(false) // 生成中 - /** * 绘画 - start */ @@ -101,5 +100,4 @@ onMounted( async () => { } } -