From 0c3b017a280e96a7931ca806f62b72b882827efc Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 9 Jan 2025 15:14:58 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E6=89=93=E5=8C=85=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/teachingDesign/container/right.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/views/teachingDesign/container/right.vue b/src/renderer/src/views/teachingDesign/container/right.vue index 300399f..0a00bbb 100644 --- a/src/renderer/src/views/teachingDesign/container/right.vue +++ b/src/renderer/src/views/teachingDesign/container/right.vue @@ -3,7 +3,7 @@
课件预览
- 一键生成 + 一键生成 编辑课件
@@ -64,6 +64,7 @@ const pgDialog = reactive({ // 弹窗-进度条 const pptSlides = ref([]) emitter.on('onResult', (data)=>{ + console.log(data) result.value = data if (!!result.value.parentId) { listEntpcoursefileNew({parentid: result.value.parentId}).then(res=>{ From 5179e6407d99072f571bc1d0c159854e39d97160 Mon Sep 17 00:00:00 2001 From: lyc Date: Thu, 9 Jan 2025 15:16:34 +0800 Subject: [PATCH 02/23] =?UTF-8?q?edit=20=E6=A1=86=E6=9E=B6=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/renderer/src/main.js | 14 +++ .../views/teachingDesign/container/center.vue | 116 ++++++++++-------- .../src/views/teachingDesign/index.vue | 4 +- 4 files changed, 79 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index 7fb23eb..ea23159 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@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", diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index a723b75..76763e7 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' @@ -39,6 +48,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 +59,7 @@ app.use(router) .use(plugins) .use(Icon) .use(Directive) + .use(VMdPreview) .mount('#app') const isStadium = (user) => { diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index 30f78d6..f76370e 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -16,7 +16,10 @@
- + + \ 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) } } From aee58d24434f14d4fdba3151a2734d0f079b31f9 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 9 Jan 2025 15:50:06 +0800 Subject: [PATCH 05/23] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E5=90=88=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/ai-voice/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/src/components/ai-voice/index.vue b/src/renderer/src/components/ai-voice/index.vue index 3643f17..c56220c 100644 --- a/src/renderer/src/components/ai-voice/index.vue +++ b/src/renderer/src/components/ai-voice/index.vue @@ -144,6 +144,7 @@ export default { } addFileToSC(saveObj) .then((resone) => { + this.$message.success('上传成功') this.asyncAllFile() this.$refs.audioRef.saveLoading = false }) From b85b95e8176d1c00fd86ad72ba52fdfbf1eadf0c Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 9 Jan 2025 16:00:15 +0800 Subject: [PATCH 06/23] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/index.html | 2 +- src/renderer/src/views/prepare/container/pptist-dialog.vue | 3 ++- src/renderer/src/views/teachingDesign/container/right.vue | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) 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/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/right.vue b/src/renderer/src/views/teachingDesign/container/right.vue index 93b41fd..c075637 100644 --- a/src/renderer/src/views/teachingDesign/container/right.vue +++ b/src/renderer/src/views/teachingDesign/container/right.vue @@ -66,7 +66,6 @@ const pptSlides = ref([]) emitter.on('onResult', (data)=>{ console.log(data) result.value = data - result.value.outline = JSON.parse(data.outline).json if (!!result.value.parentId) { listEntpcoursefileNew({parentid: result.value.parentId}).then(res=>{ pptSlides.value = res.rows From 96e71ff45e69306da5021d4713080f9635684fb5 Mon Sep 17 00:00:00 2001 From: lyc Date: Thu, 9 Jan 2025 16:49:43 +0800 Subject: [PATCH 07/23] =?UTF-8?q?edit=20=E6=A1=86=E6=9E=B6=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/teachingDesign/container/center.vue | 17 ++++++++++++----- .../src/views/teachingDesign/container/left.vue | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index f27faea..c3d083e 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -83,10 +83,10 @@ emitter.on('selected', (data) => { // 回显大纲 const curItem = reactive({}) emitter.on('onShow', (data) => { - - let outline = JSON.parse(data.outline) + + let outline = cloneDeep(JSON.parse(data.outline)) markeDownAnswer.value = outline.markdown - emitter.emit('onResult',data) + emitter.emit('onResult', cloneDeep(data)) Object.assign(curItem, data) }) @@ -138,10 +138,12 @@ const createAi = async () => { markeDownAnswer.value = data.answer const res = await createOutlineV2({ query: data.answer }) - curItem.outline = JSON.stringify({ + let outline = JSON.stringify({ json: res.outline, markdown: data.answer }) + + Object.assign(curItem, {...curItem, outline}) emitter.emit('onResult', curItem) onSaveTemp() } finally { @@ -207,10 +209,12 @@ const onSaveTemp = async () => { createUserName: user.nickName } await addSyllabus(data) + emitter.emit('getLastInfo') } // 删除大纲 const delAnswer = () => { + if(!curItem.id) return ElMessageBox.confirm( '确定要删除大纲吗?', '温馨提示', @@ -223,8 +227,11 @@ const delAnswer = () => { .then(async () => { await removeSyllabus(curItem.id) ElMessage.success('操作成功') - answer.value = '' + markeDownAnswer.value = '' + emitter.emit('resetSelect') + + // window.location.reload(); }) .catch(() => {}) 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() }) // 点击教学模式 From f8f98b400c804c8d81d99ebec61b4adb9407fa51 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 9 Jan 2025 17:04:21 +0800 Subject: [PATCH 08/23] =?UTF-8?q?=E8=AF=AD=E9=9F=B3npm=E5=8C=85=E8=B7=9F?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f88b47e..ee99a79 100644 --- a/package.json +++ b/package.json @@ -42,7 +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", + "aix-plugins-aitools": "^1.1.0", "animate.css": "^4.1.1", "circular-json": "^0.5.9", "clipboard": "^2.0.11", From 336fbb068059dac9f719a3d969249a87ba79d29a Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 10 Jan 2025 10:35:19 +0800 Subject: [PATCH 09/23] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ai-voice/index.vue | 24 ++++++------------- .../src/components/file-image/index.vue | 1 + 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/renderer/src/components/ai-voice/index.vue b/src/renderer/src/components/ai-voice/index.vue index 617bd81..0e11a78 100644 --- a/src/renderer/src/components/ai-voice/index.vue +++ b/src/renderer/src/components/ai-voice/index.vue @@ -60,6 +60,7 @@ :key="index" :item="item" :index="index" + @on-delete="deleteSuccess" > @@ -107,6 +108,9 @@ export default { } }, methods: { + deleteSuccess(item) { + this.asyncAllFile() // 刷新资源列表 + }, auditionClick(requestData) { this.$refs.audioRef.startLoading = true aitts(requestData) @@ -137,7 +141,7 @@ export default { levelSecondId: this.uploadData.levelSecondId, fileSource: this.uploadData.fileSource, fileRoot: this.uploadData.fileRoot, - fileShowName: this.filedata.uploadTime+'音频', + fileShowName: this.filedata.uploadTime+'音频.' + this.filedata.fileSuffix, fileFlag: '素材', fileId: this.filedata.id } @@ -159,7 +163,7 @@ export default { console.log(err) this.$refs.audioRef.saveLoading = false }) - + }, asyncAllFile() { this.isLoading = true @@ -202,20 +206,6 @@ export default { // 布置推送:row 这里是单个,转为list this.rows = [row] this.setDialog = true - }, - // 删除作业 - delhomework(item) { - this.isLoading = true - delClasswork(item.id) - .then(async (res) => { - ElMessage.success('操作成功') - this.isLoading = false - await this.asyncAllFile() - this.initHomeWork() - }) - .catch(() => { - this.isLoading = false - }) } }, mounted() { @@ -247,4 +237,4 @@ export default { display: flex; flex: 1; } - \ No newline at end of file + 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', From 5b05b6a94bf057ca01599742a0fede94952bf5ce Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 10 Jan 2025 14:09:39 +0800 Subject: [PATCH 10/23] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..ff49073 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue @@ -37,7 +37,7 @@ let params = { pageSize: 500 } -const suffixAry = [ 'jpeg','jpg','png','gif','mp3','mp4','avi','mov'] +const suffixAry = [ 'jpeg','jpg','png','gif','mp3','mp4','avi','mov',"wav"] const videoSuffix = ['mp3','mp4','avi','mov'] const list = ref([]) const loading = ref(false) From a5be937eb36cb98a08526be903cf68db409efb8e Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Fri, 10 Jan 2025 14:16:18 +0800 Subject: [PATCH 11/23] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/Editor/CanvasTool/MaterialDialog.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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..29ab75a 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/MaterialDialog.vue @@ -48,6 +48,7 @@ const init = () => { if(res.rows && res.rows.length){ // 过滤出图片和视频 list.value = res.rows.filter( item => suffixAry.indexOf(getFileSuffix(item.fileShowName)) != -1) + console.log(list.value) } }) } @@ -64,12 +65,13 @@ const fileUrl = computed(() => (item) =>{ // 插入 const onInsert = async (item) =>{ loading.value = true - const res = await fetch(item.fileFullPath) - const bolb = await res.blob() - const file = commUtils.blobToFile(bolb, item.fileShowName) - + console.log('item', item) + // const res = await fetch(item.fileFullPath) + // const bolb = await res.blob() + // const file = commUtils.blobToFile(bolb, item.fileShowName) + const data=item.fileFullPath try { - const data = await PPTApi.toRousrceUrl(file) + // const data = await PPTApi.toRousrceUrl(file) if(videoSuffix.indexOf(getFileSuffix(item.fileShowName)) != -1){ emit('insertMaterial',{ type: 'video', data }) } From e40acda6ad1db804a1e4697aa4722fe0b2e9d4dc Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 10 Jan 2025 14:16:33 +0800 Subject: [PATCH 12/23] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/file.js | 5 +++++ 1 file changed, 5 insertions(+) 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() From d7c57896daa0f3866b11f217a09afec357f4f5ab Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 10 Jan 2025 14:57:20 +0800 Subject: [PATCH 13/23] =?UTF-8?q?edit=20=E6=A1=86=E6=9E=B6=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/teachingDesign/container/center.vue | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index c3d083e..97ffb8e 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -19,27 +19,6 @@ -
@@ -54,7 +33,7 @@ import EditDialog from './edit-dialog.vue' import emitter from '@/utils/mitt' import * as commUtils from '@/utils/comm.js' import { createChart, sendChart } from '@/api/ai/index' -import { completion, addSyllabus, removeSyllabus, editSyllabus } from '@/api/mode/index.js' +import { completion, addSyllabus, removeSyllabus, editSyllabus, modelList } from '@/api/mode/index.js' import { createOutlineV2 } from '@/utils/ppt-request.js' import useUserStore from '@/store/modules/user' import { cloneDeep } from 'lodash' @@ -111,12 +90,13 @@ const createAi = async () => { } let str = selectedData.value.map( item => item.name).join('、') - let bookV = curNode.roottitle.split('-')[1] + '版' + // let bookV = curNode.roottitle.split('-')[1] + '版' loading.value = true try { + params.prompt = prompt.value.replace(/{模板名称}/g, str) - params.prompt = `针对${curNode.edustage}${curNode.edusubject}${bookV}${curNode.itemtitle}这一课,根据以下教学环节:${str},进行课件教学PPT内容设计,按照幻灯片1、幻灯片2、...的格式` + //params.prompt = `针对${curNode.edustage}${curNode.edusubject}${bookV}${curNode.itemtitle}这一课,根据以下教学环节:${str},进行课件教学PPT内容设计,按照幻灯片1、幻灯片2、...的格式` // params.template = item.prompt // 教学大模型 @@ -247,12 +227,24 @@ const getChartId = () => { }) } -onUnmounted(() => { - emitter.off('selected') - emitter.off('onShow') - emitter.off('editItem') - -}) +// 查询prompt 替换 +const prompt = ref('') +const getPrompt = async () => { + const { rows } = await modelList({ model: 5 }) + + let str = rows.find(item => item.name.indexOf('框架设计') != -1).prompt + + str = str.replace('{学段}', curNode.edustage) + str = str.replace('{学科}', curNode.edusubject) + let bookV = curNode.roottitle + '版' + str = str.replace('{教材版本}', bookV) + str = str.replace('{课程名称}', `《${curNode.itemtitle}》`) + + prompt.value = str +} + + + const curNode = reactive({}) onMounted(() => { @@ -268,6 +260,16 @@ onMounted(() => { getChartId(); } + getPrompt() + +}) + + +onUnmounted(() => { + emitter.off('selected') + emitter.off('onShow') + emitter.off('editItem') + }) From 07ab1b6a848b3e9835fb30fe6fca6263f3387606 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Fri, 10 Jan 2025 15:06:38 +0800 Subject: [PATCH 14/23] =?UTF-8?q?=E6=8F=92=E5=85=A5=E7=B4=A0=E6=9D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/CanvasTool/MaterialDialog.vue | 35 +++++++++++++------ .../src/views/Editor/CanvasTool/index.vue | 2 ++ 2 files changed, 27 insertions(+), 10 deletions(-) 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 154965f..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 }}
+
- 插入 + 插入
-
+
\ No newline at end of file + diff --git a/src/renderer/src/components/template-study/container/left.vue b/src/renderer/src/components/template-study/container/left.vue index d2b9285..4cd2bdc 100644 --- a/src/renderer/src/components/template-study/container/left.vue +++ b/src/renderer/src/components/template-study/container/left.vue @@ -2,8 +2,9 @@
- {{ curNode.edustage }}{{ curNode.edusubject }}{{ type == 1 ? '课标研读' : type == 2 ? '教材分析' : '考试分析' }} + {{ curNode.edustage }}{{ curNode.edusubject + }}{{ type == 1 ? '课标研读' : type == 2 ? '教材分析' : '考试分析' + }}
@@ -20,6 +21,7 @@ import { ref, onMounted, nextTick, reactive } from 'vue' import { sessionStore } from '@/utils/store' import PDF from '@/components/PdfJs/index.vue' import LeftDialog from './left-dialog.vue' +import emitter from '@/utils/mitt' const props = defineProps(['type']) @@ -29,6 +31,12 @@ const onClick = () => { showDialog.value = true } +emitter.on('changePdfUrl', async (data) => { + pdfUrl.value = '' + await nextTick() + pdfUrl.value = data.fileUrl +}) + // 加载PDF const pdfUrl = ref('') const curNode = reactive({}) @@ -36,16 +44,15 @@ onMounted(async () => { await nextTick() // 当前节点 let nodeData = sessionStore.get('subject.curNode') - Object.assign(curNode, nodeData); + Object.assign(curNode, nodeData) let data = sessionStore.get('subject.curBook') let fileurl = data.fileurl - if(props.type == 1){ + if (props.type == 1) { fileurl = `${data.edustage}-${data.edusubject}-课标.txt` } - if(fileurl == '') return + if (fileurl == '') return pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf') - }) @@ -53,6 +60,7 @@ onMounted(async () => { .container-left-page { height: 100%; flex-direction: column; + .container-left-header { height: 45px; background: #fff; @@ -70,4 +78,4 @@ onMounted(async () => { flex: 1; } } - \ No newline at end of file + diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 543c928..e2cba23 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -16,7 +16,7 @@
- + 删除 @@ -104,6 +104,12 @@ import { cloneDeep } from 'lodash' const props = defineProps(['type']) const { user } = useUserStore() +const params = reactive( + { + prompt: '', + dataset_id: '' + } +) const curMode = ref(2) const modeOptions = ref([ { @@ -112,7 +118,8 @@ const modeOptions = ref([ }, { label: '知识库模型', - value: 2 + value: 2, + disabled: false } ]) @@ -288,12 +295,7 @@ const onEdit = (index, item) => { } // 重新研读 -const params = reactive( - { - prompt: '', - dataset_id: '' - } -) + const prompt = ref('') // 重新研读 @@ -483,7 +485,18 @@ onMounted(() => { getTemplateList() let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}` + + params.dataset_id = dataSetJson[jsonKey] + if(!params.dataset_id){ + curMode.value = 1 + modeOptions.value.forEach(item => { + if(item.value == 2){ + item.disabled = true + } + }) + } + // 获取百度千帆会话ID conversation_id.value = localStorage.getItem('conversation_id') if (!conversation_id.value) { diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index b6472fe..f3efd8b 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -22,24 +22,22 @@
- + From 5ff9a5387a2a4ee30783b4db54138ab8e23108c6 Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 15 Jan 2025 16:07:47 +0800 Subject: [PATCH 22/23] edit --- .../template-study/container/left-dialog.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/template-study/container/left-dialog.vue b/src/renderer/src/components/template-study/container/left-dialog.vue index e251cc2..678b0ca 100644 --- a/src/renderer/src/components/template-study/container/left-dialog.vue +++ b/src/renderer/src/components/template-study/container/left-dialog.vue @@ -8,6 +8,7 @@
+ @@ -51,7 +52,7 @@
-
+
@@ -97,7 +98,7 @@ const props = defineProps({ const isPrev = (item) => { return computed(() => { - return ['pdf', 'png', 'jpg', 'jpeg', 'gif'].includes(getFileSuffix(item.fileUrl)) + return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'webp'].includes(getFileSuffix(item.fileUrl)) }) } @@ -135,12 +136,14 @@ const fileList = ref([]) const curFile = reactive({}) const getList = () => { docList({ - userId: userInfo.userId, - dataset_id: dataset_id.value + createUser: userInfo.userId, + datasetId: dataset_id.value }).then((res) => { fileList.value = [...res.rows] - Object.assign(curFile, fileList.value[0]) - curFileId.value = fileList.value[0].id + if(res.rows.length){ + Object.assign(curFile, fileList.value[0]) + curFileId.value = fileList.value[0].id + } }) } From 95a80c2b9939f3d095464ac5ebd5f578a674a7eb Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 16 Jan 2025 15:00:24 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E4=B8=8D=E5=8F=91?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/api/classcourse.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/api/classcourse.ts b/src/renderer/src/AixPPTist/src/api/classcourse.ts index c92a6b6..8a4d9a1 100644 --- a/src/renderer/src/AixPPTist/src/api/classcourse.ts +++ b/src/renderer/src/AixPPTist/src/api/classcourse.ts @@ -38,12 +38,12 @@ export class Classcourse { if (isCourse) { // 连接socket ChatWs.id = classcourse.timgroupid // 群组id - if (!ChatWs.ws) { - ChatWs.init().then(_ => { - isPublic && ChatWs.sendMsg('open', {id: classcourse.id}) - // isPublic && console.log('socket-开课消息-已发送') - }) - } + // if (!ChatWs.ws) { + // ChatWs.init().then(_ => { + // isPublic && ChatWs.sendMsg('open', {id: classcourse.id}) + // // isPublic && console.log('socket-开课消息-已发送') + // }) + // } this.classcourse = classcourse // 课堂信息 this.id = classcourse.id // 课堂id // 如果课堂信息有paging,则更新当前页码