From ca93eb72acac1042a81108ae48a8678f51ad9902 Mon Sep 17 00:00:00 2001 From: zdg Date: Thu, 12 Dec 2024 12:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=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/types.ts | 6 +++++- src/renderer/src/AixPPTist/src/api/watcher.ts | 11 +++++++---- src/renderer/src/plugins/imChat/msgEnum.js | 10 ++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/renderer/src/AixPPTist/src/api/types.ts b/src/renderer/src/AixPPTist/src/api/types.ts index c8ba828..39ec3be 100644 --- a/src/renderer/src/AixPPTist/src/api/types.ts +++ b/src/renderer/src/AixPPTist/src/api/types.ts @@ -121,7 +121,11 @@ export class MsgEnum { /** @desc: 课堂讲授活动,选择不同的内容 */ MSG_classlecturePagesrc : 'classlecturePagesrc', /** @desc: 课堂作业|活动 */ - MSG_homework : 'homework', + MSG_homework : 'HOMEWORK', + /** @desc: 点赞 */ + MSG_dz : 'dz', + /** @desc: 疑惑 */ + MSG_yh : 'yh', // === 新定义-消息头 === /** @desc: 课程创建-待开课 */ MSG_0000: 0x0000, diff --git a/src/renderer/src/AixPPTist/src/api/watcher.ts b/src/renderer/src/AixPPTist/src/api/watcher.ts index 4547fd8..aee4d48 100644 --- a/src/renderer/src/AixPPTist/src/api/watcher.ts +++ b/src/renderer/src/AixPPTist/src/api/watcher.ts @@ -11,6 +11,7 @@ import ChatWs from '@/plugins/socket' // 聊天socket import Classcourse from './classcourse' // 课程相关 import msgUtils from '@/plugins/modal' // 消息工具 import { Homework } from './index' // api-作业相关 +import emitter from '@/utils/mitt' //mitt 事件总线 /** * @description 监听器 @@ -85,15 +86,17 @@ export default () => { slidesStore.updateSlideIndex(slideIndex) // 更新幻灯片下标 break case MsgEnum.HEADS.MSG_homework: // 作业|活动-布置 - if (!content.id) return - Homework.showHomework(content.id) + if (!content.classWorkId) return + Homework.showHomework(content.classWorkId) break case MsgEnum.HEADS.MSG_closed: // 下课: close() break - case MsgEnum.HEADS.MSG_0001: // 点赞 + case MsgEnum.HEADS.MSG_dz: // 点赞 + emitter.emit('upvoteTrigger', 1) break - case MsgEnum.HEADS.MSG_0002: // 疑惑 + case MsgEnum.HEADS.MSG_yh: // 疑惑 + emitter.emit('upvoteTrigger', 2) break case MsgEnum.HEADS.MSG_0010: // 备用 break diff --git a/src/renderer/src/plugins/imChat/msgEnum.js b/src/renderer/src/plugins/imChat/msgEnum.js index b509800..e921ff6 100644 --- a/src/renderer/src/plugins/imChat/msgEnum.js +++ b/src/renderer/src/plugins/imChat/msgEnum.js @@ -95,7 +95,11 @@ export class MsgEnum { /** @desc: 课堂讲授活动,选择不同的内容 */ MSG_classlecturePagesrc : 'classlecturePagesrc', /** @desc: 课堂作业|活动 */ - MSG_homework : 'homework', + MSG_homework : 'HOMEWORK', + /** @desc: 点赞 */ + MSG_dz : 'dz', + /** @desc: 疑惑 */ + MSG_yh : 'yh', // === 新定义-消息头 === /** @desc: 课程创建-待开课 */ MSG_0000: 0x0000, @@ -138,6 +142,4 @@ export class MsgEnum { MSG_0034: 0x0022, MSG_0035: 0x0023, } -} - -export { MsgEnum as default } \ No newline at end of file +} \ No newline at end of file