From 9516e7184ffa4d4deb67f409155c38d5eff74f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=A9=B7=28luot1=29?= <1315228474@qq.com> Date: Thu, 27 Jun 2024 17:50:48 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EAI=20music?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E4=BB=A5=E5=8F=8A=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BA=86APPview=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2min-height=E4=B8=BAheight=EF=BC=8C=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BA=86=E7=99=BB=E5=BD=95=E6=97=B6dict=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=EF=BC=8C=E5=9C=A8contentWrap=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9E=E4=BA=86bodystyle=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContentWrap/src/ContentWrap.vue | 9 +- src/layout/components/AppView.vue | 12 +-- src/router/modules/remaining.ts | 20 ++++ src/store/modules/dict.ts | 8 +- .../music/components/list/audioBar/index.vue | 9 ++ src/views/ai/music/components/list/index.vue | 94 +++++++++++++++++++ .../music/components/list/songCard/index.vue | 29 ++++++ .../music/components/list/songInfo/index.vue | 33 +++++++ src/views/ai/music/components/mode/desc.vue | 55 +++++++++++ src/views/ai/music/components/mode/index.vue | 44 +++++++++ src/views/ai/music/components/mode/lyric.vue | 83 ++++++++++++++++ src/views/ai/music/components/title/index.vue | 25 +++++ src/views/ai/music/index.vue | 21 +++++ 13 files changed, 428 insertions(+), 14 deletions(-) create mode 100644 src/views/ai/music/components/list/audioBar/index.vue create mode 100644 src/views/ai/music/components/list/index.vue create mode 100644 src/views/ai/music/components/list/songCard/index.vue create mode 100644 src/views/ai/music/components/list/songInfo/index.vue create mode 100644 src/views/ai/music/components/mode/desc.vue create mode 100644 src/views/ai/music/components/mode/index.vue create mode 100644 src/views/ai/music/components/mode/lyric.vue create mode 100644 src/views/ai/music/components/title/index.vue create mode 100644 src/views/ai/music/index.vue 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..ff2c5d92 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/index.vue'), + name: 'AIMusicIndex', + meta: { + title: 'AI 音乐', + icon: 'ep:home-filled', + noCache: false, + affix: true + } + } + ] + }, { path: '/user', component: Layout, diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index e239fb00..1a45335c 100644 --- a/src/store/modules/dict.ts +++ b/src/store/modules/dict.ts @@ -4,7 +4,7 @@ import { store } from '../index' import { DictDataVO } from '@/api/system/dict/types' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' const { wsCache } = useCache('sessionStorage') -import { getSimpleDictDataList } from '@/api/system/dict/dict.data' +// import { getSimpleDictDataList } from '@/api/system/dict/dict.data' export interface DictValueType { value: any @@ -45,7 +45,8 @@ export const useDictStore = defineStore('dict', { this.dictMap = dictMap this.isSetDict = true } else { - const res = await getSimpleDictDataList() + const res = [] + // const res = await getSimpleDictDataList() // 设置数据 const dictDataMap = new Map() res.forEach((dictData: DictDataVO) => { @@ -75,7 +76,8 @@ export const useDictStore = defineStore('dict', { }, async resetDict() { wsCache.delete(CACHE_KEY.DICT_CACHE) - const res = await getSimpleDictDataList() + const res = [] + // const res = await getSimpleDictDataList() // 设置数据 const dictDataMap = new Map() res.forEach((dictData: DictDataVO) => { 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..bc21034d --- /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/index.vue b/src/views/ai/music/index.vue new file mode 100644 index 00000000..b48abb6b --- /dev/null +++ b/src/views/ai/music/index.vue @@ -0,0 +1,21 @@ + + + From 75d0be9742f01ff6d759386f2a9d9ff436d63f7f Mon Sep 17 00:00:00 2001 From: xiaohong <1315228474@qq.com> Date: Thu, 27 Jun 2024 22:31:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E5=B0=86=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=94=B9=E6=88=90=E5=8D=95=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/music/components/list/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/ai/music/components/list/index.vue b/src/views/ai/music/components/list/index.vue index bc21034d..6dce9b8c 100644 --- a/src/views/ai/music/components/list/index.vue +++ b/src/views/ai/music/components/list/index.vue @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + From 8d33476472ddd6667c72ba59f5e7f3f4319fe11c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 27 Jun 2024 23:08:50 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91AI=EF=BC=9A=E9=9F=B3=E4=B9=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86=2050%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/image/index.ts | 4 +- src/api/ai/music/index.ts | 40 +++++ src/views/ai/image/ImageDetailDrawer.vue | 34 ++-- src/views/ai/image/ImageTask.vue | 46 ++--- src/views/ai/image/ImageTaskCard.vue | 48 +++-- src/views/ai/image/manager/index.vue | 6 +- src/views/ai/music/manager/index.vue | 215 +++++++++++++++++++++++ 7 files changed, 329 insertions(+), 64 deletions(-) create mode 100644 src/api/ai/music/index.ts create mode 100644 src/views/ai/music/manager/index.vue diff --git a/src/api/ai/image/index.ts b/src/api/ai/image/index.ts index cb5a5afd..b895986d 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..9415d3a2 --- /dev/null +++ b/src/api/ai/music/index.ts @@ -0,0 +1,40 @@ +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 }) + }, + + // 修改音乐 + updateMusic: async (data: MusicVO) => { + return await request.put({ url: `/ai/music/update`, data }) + }, + + // 删除音乐 + deleteMusic: async (id: number) => { + return await request.delete({ url: `/ai/music/delete?id=` + id }) + } +} 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 @@ From e3c46cab5305f3e8badaa84428100579797d21ff Mon Sep 17 00:00:00 2001 From: xiaohong <1315228474@qq.com> Date: Fri, 28 Jun 2024 09:26:58 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4ai=20music=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=96=87=E4=BB=B6=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 2 +- src/views/ai/music/{ => components}/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/views/ai/music/{ => components}/index.vue (82%) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index ff2c5d92..6da3b0a4 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -79,7 +79,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'index', - component: () => import('@/views/ai//music/index.vue'), + component: () => import('@/views/ai/music/components/index.vue'), name: 'AIMusicIndex', meta: { title: 'AI 音乐', diff --git a/src/views/ai/music/index.vue b/src/views/ai/music/components/index.vue similarity index 82% rename from src/views/ai/music/index.vue rename to src/views/ai/music/components/index.vue index b48abb6b..21272522 100644 --- a/src/views/ai/music/index.vue +++ b/src/views/ai/music/components/index.vue @@ -8,8 +8,8 @@