From f47cd1213b801d96cc432837e46e14313d2f502c Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 9 Jan 2025 15:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E9=9F=B3=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/renderer/src/api/file/index.js | 16 ++ .../src/components/ai-voice/index.vue | 243 ++++++++++++++++++ src/renderer/src/main.js | 4 + src/renderer/src/router/index.js | 6 + src/renderer/src/views/model/index.vue | 17 +- 6 files changed, 285 insertions(+), 2 deletions(-) create mode 100644 src/renderer/src/components/ai-voice/index.vue diff --git a/package.json b/package.json index f3599c1..362c56e 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@vue-office/excel": "^1.7.11", "@vue-office/pdf": "^2.0.2", "@vueuse/core": "^10.11.0", + "aix-plugins-aitools": "^1.0.9", "animate.css": "^4.1.1", "circular-json": "^0.5.9", "clipboard": "^2.0.11", diff --git a/src/renderer/src/api/file/index.js b/src/renderer/src/api/file/index.js index dac999b..e1ff5ce 100644 --- a/src/renderer/src/api/file/index.js +++ b/src/renderer/src/api/file/index.js @@ -79,3 +79,19 @@ export const getModelInfo = (params) => { params }) } +// 上传tts语音 +export const aitts = (data) => { + return request({ + url: '/aitts/createTts', + method: 'post', + data + }) +} +// 语音关联课 +export const addFileToSC = (params) => { + return request({ + url: '/smarttalk/file/addFileToSC', + method: 'post', + params + }) +} \ No newline at end of file diff --git a/src/renderer/src/components/ai-voice/index.vue b/src/renderer/src/components/ai-voice/index.vue new file mode 100644 index 0000000..3643f17 --- /dev/null +++ b/src/renderer/src/components/ai-voice/index.vue @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + 共{{ + currentFileList.filter( + (ite) => ite.fileFlag !== 'apt' && ite.fileFlag !== '课件' + ).length + }}个文件 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index a723b75..9a8c0d6 100644 --- a/src/renderer/src/main.js +++ b/src/renderer/src/main.js @@ -17,6 +17,9 @@ import log from 'electron-log/renderer' // 渲染进程日志-文件记录 import customComponent from '@/components/common' // 自定义组件 import plugins from './plugins' // plugins插件 import useUserStore from '@/store/modules/user' +import aiAudio from 'aix-plugins-aitools' // 文字转语音插件 +import '../../../node_modules/aix-plugins-aitools/aitools.css' + if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件 Object.assign(console, log.functions) // 渲染进程日志-控制台替换 @@ -46,6 +49,7 @@ app.use(router) .use(plugins) .use(Icon) .use(Directive) + .use(aiAudio) .mount('#app') const isStadium = (user) => { diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index 7a14f6e..55d8f3d 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -96,6 +96,12 @@ export const constantRoutes = [ name: 'aiKolors', meta: { title: '文生图片', showBread: true } }, + { + path: 'aiVoice', + component: () => import('@/components/ai-voice/index.vue'), + name: 'aiVoice', + meta: { title: '语音生成', showBread: true } + }, ] }, diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index f869bee..c22315c 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -153,7 +153,7 @@ const tools = reactive([{ img: 'airobot' },{ name: '语音生成', - path: '', + path: '/model/aiVoice', img: 'aiyuyin' },{ name: '文生图片', @@ -211,7 +211,20 @@ const gotoRoute = (item) => { if (item.path) { if (item.path === '/model/aiKolors') { gotoAiKolors(item.path) - }else { + }else if(item.path == '/model/aiVoice'){ + console.log('aiVoice',uploadData.value) + const path = '/model/aiVoice' + let subjectdata = sessionStore.get('subject.curNode') + let datasubject = `课标-${subjectdata.edustage}-${subjectdata.edusubject}` + router.push({ + path, + query: { + datasetId: dataSetJson[datasubject], + coursetitle: currentNode.value.itemtitle, + ...uploadData.value + } + }); + }else { router.push(item.path) } }