Compare commits
6 Commits
5771533039
...
fb3ffd5dda
Author | SHA1 | Date |
---|---|---|
白了个白 | fb3ffd5dda | |
zhangxuelin | 69bfc68b28 | |
zhangxuelin | 590b318757 | |
CYS | 4421ee7fea | |
cys | 19ef95447c | |
baigl | 25b6da7f26 |
|
@ -82,6 +82,8 @@ export class MsgEnum {
|
||||||
MSG_classcourseopen : 'classcourseopen',
|
MSG_classcourseopen : 'classcourseopen',
|
||||||
/** @desc: 学生的测练结果反馈 */
|
/** @desc: 学生的测练结果反馈 */
|
||||||
MSG_classquizfeedback : 'classquizfeedback',
|
MSG_classquizfeedback : 'classquizfeedback',
|
||||||
|
/** @desc: 学生提交作业 */
|
||||||
|
MSG_finishHomework : 'finishHomework',
|
||||||
/** @desc: 老师端:接收到学生反馈消息-课堂测练中的其他任务 */
|
/** @desc: 老师端:接收到学生反馈消息-课堂测练中的其他任务 */
|
||||||
MSG_classtaskfeedback : 'classtaskfeedback',
|
MSG_classtaskfeedback : 'classtaskfeedback',
|
||||||
/** @desc: 老师端:学生反馈的消息,具体要看其中的feedbackkey,类别较繁杂 */
|
/** @desc: 老师端:学生反馈的消息,具体要看其中的feedbackkey,类别较繁杂 */
|
||||||
|
|
|
@ -395,6 +395,6 @@ export const dataSetJson = {
|
||||||
"课标-高中-英语": "e889fcac9fd011efb22a0242ac140006",
|
"课标-高中-英语": "e889fcac9fd011efb22a0242ac140006",
|
||||||
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
|
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
|
||||||
"课标-高中-地理": "270516829fd111efb13c0242ac140006",
|
"课标-高中-地理": "270516829fd111efb13c0242ac140006",
|
||||||
"课标-高中-政治": "a7df2b01aafd11ef8bb40242ac140002",
|
"课标-高中-政治": "a2f0b247b85d11ef84290242ac140005",
|
||||||
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
|
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
|
||||||
}
|
}
|
|
@ -162,9 +162,10 @@ import ItemDialogScore from '@/views/classTask/container/classTask/item-dialog-s
|
||||||
import quizStats from '@/views/classTask/container/quizStats.vue'
|
import quizStats from '@/views/classTask/container/quizStats.vue'
|
||||||
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
||||||
import {sessionStore} from '@/utils/store'
|
import {sessionStore} from '@/utils/store'
|
||||||
import Chat from '@/utils/chat' // im 登录初始化
|
// import Chat from '@/utils/chat' // im 登录初始化
|
||||||
|
import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举
|
||||||
|
import ChatWs from '@/plugins/socket' // 聊天socket
|
||||||
|
if (!ChatWs.ws) ChatWs.init()
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const emit = defineEmits(['cle-click'])
|
const emit = defineEmits(['cle-click'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -715,25 +716,35 @@ const closeDialog = () => {
|
||||||
const msgHandle = (msg) => {
|
const msgHandle = (msg) => {
|
||||||
const { type, data } = msg
|
const { type, data } = msg
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[]
|
case MsgEnum.HEADS.MSG_closed: // 下课:
|
||||||
{
|
window.close() // 关闭窗口
|
||||||
(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 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,12 +761,22 @@ onMounted(() => {
|
||||||
isReloadTimer();
|
isReloadTimer();
|
||||||
|
|
||||||
// im监听消息
|
// im监听消息
|
||||||
if (!Chat.imChat) {
|
if (ChatWs.ws) {
|
||||||
Chat.init(true, true, msgHandle);
|
ChatWs.watch((msg, e) => {
|
||||||
} else {
|
try {
|
||||||
Chat.listenMsg(msgHandle);
|
msgHandle(JSON.parse(msg))
|
||||||
|
} catch (error) {
|
||||||
|
console.error('socket 解析异常 ', error, e)
|
||||||
|
msgHandle(msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// if (!Chat.imChat) {
|
||||||
|
// Chat.init(true, true, msgHandle);
|
||||||
|
// } else {
|
||||||
|
// Chat.listenMsg(msgHandle);
|
||||||
|
// }
|
||||||
|
})
|
||||||
const isReloadTimer = () =>{
|
const isReloadTimer = () =>{
|
||||||
clearInterval(reloadTimer.value) // 关闭定时器
|
clearInterval(reloadTimer.value) // 关闭定时器
|
||||||
// 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
// 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
||||||
|
|
Loading…
Reference in New Issue