Skip to content

Commit 11ec263

Browse files
committed
【优化】处理抽屉中 绘画中的图片不能展示加载状态
1 parent bbf7956 commit 11ec263

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/views/ai/image/ImageDetailDrawer.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ watch(show, async (newValue, oldValue) => {
112112
// watch id
113113
const { id } = toRefs(props)
114114
watch(id, async (newVal, oldVal) => {
115-
console.log('newVal', newVal)
116115
if (newVal) {
117116
await getImageDetail(newVal)
118117
}

src/views/ai/image/ImageTaskCard.vue

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => {
4141
emits('onBtnClick', type, imageDetail)
4242
}
4343
44-
// emits
45-
const emits = defineEmits(['onBtnClick'])
46-
47-
//
48-
onMounted(async () => {
49-
if (props.imageDetail.status === 'in_progress') {
44+
const handlerLoading = async (status: string) => {
45+
if (status === 'in_progress') {
5046
cardImageLoadingInstance.value = ElLoading.service({
5147
target: cardImageRef.value,
5248
text: '生成中...'
@@ -57,6 +53,19 @@ onMounted(async () => {
5753
cardImageLoadingInstance.value = null;
5854
}
5955
}
56+
}
57+
// watch
58+
const { imageDetail } = toRefs(props)
59+
watch(imageDetail, async (newVal, oldVal) => {
60+
await handlerLoading(newVal.status as string)
61+
})
62+
63+
// emits
64+
const emits = defineEmits(['onBtnClick'])
65+
66+
//
67+
onMounted(async () => {
68+
await handlerLoading(props.imageDetail.status as string)
6069
})
6170
</script>
6271

0 commit comments

Comments
 (0)