From 851a39897b48b958f1a24f65d18791d5dc58ead3 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 12 Dec 2024 16:15:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/classTask/teachClassTask.vue | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/src/renderer/src/views/classTask/teachClassTask.vue b/src/renderer/src/views/classTask/teachClassTask.vue index d0be63a..3f593ea 100644 --- a/src/renderer/src/views/classTask/teachClassTask.vue +++ b/src/renderer/src/views/classTask/teachClassTask.vue @@ -714,37 +714,39 @@ const closeDialog = () => { // im监听消息回调 const msgHandle = (msg) => { - const { type, data } = msg - switch(type) { - case MsgEnum.HEADS.MSG_closed: // 下课: + if (typeof msg === 'object'){ + const { head, content, ...other } = msg + switch(head) { + case MsgEnum.HEADS.MSG_closed: // 下课: + window.close() // 关闭窗口 + break + case MsgEnum.HEADS.MSG_finishHomework: // 跟新作业: + const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); + openDialog(data, false); + break + case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面 window.close() // 关闭窗口 - break - case MsgEnum.HEADS.MSG_finishHomework: // 跟新作业: - const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); - openDialog(data, false); - break - case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面 - window.close() // 关闭窗口 - break - // case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[] - // { - // (data||[]).forEach(o => { - // const msgArr = o?.message_elem_array||[] - // msgArr.forEach(info => { - // const msgType = info?.elem_type // 消息类型 TIMElemType - // const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : '' - // // 处理学生端反馈得消息 - // //console.log('msgData->', msgData); - // if (msgData.msgKey == "finishHomework"){ - // // 刷新 - // const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); - // //console.log('data->', data); - // openDialog(data, false); - // } - // }) - // }) - // } - // break + break + // case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[] + // { + // (data||[]).forEach(o => { + // const msgArr = o?.message_elem_array||[] + // msgArr.forEach(info => { + // const msgType = info?.elem_type // 消息类型 TIMElemType + // const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : '' + // // 处理学生端反馈得消息 + // //console.log('msgData->', msgData); + // if (msgData.msgKey == "finishHomework"){ + // // 刷新 + // const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); + // //console.log('data->', data); + // openDialog(data, false); + // } + // }) + // }) + // } + // break + } } } From c7ebc6de6598458477fe40ea23733b330d2a17c0 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 12 Dec 2024 16:37:51 +0800 Subject: [PATCH 2/3] 1 --- src/renderer/src/views/classTask/teachClassTask.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/classTask/teachClassTask.vue b/src/renderer/src/views/classTask/teachClassTask.vue index 3f593ea..2ce9561 100644 --- a/src/renderer/src/views/classTask/teachClassTask.vue +++ b/src/renderer/src/views/classTask/teachClassTask.vue @@ -719,7 +719,7 @@ const msgHandle = (msg) => { switch(head) { case MsgEnum.HEADS.MSG_closed: // 下课: window.close() // 关闭窗口 - break + break case MsgEnum.HEADS.MSG_finishHomework: // 跟新作业: const data = JSON.parse(localStorage.getItem('teachClassWorkItem')); openDialog(data, false); From 7861727e92f61e0a264ae1d049a5d6db073fe61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666> Date: Thu, 12 Dec 2024 16:39:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9pptlist?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9A=84bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/AixPPTist/src/api/index.ts | 5 +---- .../views/Editor/Toolbar/ElementStylePanel/Active/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/api/index.ts b/src/renderer/src/AixPPTist/src/api/index.ts index f54a141..611efb6 100644 --- a/src/renderer/src/AixPPTist/src/api/index.ts +++ b/src/renderer/src/AixPPTist/src/api/index.ts @@ -73,7 +73,6 @@ export class PPTApi { // 活动列表处理 const workList = (res.rows || []).map(o => o.activityContent) const workItem = [...res.rows] - // 加入活动后刷新ppt数据内容,不跟换为第一页 // slidesStore.updateSlideIndex(0) // 下标0 为第一页 slidesStore.setSlides(slides) // 写入数据 // 写入作业列表数据 @@ -110,11 +109,9 @@ export class PPTApi { const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params) if (!!rid) { data.id = rid - params.id = rid - params.activityContent = null - slidesStore.addWorkItem(params) slidesStore.updateSlide(data) // msgUtils.msgSuccess('新增成功') + PPTApi.getSlideList(resource.id) this.isUpdate = false // 新增后会触发监听,不再更新数据 resolve(true) } else msgUtils.msgError('新增失败');resolve(false) diff --git a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue index d55e688..cddd334 100644 --- a/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue +++ b/src/renderer/src/AixPPTist/src/views/Editor/Toolbar/ElementStylePanel/Active/index.vue @@ -305,10 +305,10 @@ const upDateData = async () => { // await PPTApi.updateSlide(paramData.value) loadingActive.value = true await updateEntpcoursefileNew(paramData.value) - const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 }) - await formatClassWorkFile(res.rows) const resource = sessionStore.get('curr.resource') await PPTApi.getSlideList(resource.id) + const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 }) + await formatClassWorkFile(res.rows) } // 判断是否做操作 const objectsAreEqual = (obj1: Record, obj2: Record) => {