From 0beae0b035dcc76a0dc32604b88f30f03ef0a1ae Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 13 Feb 2025 14:25:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=89=93=E5=AD=97=E6=9C=BA=E6=95=88?= =?UTF-8?q?=E7=8E=87=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template-study/container/right.vue | 19 +++++++++++++++---- .../src/components/typing-effect/index.vue | 19 ++++++++++++++++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index e2cba23..a0efe23 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -23,7 +23,7 @@ - 添加提示词 + {{curTemplate.ex3 === '1' ? '复制并创建个人模板' : '添加提示词'}} 一键研读 @@ -120,6 +120,10 @@ const modeOptions = ref([ label: '知识库模型', value: 2, disabled: false + }, + { + label: 'deepseek模型', + value: 3 } ]) @@ -134,7 +138,7 @@ const modeOptions = ref([ const isWordDialog = ref(false) const editItem = reactive({}) const onAdd = () => { - + console.log(curTemplate) Object.assign(editItem, curTemplate) editItem.isAdd = true isWordDialog.value = true @@ -333,6 +337,9 @@ const againResult = async (index, item) => { }) data = res.data } else { + if (curMode.value == 3) { + params.llm = 'deepseek-r1:8b' + } // 知识库模型 const res = await completion(params) data = res.data @@ -381,6 +388,9 @@ const getCompletion = async () => { } // 知识库模型 else { + if (curMode.value == 3) { + params.llm = 'deepseek-r1:8b' + } const res = await completion(params) data = res.data } @@ -439,6 +449,7 @@ const onSaveTemp = async (item) => { // 去掉字符串中的 ### ** let getResult = (str) => { let newStr = str.replace(/#+|(\*\*)/g, ''); + newStr = newStr.replace(/[\s\S]*?<\/think>/g, ''); return newStr } @@ -485,8 +496,8 @@ onMounted(() => { getTemplateList() let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}` - - + + params.dataset_id = dataSetJson[jsonKey] if(!params.dataset_id){ curMode.value = 1 diff --git a/src/renderer/src/components/typing-effect/index.vue b/src/renderer/src/components/typing-effect/index.vue index 2438ce0..d707a45 100644 --- a/src/renderer/src/components/typing-effect/index.vue +++ b/src/renderer/src/components/typing-effect/index.vue @@ -40,9 +40,22 @@ const type = async () => { displayedText.value = props.text return } + //限制多久内打印完ms + let allLength = props.text.length + let allTime = 3000 + let addIndex = allLength/(allTime/props.delay); + //一次添加5个字符 + for (let i = 0; i < addIndex; i++) { + if (index.value <= allLength) { + displayedText.value += props.text.charAt(index.value); + index.value++; + } else { + break; + } + } if (index.value <= props.text.length) { - displayedText.value += props.text.charAt(index.value); - index.value++; + // displayedText.value += props.text.charAt(index.value); + // index.value++; setTimeout(() => { type(); emit('updateScroll', typingEffectRef.value.clientHeight); // 每次添加新字符后滚动到底部 @@ -74,4 +87,4 @@ watch([() => props.text, () => props.delay], resetAndType); :deep(.el-textarea__inner:hover){ box-shadow: none; } - \ No newline at end of file + From 0b2ed540b82be28cb302e62c6096b8f5b1ec665f Mon Sep 17 00:00:00 2001 From: zdg Date: Fri, 14 Feb 2025 16:35:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=201.=E4=B8=8A=E8=AF=BE?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=97=A0=E6=B3=95=E6=8E=A7=E5=88=B6=202.ppt?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=9B=BE=E7=89=87=E8=BF=9C=E7=A8=8B=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AixPPTist/src/views/Screen/ScreenSlideList.vue | 1 + .../src/views/Screen/hooks/useExecPlay.ts | 3 ++- src/renderer/src/views/model/index.vue | 14 ++++++++++---- src/renderer/src/views/prepare/index.vue | 14 ++++++++++---- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/views/Screen/ScreenSlideList.vue b/src/renderer/src/AixPPTist/src/views/Screen/ScreenSlideList.vue index 1b0b4c7..4b69c8a 100644 --- a/src/renderer/src/AixPPTist/src/views/Screen/ScreenSlideList.vue +++ b/src/renderer/src/AixPPTist/src/views/Screen/ScreenSlideList.vue @@ -80,6 +80,7 @@ provide(injectKeySlideScale, scale) position: relative; width: 100%; height: 100%; + overflow: hidden; } .slide-item { position: absolute; diff --git a/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts b/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts index abccbfd..49c6ba7 100644 --- a/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts +++ b/src/renderer/src/AixPPTist/src/views/Screen/hooks/useExecPlay.ts @@ -198,7 +198,7 @@ export default (isLoader?: boolean = true) => { const touchInfo = ref<{ x: number; y: number; } | null>(null) const touchStartListener = (e: TouchEvent) => { - e.preventDefault() // 阻止默认事件 + // e.preventDefault() // 阻止默认事件 touchInfo.value = { // x: e.changedTouches[0].pageX, // y: e.changedTouches[0].pageY, @@ -208,6 +208,7 @@ export default (isLoader?: boolean = true) => { } const touchEndListener = (e: TouchEvent) => { if (!touchInfo.value) return + // window.scrollTo(0, 0) // 滚动到顶部 const offsetX = Math.abs(touchInfo.value.x - e.changedTouches[0].clientX) const offsetY = e.changedTouches[0].clientY - touchInfo.value.y if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) { diff --git a/src/renderer/src/views/model/index.vue b/src/renderer/src/views/model/index.vue index 6ceca61..fb4da79 100644 --- a/src/renderer/src/views/model/index.vue +++ b/src/renderer/src/views/model/index.vue @@ -438,17 +438,23 @@ const toRousrceUrl = async (o) => { if (!!o.src) { // 如果有src就转换 const isBase64 = /^data:image\/(\w+);base64,/.test(o.src) const isBlobUrl = /^blob:/.test(o.src) - let onLineUrl = '' // 线上地址 - if (!!o.zipPath) onLineUrl = pptMedia[o.zipPath] || '' // 是否已上传过 + let onLineUrl = '', typeExt = '' // 线上地址|文件后缀 + if (!!o.zipPath) { + onLineUrl = pptMedia[o.zipPath] || '' // 是否已上传过 + typeExt = o.zipPath.split('.').pop() + } if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值 else { // 不存在重新上传 if (isBase64) { // 相同资源处理 - const url = await getOnlineFileUrl(o.src) + if(!typeExt) typeExt = 'png' + const url = await getOnlineFileUrl(o.src, typeExt) + url &&(o.src = url) url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存 } else if (isBlobUrl) { // 视频和音频 + if(!typeExt) typeExt = o.type=='video'?'mp4':'mp3' const res = await fetch(o.src) const blob = await res.blob() - const url = await getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3') + const url = await getOnlineFileUrl(blob, typeExt) URL.revokeObjectURL(o.src) // 释放内存 url &&(o.src = url) url && o.zipPath && (pptMedia[o.zipPath] = url) // 缓存 diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 444a4bb..da54074 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -653,17 +653,23 @@ export default { if (!!o.src) { // 如果有src就转换 const isBase64 = /^data:image\/(\w+);base64,/.test(o.src) const isBlobUrl = /^blob:/.test(o.src) - let onLineUrl = '' // 线上地址 - if (!!o.zipPath) onLineUrl = this.pptMedia[o.zipPath] || '' // 是否已上传过 + let onLineUrl = '', typeExt = '' // 线上地址|文件后缀 + if (!!o.zipPath) { + onLineUrl = this.pptMedia[o.zipPath] || '' // 是否已上传过 + typeExt = o.zipPath.split('.').pop() + } if (onLineUrl) o.src = onLineUrl // 已存在线上地址直接赋值 else { // 不存在重新上传 if (isBase64) { // 相同资源处理 - const url = await this.getOnlineFileUrl(o.src) + if(!typeExt) typeExt = 'png' + const url = await this.getOnlineFileUrl(o.src, typeExt) + url &&(o.src = url) url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存 } else if (isBlobUrl) { // 视频和音频 + if(!typeExt) typeExt = o.type=='video'?'mp4':'mp3' const res = await fetch(o.src) const blob = await res.blob() - const url = await this.getOnlineFileUrl(blob, o.type=='video'?'mp4':'mp3') + const url = await this.getOnlineFileUrl(blob, typeExt) URL.revokeObjectURL(o.src) // 释放内存 url &&(o.src = url) url && o.zipPath && (this.pptMedia[o.zipPath] = url) // 缓存 From cbb3971c9b6bd4f5e5bb32458604f93e70d637aa Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Mon, 17 Feb 2025 09:37:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7d5b681..d95a19e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win-ws", - "version": "2.5.17", + "version": "2.5.18", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", @@ -141,4 +141,4 @@ "vue-tsc": "^1.8.25", "windicss": "^3.5.6" } -} +} \ No newline at end of file