From c0e51bd7aae289e8b77c06bbc3599d1b5847baf6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 28 Jun 2024 09:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=91AI=EF=BC=9A=E9=9F=B3=E4=B9=90=E7=AE=A1=E7=90=86=20100%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/music/index.ts | 12 ++- src/store/modules/dict.ts | 8 +- src/utils/dict.ts | 2 + src/views/ai/music/manager/index.vue | 120 +++++++++++++++++++++------ 4 files changed, 107 insertions(+), 35 deletions(-) diff --git a/src/api/ai/music/index.ts b/src/api/ai/music/index.ts index 9415d3a2..220f85e6 100644 --- a/src/api/ai/music/index.ts +++ b/src/api/ai/music/index.ts @@ -28,9 +28,15 @@ export const MusicApi = { return await request.get({ url: `/ai/music/page`, params }) }, - // 修改音乐 - updateMusic: async (data: MusicVO) => { - return await request.put({ url: `/ai/music/update`, data }) + // 更新绘画发布状态 + updateMusicPublicStatus: async (id: number, publicStatus: boolean) => { + return await request.put({ + url: '/ai/music/update-public-status', + data: { + id, + publicStatus + } + }) }, // 删除音乐 diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index 1a45335c..e239fb00 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,8 +45,7 @@ export const useDictStore = defineStore('dict', { this.dictMap = dictMap this.isSetDict = true } else { - const res = [] - // const res = await getSimpleDictDataList() + const res = await getSimpleDictDataList() // 设置数据 const dictDataMap = new Map() res.forEach((dictData: DictDataVO) => { @@ -76,8 +75,7 @@ export const useDictStore = defineStore('dict', { }, async resetDict() { wsCache.delete(CACHE_KEY.DICT_CACHE) - const res = [] - // const res = await getSimpleDictDataList() + const res = await getSimpleDictDataList() // 设置数据 const dictDataMap = new Map() res.forEach((dictData: DictDataVO) => { 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/music/manager/index.vue b/src/views/ai/music/manager/index.vue index 46c6b80d..dc7f41a5 100644 --- a/src/views/ai/music/manager/index.vue +++ b/src/views/ai/music/manager/index.vue @@ -42,13 +42,19 @@ - + > + + @@ -86,29 +92,76 @@ - - - - - - - - + + + + + + - - - - - + + + + + + + + - - + + + + + + + - - - - +