From 3c4327e4dd0e47424c3446beb1e0e1d34fc42a7d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 1 Jun 2024 16:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91AI=EF=BC=9A=E7=BB=98=E5=88=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95=E5=92=8C=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/image/index.ts | 16 +++++--- src/views/ai/image/ImageDetailDrawer.vue | 25 +++++++------ src/views/ai/image/ImageTask.vue | 7 ++-- src/views/ai/image/ImageTaskCard.vue | 15 +++++--- src/views/ai/image/dall3/index.vue | 47 ++++++++++++++---------- src/views/ai/image/index.vue | 2 + 6 files changed, 67 insertions(+), 45 deletions(-) diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 72c2dbb1..1df168e5 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -1,10 +1,11 @@ import request from '@/config/axios' // AI API 密钥 VO +// TODO @fan:要不前端不弄太多 VO,就用这个 ImageDetailVO?! export interface ImageDetailVO { id: number // 编号 prompt: string // 提示词 - status: string // 状态 + status: number // 状态 errorMessage: string // 错误信息 type: string // 模型下分不同的类型(清晰、真实...) taskId: number // dr 任务id @@ -31,11 +32,14 @@ export interface ImageDallReqVO { height: string // 图片高度 } -export interface ImageDallReqVO { +export interface ImageDrawReqVO { + platform: string // 平台 prompt: string // 提示词 model: string // 模型 style: string // 图像生成的风格 - size: string // size不能为空 + width: string // 图片宽度 + height: string // 图片高度 + options: object // 绘制参数,Map } export interface ImageMidjourneyImagineReqVO { @@ -57,9 +61,9 @@ export const ImageApi = { getImageDetail: async (id: number) => { return await request.get({ url: `/ai/image/get-my?id=${id}`}) }, - // dall2、dall3 调用 - dall: async (data: ImageDallReqVO)=> { - return await request.post({ url: `/ai/image/dall`, data }) + // 生成图片 + drawImage: async (data: ImageDrawReqVO)=> { + return await request.post({ url: `/ai/image/draw`, data }) }, // midjourney - imagine midjourneyImagine: async (data: ImageMidjourneyImagineReqVO)=> { diff --git a/src/views/ai/image/ImageDetailDrawer.vue b/src/views/ai/image/ImageDetailDrawer.vue index b5f09cde..74bde864 100644 --- a/src/views/ai/image/ImageDetailDrawer.vue +++ b/src/views/ai/image/ImageDetailDrawer.vue @@ -5,7 +5,7 @@ @close="handlerDrawerClose" custom-class="drawer-class" > - +
@@ -13,6 +13,7 @@
+
@@ -21,6 +22,7 @@
时间
提交时间:{{imageDetail.createTime}}
+
生成时间:{{imageDetail.updateTime}}
@@ -38,34 +40,35 @@ {{imageDetail.prompt}} - -
-
风格
-
- {{imageDetail.style}} -
-
-
地址
+
图片地址
{{imageDetail.picUrl}}
- +
生成地址
{{imageDetail.originalPicUrl}}
+ +
+
风格
+
+ + + {{imageDetail.options.style}} +
+