ppt上课

This commit is contained in:
zdg 2024-12-12 16:24:47 +08:00
parent 354e0b44c9
commit 03f160464c
5 changed files with 22 additions and 11 deletions

View File

@ -8,6 +8,7 @@ import * as useStore from '../store' // pptist-状态管理
import ChatWs from '@/plugins/socket' // 聊天socket import ChatWs from '@/plugins/socket' // 聊天socket
import msgUtils from '@/plugins/modal' // 消息工具 import msgUtils from '@/plugins/modal' // 消息工具
const slidesStore = store.useSlidesStore() // 幻灯片-状态管理
const screenStore = useStore.useScreenStore() // 全屏-状态管理 const screenStore = useStore.useScreenStore() // 全屏-状态管理
const classcourseStore = useStore.useClasscourseStore() // 课堂信息-状态管理 const classcourseStore = useStore.useClasscourseStore() // 课堂信息-状态管理
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息 const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
@ -32,10 +33,13 @@ export class Classcourse {
// 连接socket // 连接socket
if (!ChatWs.ws) ChatWs.init() if (!ChatWs.ws) ChatWs.init()
ChatWs.id = classcourse.timgroupid // 群组id ChatWs.id = classcourse.timgroupid // 群组id
console.log('ws- ', classcourse)
this.classcourse = classcourse // 课堂信息 this.classcourse = classcourse // 课堂信息
this.id = classcourse.id // 课堂id this.id = classcourse.id // 课堂id
classcourseStore.setClasscourse(classcourse) // 课堂信息-状态管理 // 如果课堂信息有paging则更新当前页码
const isPaging = !!classcourse.paging||classcourse.paging==0
if (isPaging) slidesStore.updateSlideIndex(classcourse.paging)
// 课堂信息-状态管理
classcourseStore.setClasscourse(classcourse)
// 待上课提示 // 待上课提示
if (!classcourse.status) { if (!classcourse.status) {
this.msgObj = { this.msgObj = {

View File

@ -143,3 +143,5 @@ export class MsgEnum {
MSG_0035: 0x0023, MSG_0035: 0x0023,
} }
} }
export default MsgEnum;

View File

@ -14,8 +14,8 @@
<el-button size="small" type="primary" :icon="ChatDotRound" @click="chatSend()">上课(APP)</el-button> <el-button size="small" type="primary" :icon="ChatDotRound" @click="chatSend()">上课(APP)</el-button>
</template> </template>
<template v-else-if="item.status === 'open'"> <template v-else-if="item.status === 'open'">
<!-- <el-button :disabled="toolStore.isToolWin" size="small" type="primary" @click="startClassR(item)" <el-button :disabled="toolStore.isToolWin" size="small" type="primary" @click="startClassR(item)"
>继续上课</el-button> --> >继续上课</el-button>
<!--<el-button v-if="item.status === '未开始'" @click="openEdit">编辑</el-button>--> <!--<el-button v-if="item.status === '未开始'" @click="openEdit">编辑</el-button>-->
<el-button :loading="loading" size="small" type="info" @click="endClassR(item)" <el-button :loading="loading" size="small" type="info" @click="endClassR(item)"
>下课{{ loading?'中...':'' }}</el-button> >下课{{ loading?'中...':'' }}</el-button>

View File

@ -146,6 +146,7 @@ const open = async (id, classObj) => {
await getAptInfo(id) await getAptInfo(id)
// //
getClassList() getClassList()
console.log('classObj', classObj)
// //
if (!!classObj) { if (!!classObj) {
dt.ctCourse = classObj dt.ctCourse = classObj
@ -304,11 +305,11 @@ const classTeachingStart = async () => {
const { classcourseid:id } = teacherForm.form const { classcourseid:id } = teacherForm.form
if (id) { // if (id) { //
// -pptList // -pptList
if (myClassActive.value.filetype == 'aptist') { if (myClassActive.value.filetype == 'aippt') {
const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0}) const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0})
setTimeout(async () => { setTimeout(async () => {
msgEl.close() msgEl.close()
const res = await Http_Classcourse.getClasscourse(teacherForm.form.classcourseid) const res = await Http_Classcourse.getClasscourse(id)
openPublicScreen(res.data) openPublicScreen(res.data)
}, 2000); }, 2000);
}else { }else {
@ -316,6 +317,8 @@ const classTeachingStart = async () => {
toLinkWeb(url) // web- toLinkWeb(url) // web-
visible.value = false // visible.value = false //
} }
} else {
ElMessage.warning('请先创建课程')
} }
} }
// //
@ -354,9 +357,11 @@ const getQrUrl = async() => {
// //
const openPublicScreen = (classcourse) => { const openPublicScreen = (classcourse) => {
console.log('打开公屏', classcourse) console.log('打开公屏', classcourse)
// app if (!dt.ctCourse) { // -
const data = { id: classcourse.id } // app
ChatWs.sendMsg(MsgEnum.HEADS.MSG_0000, data, {}, ChatWs.TYPES.single, userStore.id) const data = { id: classcourse.id }
ChatWs.sendMsg(MsgEnum.HEADS.MSG_0000, data, {}, ChatWs.TYPES.single, userStore.id)
}
// //
const resource = toRaw(myClassActive.value) const resource = toRaw(myClassActive.value)
sessionStore.set('curr.resource', resource) // sessionStore.set('curr.resource', resource) //

View File

@ -196,7 +196,7 @@ export default {
} }
},*/ },*/
clickStartClass(item) { clickStartClass(item) {
const isApt = item.fileFlag === 'apt' const isApt = ['apt','aippt'].includes(item.fileFlag)
this.getOpenCourse(isApt).then(res => { this.getOpenCourse(isApt).then(res => {
console.log(res) console.log(res)
if(!res){ if(!res){