From d40873d1985f07983a53b7c95f2a09d4e5330060 Mon Sep 17 00:00:00 2001 From: zdg Date: Thu, 17 Oct 2024 09:55:42 +0800 Subject: [PATCH 1/6] =?UTF-8?q?ppt=E4=B8=8A=E8=AF=BE=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/tool/sphere.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index d14e857..f6a78d6 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -158,7 +158,7 @@ const touchChange = (e) => { const chatChange = (type, data, ...args) => { if (type == 'createGroup') { // 创建群-监听 console.log('创建群:', data) - !!data && classManageApi.startClass(classObj.id, data) + // !!data && classManageApi.startClass(classObj.id, data) } else if (type == 'msg') { // im-chat 消息监听 if (!data) return // 没有msg数据 message_msg_id const msgId = (args||[])[0].message_msg_id From 39aa3b157ddaaca35e4138d7b9eacac5e8e0bd59 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 17 Oct 2024 10:25:55 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=95=99=E6=9D=90?= =?UTF-8?q?=E8=AF=BE=E6=A0=87=E5=88=87=E6=8D=A2=E5=90=8D=E5=AD=97=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/teach/standardAnalysis/index.vue | 19 +++++++++------- .../src/views/textbookAnalysis/index.vue | 22 +++++++++++-------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/renderer/src/views/teach/standardAnalysis/index.vue b/src/renderer/src/views/teach/standardAnalysis/index.vue index d153e26..1a63e8c 100644 --- a/src/renderer/src/views/teach/standardAnalysis/index.vue +++ b/src/renderer/src/views/teach/standardAnalysis/index.vue @@ -7,7 +7,7 @@
-
{{bookInfo ? bookInfo.bookName : ''}}
+
{{bookInfo ? bookInfo.itemtitle : ''}}
更新2024.9.10
@@ -72,7 +72,7 @@
-
{{item.bookName}}
+
{{item.itemtitle}}
@@ -173,7 +173,7 @@ const selectHandel = (value) => { } //保存json文件 const saveJSON = (data) => { - + let filename = '' // const data = { // name: 'txt', @@ -247,9 +247,12 @@ const getAllSubject = async () => { rows && rows.map(item => { if(edustage === item.edustage && item.edusubject === edusubject){ bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)} + if(item.itemgroup==="校本课程") { + bookInfo.value.avartar = item.avartar + } } if(item.fileurl !== ''){ - bookList.value.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)}) + bookList.value.push(bookInfo.value) } }) const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject) @@ -282,7 +285,7 @@ onMounted(async () => { const searchh = searchref.value.offsetHeight; listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60; } - + window.addEventListener('resize', () => { if(cardref.value && headref.value){ const cardH = cardref.value.offsetHeight; @@ -333,9 +336,9 @@ onMounted(async () => { console.log('转换后整体文字------',StartStr + midStr + EndStr); } }) - + // const isDev = process.env.NODE_ENV == 'development' - // if (isDev) + // if (isDev) // pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true) // else // pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true) @@ -552,4 +555,4 @@ onMounted(async () => { color: #ffffff; } } - \ No newline at end of file + diff --git a/src/renderer/src/views/textbookAnalysis/index.vue b/src/renderer/src/views/textbookAnalysis/index.vue index e93ab0e..f48a21c 100644 --- a/src/renderer/src/views/textbookAnalysis/index.vue +++ b/src/renderer/src/views/textbookAnalysis/index.vue @@ -7,7 +7,7 @@
-
{{bookInfo ? bookInfo.bookName: ''}}
+
{{bookInfo ? bookInfo.itemtitle: ''}}
更新2024.9.10
@@ -72,7 +72,7 @@
-
{{item.bookName}}
+
{{item.itemtitle}}
@@ -175,7 +175,7 @@ const selectHandel = (value) => { } //保存json文件 const saveJSON = (data) => { - + let filename = '' // const data = { // name: 'txt', @@ -249,7 +249,11 @@ const getAllSubject = async () => { const dataList = []; rows && rows.map((item,idx) => { if(item.fileurl !== ''){ - dataList.push({...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: item.fileurl.replace('.txt','')}) + let infos = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: item.fileurl.replace('.txt','')} + if(infos.itemgroup==="校本课程") { + infos.avartar = item.avartar + } + dataList.push(infos) } }) bookList.value = dataList @@ -265,7 +269,7 @@ const getAllSubject = async () => { bookInfo.value = {...dataList[0]} filePath += dataList[0].fileurl.replace('.txt','.pdf') } - await loadPdfAnimation(filePath) + await loadPdfAnimation(filePath) }else{ bookInfo.value = {...dataList[0]} filePath += dataList[0].fileurl.replace('.txt','.pdf') @@ -295,7 +299,7 @@ onMounted(async () => { const searchh = searchref.value.offsetHeight; listHeight.value = Math.floor(cardH) - Math.floor(headh) - Math.floor(searchh) - 60; } - + window.addEventListener('resize', () => { if(cardref.value && headref.value){ const cardH = cardref.value.offsetHeight; @@ -346,9 +350,9 @@ onMounted(async () => { console.log('转换后整体文字------',StartStr + midStr + EndStr); } }) - + // const isDev = process.env.NODE_ENV == 'development' - // if (isDev) + // if (isDev) // pdfUrl.value = '/'+getStaticUrl('aaa.pdf', 'user', 'selfFile', true) // else // pdfUrl.value = getStaticUrl(route.query.path, 'user', 'selfFile', true) @@ -570,4 +574,4 @@ onMounted(async () => { color: #ffffff; } } - \ No newline at end of file + From 670c457a9f5f8779a62c4743137d057ccbcfc0d3 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 17 Oct 2024 11:18:35 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3ppt=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/utils/ppt-request.js | 42 ++++++++++++++----- .../src/views/prepare/container/ai-ppt.vue | 10 ++--- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/utils/ppt-request.js b/src/renderer/src/utils/ppt-request.js index de0ab56..e456d75 100644 --- a/src/renderer/src/utils/ppt-request.js +++ b/src/renderer/src/utils/ppt-request.js @@ -1,27 +1,49 @@ import axios from "axios"; import { getSignature } from "./index"; import { ElMessage } from "element-plus"; +import request from '@/utils/request' let appId = "01ec9aa3"; let secret = "M2QxMDAxMjYyYTEzODMwMGRkZTQ4NmUy"; let timestamp = Math.floor(Date.now() / 1000); let signature = getSignature(appId, secret, timestamp); +let req = (url, type, data)=>{ + let config = { + headers: { + "Content-Type": "application/json", + appId: appId, + timestamp: timestamp, + signature: signature, + }, + url: url, + method: type, + } + if (type === "GET") { + config.params = data; + } else { + config.data = data; + } + return request(config) +} -const instance = axios.create({ - baseURL: "", +/*const instance = axios.create({ + // baseURL: import.meta.env.VITE_APP_ENV === "development"?"/parth":import.meta.env.VITE_APP_BASE_API, + baseURL: "/dev-api", headers: { "Content-Type": "application/json", + 'Authorization': 'Bearer ' + getToken(), appId: appId, timestamp: timestamp, signature: signature, }, -}); +});*/ const createOutline = async (data) => { console.log("createOutline data:", data); try { - const response = await instance.post( - "/parth/api/aippt/createOutline", + const response = await req( + "/api/aippt/createOutline", + "POST", data ); console.log("createOutline response:", response); @@ -36,7 +58,7 @@ const createOutline = async (data) => { }; const getBackGround = async () => { try { - const response = await instance.get("/parth/api/aippt/themeList"); + const response = await req("/api/aippt/themeList", "GET"); return response.data; } catch (error) { console.error("请求失败:", error); @@ -45,7 +67,7 @@ const getBackGround = async () => { }; const createPPT = async (data) => { try { - const response = await instance.post("/parth/api/aippt/create", data); + const response = await req("/api/aippt/create", "POST", data); console.log("createOutline response:", response); return response.data; @@ -56,7 +78,7 @@ const createPPT = async (data) => { }; const createByOutline = async (data) => { try { - const response = await instance.post("/parth/api/aippt/createByOutline", data); + const response = await req("/api/aippt/createByOutline","POST", data); console.log("createByOutline response:", response); return response.data; @@ -67,7 +89,7 @@ const createByOutline = async (data) => { }; const getProgress = async (id) => { try { - const response = await instance.get(`/parth/api/aippt/progress?sid=${id}`); + const response = await req(`/api/aippt/progress?sid=${id}`, "GET"); return response.data; } catch (error) { console.error("请求失败:", error); @@ -75,4 +97,4 @@ const getProgress = async (id) => { } }; -export { instance, createOutline, getBackGround, createPPT, getProgress, createByOutline }; +export { createOutline, getBackGround, createPPT, getProgress, createByOutline }; diff --git a/src/renderer/src/views/prepare/container/ai-ppt.vue b/src/renderer/src/views/prepare/container/ai-ppt.vue index 570e175..cefe091 100644 --- a/src/renderer/src/views/prepare/container/ai-ppt.vue +++ b/src/renderer/src/views/prepare/container/ai-ppt.vue @@ -178,7 +178,7 @@ const getBackground = () => { treeData.value = []; getBackGround().then((res) => { console.log(res); - backGroundList.value = res.data; + backGroundList.value = res; }); }; @@ -222,14 +222,14 @@ const outlineCreatePPT = () => { activeStep.value = 4 const checkProgress = () => { - getProgress(res.data.sid).then((response) => { - percentage.value = response.data.process; - if (response.data && response.data.pptUrl && response.data.pptUrl.length > 4) { + getProgress(res.sid).then((response) => { + percentage.value = response.process; + if (response && response.pptUrl && response.pptUrl.length > 4) { console.log('PPT',response) // window.location.href = response.data.pptUrl; //发消息到主进程,携带名称和URL,将URL下载下来后复制到文件列表并上传到服务 // let url = "https://bjcdn.openstorage.cn/xinghuo-privatedata/%2Ftmp/apiTempFiledf28bf990a4c40ffb7477ed4b65392c27232357022409613439/%E3%80%8A%E9%9D%99%E5%A5%B3%E3%80%8B%E6%B7%B1%E5%BA%A6%E8%A7%A3%E8%AF%BB%E4%B8%8E%E7%A0%94%E7%A9%B6.pptx" - creatAIPPT(props.currentNode.itemtitle + '.pptx',response.data.pptUrl, props.uploadData).then((res) => { + creatAIPPT(props.currentNode.itemtitle + '.pptx',response.pptUrl, props.uploadData).then((res) => { emit('addSuccess',res) }) ElMessage.success("生成成功"); From d7f17c253dde9424807c44233ffb4b9c5bd5944f Mon Sep 17 00:00:00 2001 From: zdg Date: Fri, 18 Oct 2024 16:09:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?im=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/plugins/imChat/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/plugins/imChat/index.js b/src/renderer/src/plugins/imChat/index.js index 83f007f..bb2250b 100644 --- a/src/renderer/src/plugins/imChat/index.js +++ b/src/renderer/src/plugins/imChat/index.js @@ -285,8 +285,11 @@ export class ImChat { // callback: (data) => {} } // console.log('发送消息', option) - this.setConsole('%cim-chat: 发送消息', option) - return this.timChat.TIMMsgSendMessageV2(option) + this.setConsole('%cim-chat: 发送消息【req】', conv_id, msg) + return this.timChat.TIMMsgSendMessageV2(option).then(res => { + this.setConsole('%cim-chat: 发送消息【res】', JSON.stringify(res)) + return res + }) } /** * @description 发送群消息 From 9552e75f18d04d2ea7518f6cc956a509df24c127 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 18 Oct 2024 16:31:57 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3ppt=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/main/file.js | 7 +++++-- src/renderer/src/views/teach/standardAnalysis/index.vue | 8 +++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7e2e499..75da1f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win", - "version": "2.1.9", + "version": "2.1.12", "description": "", "main": "./out/main/index.js", "author": "example.com", diff --git a/src/main/file.js b/src/main/file.js index 7612bf4..3de3333 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -246,8 +246,10 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { /*创建新的ppt文件*/ ipcMain.on('creat-ai-file-default', (e, { name, url, uploadData, cookie }) => { createFolder('tempFile').then(async () => { + let lastname = decodeURIComponent(url); + name = lastname.substring(lastname.lastIndexOf("/")+1) let path = appTempFilePath + name.replace(/[\\/:*?"<>|]/, '') - let {type,item} = await downloadFile(url,name) + let {type,item} = await downloadFiles(url,name) if (type==="成功") { let fileType = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' let formData = new FormData() @@ -279,7 +281,8 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { }) }) - function downloadFile(url,fileName) { + function downloadFiles(url,fileName) { + console.log(url,fileName) return new Promise((resolve, reject)=>{ const browserWindow = BrowserWindow.getFocusedWindow() const id = manager.download({ diff --git a/src/renderer/src/views/teach/standardAnalysis/index.vue b/src/renderer/src/views/teach/standardAnalysis/index.vue index 1a63e8c..75b027b 100644 --- a/src/renderer/src/views/teach/standardAnalysis/index.vue +++ b/src/renderer/src/views/teach/standardAnalysis/index.vue @@ -247,14 +247,12 @@ const getAllSubject = async () => { rows && rows.map(item => { if(edustage === item.edustage && item.edusubject === edusubject){ bookInfo.value = {...item,avartar: import.meta.env.VITE_APP_BUILD_BASE_PATH + item.avartar,bookName: bookNameFormat(item.edustage,item.edusubject)} - if(item.itemgroup==="校本课程") { - bookInfo.value.avartar = item.avartar + if(item.fileurl !== ''){ + bookList.value.push(bookInfo.value) } } - if(item.fileurl !== ''){ - bookList.value.push(bookInfo.value) - } }) + console.log(bookList) const textselidx = bookList.value.findIndex(item => item.edustage === edustage && item.edusubject === edusubject) booksel.value = textselidx const filePath = import.meta.env.VITE_APP_RES_FILE_PATH + bookList.value[textselidx].fileurl.replace('.txt','.pdf') From 548442f278f0bae7ce00f978fd4cdba3235f7236 Mon Sep 17 00:00:00 2001 From: zdg Date: Fri, 18 Oct 2024 17:06:08 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89im=E6=B6=88=E6=81=AF=E5=8F=91?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/tool/components/homework.vue | 2 +- src/renderer/src/views/tool/components/imChat.vue | 2 +- src/renderer/src/views/tool/sphere.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/views/tool/components/homework.vue b/src/renderer/src/views/tool/components/homework.vue index b5af42b..cdd303a 100644 --- a/src/renderer/src/views/tool/components/homework.vue +++ b/src/renderer/src/views/tool/components/homework.vue @@ -128,7 +128,7 @@ const closeHomework = async() => { const successHomework = (data)=>{ // console.log('推送成功', data) // 发送im消息-推送作业(app|平板) - ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016) + // ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016) } // 章节目录change const changeChapter = async (data)=>{ diff --git a/src/renderer/src/views/tool/components/imChat.vue b/src/renderer/src/views/tool/components/imChat.vue index f69c90a..637254c 100644 --- a/src/renderer/src/views/tool/components/imChat.vue +++ b/src/renderer/src/views/tool/components/imChat.vue @@ -12,7 +12,7 @@ const props = defineProps({ }) const imChatObj = reactive({imChat:null}) onMounted(() => { - ipcMainHandle() // 绑定-监听ipcMain im相关消息 + // ipcMainHandle() // 绑定-监听ipcMain im相关消息 }) // 初始化 im-chat const initImChat = async (timGroupId) => { diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index f6a78d6..452a63c 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -105,7 +105,7 @@ const getClassInfo = async () => { const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat if (!timGroupId) timGroupId = chat?.timGroupId if (!timGroupId) return ElMessage.error('房间创建-失败') - classManageApi.startClass(classObj.id, timGroupId) // 开始上课 + if (data.status != '上课中') classManageApi.startClass(classObj.id, timGroupId) // 开始上课 } // 切换tab-change const tabChange = (val) => {