diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index 75103182..949b536e 100644 --- a/src/api/ai/image/index.ts +++ b/src/api/ai/image/index.ts @@ -1,7 +1,7 @@ import request from '@/config/axios' -// AI API 密钥 VO -export interface ImageRespVO { +// AI 绘图 VO +export interface ImageVO { id: number // 编号 platform: string // 平台 model: string // 模型 diff --git a/src/api/ai/music/index.ts b/src/api/ai/music/index.ts new file mode 100644 index 00000000..220f85e6 --- /dev/null +++ b/src/api/ai/music/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +// AI 音乐 VO +export interface MusicVO { + id: number // 编号 + userId: number // 用户编号 + title: string // 音乐名称 + lyric: string // 歌词 + imageUrl: string // 图片地址 + audioUrl: string // 音频地址 + videoUrl: string // 视频地址 + status: number // 音乐状态 + gptDescriptionPrompt: string // 描述词 + prompt: string // 提示词 + platform: string // 模型平台 + model: string // 模型 + generateMode: number // 生成模式 + tags: string // 音乐风格标签 + publicStatus: boolean // 是否发布 + taskId: string // 任务id + errorMessage: string // 错误信息 +} + +// AI 音乐 API +export const MusicApi = { + // 查询音乐分页 + getMusicPage: async (params: any) => { + return await request.get({ url: `/ai/music/page`, params }) + }, + + // 更新绘画发布状态 + updateMusicPublicStatus: async (id: number, publicStatus: boolean) => { + return await request.put({ + url: '/ai/music/update-public-status', + data: { + id, + publicStatus + } + }) + }, + + // 删除音乐 + deleteMusic: async (id: number) => { + return await request.delete({ url: `/ai/music/delete?id=` + id }) + } +} diff --git a/src/components/ContentWrap/src/ContentWrap.vue b/src/components/ContentWrap/src/ContentWrap.vue index 454e95c9..c75e4b71 100644 --- a/src/components/ContentWrap/src/ContentWrap.vue +++ b/src/components/ContentWrap/src/ContentWrap.vue @@ -10,12 +10,13 @@ const prefixCls = getPrefixCls('content-wrap') defineProps({ title: propTypes.string.def(''), - message: propTypes.string.def('') + message: propTypes.string.def(''), + bodyStyle: propTypes.object.def({ padding: '20px' }) }) diff --git a/src/layout/components/AppView.vue b/src/layout/components/AppView.vue index 44341873..88d5f0cc 100644 --- a/src/layout/components/AppView.vue +++ b/src/layout/components/AppView.vue @@ -38,24 +38,24 @@ provide('reload', reload) :class="[ 'p-[var(--app-content-padding)] w-[calc(100%-var(--app-content-padding)-var(--app-content-padding))] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]', { - '!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': + '!h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': (fixedHeader && (layout === 'classic' || layout === 'topLeft' || layout === 'top') && footer) || (!tagsView && layout === 'top' && footer), - '!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height)-var(--tags-view-height))]': + '!h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height)-var(--tags-view-height))]': tagsView && layout === 'top' && footer, - '!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--top-tool-height)-var(--app-footer-height))]': + '!h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--top-tool-height)-var(--app-footer-height))]': !fixedHeader && layout === 'classic' && footer, - '!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': + '!h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]': !fixedHeader && layout === 'topLeft' && footer, - '!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding))]': + '!h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding))]': fixedHeader && layout === 'cutMenu' && footer, - '!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]': + '!h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]': !fixedHeader && layout === 'cutMenu' && footer } ]" diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index bc62a3c4..6da3b0a4 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -70,6 +70,26 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, + { + path: '/ai/music', + component: Layout, + redirect: '/index', + name: 'AIMusic', + meta: {}, + children: [ + { + path: 'index', + component: () => import('@/views/ai/music/components/index.vue'), + name: 'AIMusicIndex', + meta: { + title: 'AI 音乐', + icon: 'ep:home-filled', + noCache: false, + affix: true + } + } + ] + }, { path: '/user', component: Layout, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 1b6b9b3f..556c8d01 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -221,4 +221,6 @@ export enum DICT_TYPE { // ========== AI - 人工智能模块 ========== AI_PLATFORM = 'ai_platform', // AI 平台 AI_IMAGE_STATUS = 'ai_image_status', // AI 图片状态 + AI_MUSIC_STATUS = 'ai_music_status', // AI 音乐状态 + AI_GENERATE_MODE = 'ai_generate_mode' // AI 生成模式 } diff --git a/src/views/ai/image/ImageDetailDrawer.vue b/src/views/ai/image/ImageDetailDrawer.vue index 7c74ef35..fca087da 100644 --- a/src/views/ai/image/ImageDetailDrawer.vue +++ b/src/views/ai/image/ImageDetailDrawer.vue @@ -7,11 +7,11 @@ >
- - - - - + + + + +
@@ -21,30 +21,30 @@
时间
-
提交时间:{{imageDetail.createTime}}
+
提交时间:{{ imageDetail.createTime }}
-
生成时间:{{imageDetail.updateTime}}
+
生成时间:{{ imageDetail.updateTime }}
模型
- {{imageDetail.model}}({{imageDetail.height}}x{{imageDetail.width}}) + {{ imageDetail.model }}({{ imageDetail.height }}x{{ imageDetail.width }})
提示词
- {{imageDetail.prompt}} + {{ imageDetail.prompt }}
图片地址
- {{imageDetail.picUrl}} + {{ imageDetail.picUrl }}
@@ -53,18 +53,18 @@
- {{imageDetail?.options?.style}} + {{ imageDetail?.options?.style }}
diff --git a/src/views/ai/image/manager/index.vue b/src/views/ai/image/manager/index.vue index ef505036..d7ac6c81 100644 --- a/src/views/ai/image/manager/index.vue +++ b/src/views/ai/image/manager/index.vue @@ -163,7 +163,7 @@ diff --git a/src/views/ai/music/components/list/audioBar/index.vue b/src/views/ai/music/components/list/audioBar/index.vue new file mode 100644 index 00000000..2b25e40f --- /dev/null +++ b/src/views/ai/music/components/list/audioBar/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/views/ai/music/components/list/index.vue b/src/views/ai/music/components/list/index.vue new file mode 100644 index 00000000..6dce9b8c --- /dev/null +++ b/src/views/ai/music/components/list/index.vue @@ -0,0 +1,94 @@ + + + + + + diff --git a/src/views/ai/music/components/list/songCard/index.vue b/src/views/ai/music/components/list/songCard/index.vue new file mode 100644 index 00000000..dc1ffa8b --- /dev/null +++ b/src/views/ai/music/components/list/songCard/index.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/views/ai/music/components/list/songInfo/index.vue b/src/views/ai/music/components/list/songInfo/index.vue new file mode 100644 index 00000000..4832bfcb --- /dev/null +++ b/src/views/ai/music/components/list/songInfo/index.vue @@ -0,0 +1,33 @@ + + + diff --git a/src/views/ai/music/components/mode/desc.vue b/src/views/ai/music/components/mode/desc.vue new file mode 100644 index 00000000..4488461e --- /dev/null +++ b/src/views/ai/music/components/mode/desc.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/views/ai/music/components/mode/index.vue b/src/views/ai/music/components/mode/index.vue new file mode 100644 index 00000000..bb6cf116 --- /dev/null +++ b/src/views/ai/music/components/mode/index.vue @@ -0,0 +1,44 @@ + + + diff --git a/src/views/ai/music/components/mode/lyric.vue b/src/views/ai/music/components/mode/lyric.vue new file mode 100644 index 00000000..f774003a --- /dev/null +++ b/src/views/ai/music/components/mode/lyric.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/views/ai/music/components/title/index.vue b/src/views/ai/music/components/title/index.vue new file mode 100644 index 00000000..a0658027 --- /dev/null +++ b/src/views/ai/music/components/title/index.vue @@ -0,0 +1,25 @@ + + + diff --git a/src/views/ai/music/manager/index.vue b/src/views/ai/music/manager/index.vue new file mode 100644 index 00000000..dc7f41a5 --- /dev/null +++ b/src/views/ai/music/manager/index.vue @@ -0,0 +1,281 @@ + + +