From b82391da0ad65aa57c295a831e8ddeeb9e0a5480 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Wed, 29 May 2024 18:07:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=A7=A3=E5=86=B3todo=E3=80=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A5=E5=8F=A3=E5=91=BD=E5=90=8D=E3=80=81?= =?UTF-8?q?=E5=92=8C=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/image/index.ts | 6 +++--- src/views/ai/image/ImageTaskCard.vue | 8 ++++---- src/views/ai/image/dall3/index.vue | 11 ++++++++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 0ef1aaab..99419316 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -34,11 +34,11 @@ export interface ImageDallReqVO { export const ImageApi = { // 获取 image 列表 getImageList: async (params: ImagePageReqVO) => { - return await request.get({ url: `/ai/image/list`, params }) + return await request.get({ url: `/ai/image/my-page`, params }) }, // 获取 image 详细信息 getImageDetail: async (id: number) => { - return await request.get({ url: `/ai/image/get?id=${id}`}) + return await request.get({ url: `/ai/image/get-my?id=${id}`}) }, // dall2、dall3 调用 dall: async (data: ImageDallReqVO)=> { @@ -46,6 +46,6 @@ export const ImageApi = { }, // 删除 deleteImage: async (id: number)=> { - return await request.delete({ url: `/ai/image/delete?id=${id}`}) + return await request.delete({ url: `/ai/image/delete-my?id=${id}`}) }, } diff --git a/src/views/ai/image/ImageTaskCard.vue b/src/views/ai/image/ImageTaskCard.vue index 24fc1194..7d884f46 100644 --- a/src/views/ai/image/ImageTaskCard.vue +++ b/src/views/ai/image/ImageTaskCard.vue @@ -2,9 +2,9 @@
- 生成中 - 已完成 - 已完成 + 生成中 + 已完成 + 已完成
{ } const handlerLoading = async (status: string) => { - if (status === 'in_progress') { + if (status === '10') { cardImageLoadingInstance.value = ElLoading.service({ target: cardImageRef.value, text: '生成中...' diff --git a/src/views/ai/image/dall3/index.vue b/src/views/ai/image/dall3/index.vue index 067c9d98..abeb21a2 100644 --- a/src/views/ai/image/dall3/index.vue +++ b/src/views/ai/image/dall3/index.vue @@ -110,6 +110,8 @@ interface ImageModelVO { interface ImageSizeVO { key: string style: string, + width: string, + height: string, } // 定义属性 @@ -152,16 +154,22 @@ const imageSizeList = ref([ { key: '1024x1024', name: '1:1', + width: '1024', + height: '1024', style: 'width: 30px; height: 30px;background-color: #dcdcdc;', }, { key: '1024x1792', name: '3:5', + width: '1024', + height: '1792', style: 'width: 30px; height: 50px;background-color: #dcdcdc;', }, { key: '1792x1024', name: '5:3', + width: '1792', + height: '1024', style: 'width: 50px; height: 30px;background-color: #dcdcdc;', } ]) // size @@ -233,7 +241,8 @@ const handlerGenerateImage = async () => { prompt: prompt.value, // 提示词 model: selectModel.value.key, // 模型 style: selectImageStyle.value.key, // 图像生成的风格 - size: selectImageSize.value.key, // size不能为空 + width: selectImageSize.value.width, // size不能为空 + height: selectImageSize.value.height, // size不能为空 } as ImageDallReqVO // 发送请求 await ImageApi.dall(form)