【修改todo】Loading组件 改为 @芋艿
parent
fda50ff291
commit
5fd8177791
|
@ -64,7 +64,7 @@
|
||||||
import {Delete, Download, More, RefreshRight} from '@element-plus/icons-vue'
|
import {Delete, Download, More, RefreshRight} from '@element-plus/icons-vue'
|
||||||
import { ImageVO, ImageMjButtonsVO } from '@/api/ai/image'
|
import { ImageVO, ImageMjButtonsVO } from '@/api/ai/image'
|
||||||
import { PropType } from 'vue'
|
import { PropType } from 'vue'
|
||||||
import { ElLoading } from 'element-plus'
|
import {ElLoading, LoadingOptionsResolved} from 'element-plus'
|
||||||
import { AiImageStatusEnum } from '@/views/ai/utils/constants'
|
import { AiImageStatusEnum } from '@/views/ai/utils/constants'
|
||||||
|
|
||||||
const cardImageRef = ref<any>() // 卡片 image ref
|
const cardImageRef = ref<any>() // 卡片 image ref
|
||||||
|
@ -83,12 +83,12 @@ const handleBtnClick = async (type, imageDetail: ImageVO) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleLoading = async (status: number) => {
|
const handleLoading = async (status: number) => {
|
||||||
// TODO @fan:这个搞成 Loading 组件,然后通过数据驱动,这样搞可以哇?
|
// TODO @芋艿:这个搞成 Loading 组件,然后通过数据驱动,这样搞可以哇?
|
||||||
if (status === AiImageStatusEnum.IN_PROGRESS) {
|
if (status === AiImageStatusEnum.IN_PROGRESS) {
|
||||||
cardImageLoadingInstance.value = ElLoading.service({
|
cardImageLoadingInstance.value = ElLoading.service({
|
||||||
target: cardImageRef.value,
|
target: cardImageRef.value,
|
||||||
text: '生成中...'
|
text: '生成中...'
|
||||||
})
|
} as LoadingOptionsResolved)
|
||||||
} else {
|
} else {
|
||||||
if (cardImageLoadingInstance.value) {
|
if (cardImageLoadingInstance.value) {
|
||||||
cardImageLoadingInstance.value.close()
|
cardImageLoadingInstance.value.close()
|
||||||
|
|
Loading…
Reference in New Issue