Skip to content

Commit 0b8301c

Browse files
committed
【增加】Ai Image 列表增加自动刷新
1 parent f74e8e6 commit 0b8301c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/views/ai/image/ImageTask.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import ImageTaskCard from './ImageTaskCard.vue'
1717
import {bool} from "vue-types";
1818
1919
const imageList = ref<ImageDetailVO[]>([]) // image 列表
20+
const imageListInterval = ref<any>() // image 列表定时器,刷新列表
2021
const showTaskDetail = ref<bool>(false) // 是否显示 task 详情
2122
2223
/**
@@ -56,12 +57,20 @@ const handlerImageBtnClick = async (type, imageDetail: ImageDetailVO) => {
5657
await handlerDrawerOpen()
5758
}
5859
}
59-
6060
//
6161
defineExpose({getImageList})
6262
//
6363
onMounted(async () => {
64+
// 获取 image 列表
6465
await getImageList()
66+
// 自动刷新 image 列表
67+
imageListInterval.value = setInterval(async () => {
68+
await getImageList()
69+
}, 3000)
70+
})
71+
//
72+
onUnmounted(async () => {
73+
6574
})
6675
</script>
6776

src/views/ai/image/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const selectModel = ref('DALL3绘画')
2929
const modelOptions = ['DALL3绘画', 'MJ绘画']
3030
const drawIn = ref<boolean>(false) // 生成中
3131
32-
3332
/**
3433
* 绘画 - start
3534
*/
@@ -101,5 +100,4 @@ onMounted( async () => {
101100
}
102101
}
103102
104-
105103
</style>

0 commit comments

Comments
 (0)