diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 205d0803..cb5a5afd 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -9,7 +9,7 @@ export interface ImageRespVO { width: number // 图片宽度 height: number // 图片高度 status: number // 状态 - publicStatus: string // 公开状态 + publicStatus: boolean // 公开状态 picUrl: string // 任务地址 errorMessage: string // 错误信息 options: object // 配置 Map @@ -62,25 +62,48 @@ export const ImageApi = { }, // 获取我的图片 getImageMy: async (id: number) => { - return await request.get({ url: `/ai/image/get-my?id=${id}`}) + return await request.get({ url: `/ai/image/get-my?id=${id}` }) }, // 生成图片 - drawImage: async (data: ImageDrawReqVO)=> { + drawImage: async (data: ImageDrawReqVO) => { return await request.post({ url: `/ai/image/draw`, data }) }, // 删除我的图片 - deleteImageMy: async (id: number)=> { - return await request.delete({ url: `/ai/image/delete-my?id=${id}`}) + deleteImageMy: async (id: number) => { + return await request.delete({ url: `/ai/image/delete-my?id=${id}` }) }, // ================ midjourney 专属 ================ // 【Midjourney】生成图片 - midjourneyImagine: async (data: ImageMidjourneyImagineReqVO)=> { + midjourneyImagine: async (data: ImageMidjourneyImagineReqVO) => { return await request.post({ url: `/ai/image/midjourney/imagine`, data }) }, // 【Midjourney】Action 操作(二次生成图片) - midjourneyAction: async (data: ImageMjActionVO)=> { + midjourneyAction: async (data: ImageMjActionVO) => { return await request.post({ url: `/ai/image/midjourney/action`, data }) }, + + // ================ 绘图管理 ================ + + // 查询绘画分页 + getImagePage: async (params: any) => { + return await request.get({ url: `/ai/image/page`, params }) + }, + + // 更新绘画发布状态 + updateImagePublicStatus: async (id: number, publicStatus: boolean) => { + return await request.put({ + url: '/ai/image/update-public-status', + data: { + id, + publicStatus + } + }) + }, + + // 删除绘画 + deleteImage: async (id: number) => { + return await request.delete({ url: `/ai/image/delete?id=` + id }) + } } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 9400208a..1b6b9b3f 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -219,5 +219,6 @@ export enum DICT_TYPE { ERP_STOCK_RECORD_BIZ_TYPE = 'erp_stock_record_biz_type', // 库存明细的业务类型 // ========== AI - 人工智能模块 ========== - AI_PLATFORM = 'ai_platform' // AI 平台 + AI_PLATFORM = 'ai_platform', // AI 平台 + AI_IMAGE_STATUS = 'ai_image_status', // AI 图片状态 } diff --git a/src/views/ai/chat/manager/index.vue b/src/views/ai/chat/manager/index.vue index 30dc2dfd..ca2d0924 100644 --- a/src/views/ai/chat/manager/index.vue +++ b/src/views/ai/chat/manager/index.vue @@ -16,5 +16,5 @@ import ChatConversationList from './ChatConversationList.vue' import ChatMessageList from './ChatMessageList.vue' /** AI 聊天对话 列表 */ -defineOptions({ name: 'ChatConversation' }) +defineOptions({ name: 'AiChatManager' }) diff --git a/src/views/ai/image/manager/index.vue b/src/views/ai/image/manager/index.vue new file mode 100644 index 00000000..ef505036 --- /dev/null +++ b/src/views/ai/image/manager/index.vue @@ -0,0 +1,247 @@ + + +