diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index fb25549..6b6f5d8 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -35,7 +35,7 @@ export default defineConfig({ target: 'http://27.128.240.72:7865', // target: 'https://prev.ysaix.com:7868/prod-api/', // target: 'http://36.134.181.164:7863', - // target: 'http://192.168.0.102:7865', + // target: 'http://192.168.2.237:7865', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') }, diff --git a/package.json b/package.json index 4fba2cd..fbdbc6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win-ws", - "version": "2.5.14", + "version": "2.5.15", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", @@ -35,12 +35,14 @@ "@electron/remote": "^2.1.2", "@element-plus/icons-vue": "^2.3.1", "@icon-park/vue-next": "^1.4.2", + "@kangc/v-md-editor": "^2.3.18", "@tinymce/tinymce-vue": "5.1.1", "@vitejs/plugin-vue-jsx": "^4.0.0", "@vue-office/docx": "^1.6.2", "@vue-office/excel": "^1.7.11", "@vue-office/pdf": "^2.0.2", "@vueuse/core": "^10.11.0", + "aix-plugins-aitools": "^1.1.0", "animate.css": "^4.1.1", "circular-json": "^0.5.9", "clipboard": "^2.0.11", diff --git a/src/main/file.js b/src/main/file.js index 5764d91..a957b42 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -359,6 +359,11 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { //下载文件 ipcMain.on('download-file-default', (e, { url, fileName }) => { + console.log(url, fileName) + if (!url) { + e.reply('download-file-default' + fileName, false) + return; + } createFolder('selfFile') .then(async () => { const browserWindow = BrowserWindow.getFocusedWindow() diff --git a/src/renderer/index.html b/src/renderer/index.html index 6e072ed..60caf7f 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,7 +8,7 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - + diff --git a/src/renderer/public/icon/avatar.svg b/src/renderer/public/icon/avatar.svg new file mode 100644 index 0000000..386fffa --- /dev/null +++ b/src/renderer/public/icon/avatar.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue index 7402fe8..9bded7c 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue @@ -5,14 +5,21 @@
-
- - {{ item.fileShowName }} +
+ + + +
{{ item.fileShowName }}
+
- 插入 + 插入
-
+
+ + diff --git a/src/renderer/src/components/file-image/index.vue b/src/renderer/src/components/file-image/index.vue index 74a5341..3914946 100644 --- a/src/renderer/src/components/file-image/index.vue +++ b/src/renderer/src/components/file-image/index.vue @@ -26,6 +26,7 @@ const getFileTypeIcon = () => { doc: 'icon-word', docx: 'icon-word', mp4: 'icon-video', + wav: 'icon-mp', mov: 'icon-mov', avi: 'icon-avi', jpeg: 'icon-jpeg', diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index a723b75..16f16ec 100644 --- a/src/renderer/src/main.js +++ b/src/renderer/src/main.js @@ -10,6 +10,15 @@ import './assets/iconfont/iconfont' import 'virtual:windi.css' import request from "@/utils/request"; +//v-md-editor +import VMdPreview from '@kangc/v-md-editor/lib/preview'; +import '@kangc/v-md-editor/lib/style/preview.css'; +// 引入你所使用的主题 此处以 github 主题为例 +import githubTheme from '@kangc/v-md-editor/lib/theme/github'; +import '@kangc/v-md-editor/lib/theme/style/github.css'; +// highlightjs +import hljs from 'highlight.js'; + import { store } from '@/store' import App from './App.vue' import router from './router' @@ -17,6 +26,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) // 渲染进程日志-控制台替换 @@ -39,6 +51,10 @@ app.config.globalProperties.$requestGetJYW = (url,config)=>{ import Icon from '@/AixPPTist/src/plugins/icon' import Directive from '@/AixPPTist/src/plugins/directive' +VMdPreview.use(githubTheme, { + Hljs: hljs, +}); + app.use(router) .use(store) .use(ElementPlus, { locale: zhLocale }) @@ -46,6 +62,8 @@ app.use(router) .use(plugins) .use(Icon) .use(Directive) + .use(aiAudio) + .use(VMdPreview) .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/utils/ppt/index.js b/src/renderer/src/utils/ppt/index.js index f556f1f..faca4cc 100644 --- a/src/renderer/src/utils/ppt/index.js +++ b/src/renderer/src/utils/ppt/index.js @@ -1,5 +1,5 @@ /** - * ppt 转换为图片 + * ppt 相关方法 */ import { h, render, getCurrentInstance } from 'vue' import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库 @@ -8,6 +8,7 @@ import ThumbnailSlide from '@/AixPPTist/src/views/components/ThumbnailSlide/inde import { useSlidesStore } from '@/AixPPTist/src/store' import * as ElementPlus from 'element-plus' import { sessionStore } from '@/utils/store' // electron-store 状态管理 +import { getStaticUrl } from '@/utils/tool' // 工具类 import * as Http_Classcourse from '@/api/teaching/classcourse' // api接口 // 延时 @@ -128,4 +129,82 @@ export const ShareCode = async(code, cb) => { } else done() } }).catch(() => {}) +} + +/** + * 提示框 + * @param {*} msg 内容 + * @param {*} title 标题 + * @param {*} option 配置 + * @param {*} cb 关闭前回调 ({ h, instance, action, done }, done) + * @returns + */ +export const Alert = async (msg, title, option, cb) => { + try { + if (typeof msg == 'function') msg = await msg(h) + return await ElementPlus.ElMessageBox.alert(msg, title, { + confirmButtonText: '确认', + cancelButtonText: '关闭', + showCancelButton: true, + beforeClose: (action, instance, done) => { + if (action == 'confirm') { // 确认 + if (!!cb) { // 回调 + cb({ h, instance, action, done }, done) && done() + } else { // 默认确认 + done() + } + } else done() + }, + ...option, + }) + } catch { } +} +/** + * 课堂工具栏-钩子 + */ +export const ToolType = { + /** 分享码 */ + SHARE_CODE: 'shareCode', + /** 课堂点名 */ + NAMED: 'named', +} +export const ToolHandle = async(type, data, cb) => { + const classcourse = sessionStore.get('curr.classcourse') // 课堂信息 + switch (type) { + case ToolType.SHARE_CODE: + return ShareCode(data, cb) + case ToolType.NAMED: { + if (!classcourse) return ElementPlus.ElMessage.warning('没有课堂信息!') + const avatar = getStaticUrl('/icon/avatar.svg') + const timgroupid = classcourse.timgroupid + if (!timgroupid) return ElementPlus.ElMessage.warning('没有课堂群信息!') + // 课堂点名 + const res = await Http_Classcourse.rollCall(timgroupid) + if (!(res && res.code == 200 && res.data)) return ElementPlus.ElMessage.warning('点名失败!') + const userList = res?.data || [] + const refresh = () => { ToolHandle(ToolType.NAMED); return true } + Alert(h => { + const attr_0 = {style:{display:'flex',gap:'10px', cursor:'pointer'}} + const attr_1 = { style:{display:'inline-flex',alignItems:'center',gap:'10px',padding:'5px 10px'}} + const attr_2 = { src: avatar, style: { width: '50px', height: '50px' }} + const attr_3 = { style: { fontSize: '20px', fontWeight: 'bold', color: '#409EFF' }} + const attr_4 = { style: { fontSize: '12px' }} + const userList_H = userList.map(o => { + attr_1.title = o.name + attr_4.style.color = o.online ? '#67C23A' : '#F56C6C' + return h('div', attr_1, [ + h('img', attr_2), + h('div', [ + h('p', attr_3, o.name), + h('span', attr_4, o.online?'在线':'离线') + ]) + ]) + }) + return h('div', attr_0, userList_H) + }, '课堂点名', { confirmButtonText: '刷新' }, refresh) + break; + } + default: + break + } } \ No newline at end of file diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index 8e2049a..41de465 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) } } diff --git a/src/renderer/src/views/prepare/container/pptist-dialog.vue b/src/renderer/src/views/prepare/container/pptist-dialog.vue index 0bad55b..9067669 100644 --- a/src/renderer/src/views/prepare/container/pptist-dialog.vue +++ b/src/renderer/src/views/prepare/container/pptist-dialog.vue @@ -70,7 +70,8 @@ const percentage = ref(0); const outlineCreatePPT = () => { const newOutlineData = { ...outlineData.value, }; - newOutlineData.outline = props.dataList.outline; + let outline = JSON.parse(props.dataList.outline).json + newOutlineData.outline = JSON.stringify(outline); newOutlineData.query = "通过传入大纲帮我生成相应的PPT课件" createPPTLoading.value = true; createPptByOutline(newOutlineData).then((res) => { diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index 30f78d6..b6472fe 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -16,31 +16,13 @@
- + + +
- + diff --git a/src/renderer/src/views/teachingDesign/container/left.vue b/src/renderer/src/views/teachingDesign/container/left.vue index 0ac347c..95c37be 100644 --- a/src/renderer/src/views/teachingDesign/container/left.vue +++ b/src/renderer/src/views/teachingDesign/container/left.vue @@ -150,6 +150,10 @@ const resetSelect = () => { emitter.on('resetSelect', () => { resetSelect() + getSyllabus() +}) +emitter.on('getLastInfo',() =>{ + getSyllabus() }) // 点击教学模式 diff --git a/src/renderer/src/views/teachingDesign/container/right.vue b/src/renderer/src/views/teachingDesign/container/right.vue index 300399f..0e0e21a 100644 --- a/src/renderer/src/views/teachingDesign/container/right.vue +++ b/src/renderer/src/views/teachingDesign/container/right.vue @@ -1,10 +1,10 @@