pptlist公屏上课
This commit is contained in:
parent
ff6fab0bcc
commit
dfc10aebbe
|
@ -4,12 +4,16 @@
|
||||||
|
|
||||||
import ChatWs from '@/plugins/socket' // 聊天socket
|
import ChatWs from '@/plugins/socket' // 聊天socket
|
||||||
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
|
import { useClasscourseStore } from '../store'
|
||||||
import * as API_classcourse from '@/api/teaching/classcourse' // 后端api
|
import * as API_classcourse from '@/api/teaching/classcourse' // 后端api
|
||||||
|
import { MsgEnum } from './types'
|
||||||
|
// import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
|
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
|
||||||
const courseId = classcourse?.id // 课堂id
|
const courseId = classcourse?.id // 课堂id
|
||||||
const timgroupid = classcourse?.timgroupid // 群组id
|
const timgroupid = classcourse?.timgroupid // 群组id
|
||||||
|
const classcourseStore = useClasscourseStore() // 课堂信息-状态管理
|
||||||
if (!ChatWs.ws) ChatWs.init()
|
if (!ChatWs.ws) ChatWs.init()
|
||||||
// 开课消息
|
// 开课消息
|
||||||
const startCourse = async() => {
|
const startCourse = async() => {
|
||||||
|
@ -20,12 +24,31 @@ export default () => {
|
||||||
// 下课消息
|
// 下课消息
|
||||||
const exitCourse = async() => {
|
const exitCourse = async() => {
|
||||||
if(!timgroupid) throw new Error('未获取到群组ID')
|
if(!timgroupid) throw new Error('未获取到群组ID')
|
||||||
await API_classcourse.updateClasscourse({ id: classcourse.id, status: 'closed' })
|
await API_classcourse.updateClasscourse({ id: courseId, status: 'closed' })
|
||||||
return ChatWs.closedCourse(timgroupid)
|
return ChatWs.closedCourse(timgroupid)
|
||||||
}
|
}
|
||||||
|
// 翻页消息
|
||||||
|
const slideFlapping = (msg:object) => {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
const isWs = !!ChatWs.ws && ChatWs.ws.readyState === 1 // 是否有socket连接
|
||||||
|
if(!timgroupid) return reject('未获取到群组ID')
|
||||||
|
else if(!isWs) return reject('信异常,请重试!')
|
||||||
|
const {current: paging, animation: cartoonTimes} = msg || {}
|
||||||
|
const head = MsgEnum.HEADS.MSG_slideFlapping
|
||||||
|
ChatWs.sendMsg(head, msg) // 发送消息
|
||||||
|
API_classcourse.setPaging({ id: courseId, paging, cartoonTimes})
|
||||||
|
// 更新本地缓存
|
||||||
|
sessionStore.set('curr.classcourse.paging', paging)
|
||||||
|
sessionStore.set('curr.classcourse.cartoonTimes', cartoonTimes)
|
||||||
|
classcourseStore.classcourse.paging = paging
|
||||||
|
classcourseStore.classcourse.cartoonTimes = cartoonTimes
|
||||||
|
return resolve(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
exitCourse,
|
|
||||||
classcourse,
|
|
||||||
groupid: timgroupid,
|
groupid: timgroupid,
|
||||||
|
classcourse,
|
||||||
|
exitCourse,
|
||||||
|
slideFlapping,
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -40,9 +40,8 @@ export class Classcourse {
|
||||||
ChatWs.id = classcourse.timgroupid // 群组id
|
ChatWs.id = classcourse.timgroupid // 群组id
|
||||||
if (!ChatWs.ws) {
|
if (!ChatWs.ws) {
|
||||||
ChatWs.init().then(_ => {
|
ChatWs.init().then(_ => {
|
||||||
console.log('socket-加载成功')
|
|
||||||
isPublic && ChatWs.sendMsg('open', {id: classcourse.id})
|
isPublic && ChatWs.sendMsg('open', {id: classcourse.id})
|
||||||
isPublic && console.log('socket-开课消息-已发送')
|
// isPublic && console.log('socket-开课消息-已发送')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.classcourse = classcourse // 课堂信息
|
this.classcourse = classcourse // 课堂信息
|
||||||
|
@ -53,7 +52,7 @@ export class Classcourse {
|
||||||
// 如果课堂信息有paging,则更新动画播放状态
|
// 如果课堂信息有paging,则更新动画播放状态
|
||||||
const isAnim = !!cartoonTimes || cartoonTimes === 0
|
const isAnim = !!cartoonTimes || cartoonTimes === 0
|
||||||
if (isPaging) slidesStore.updateSlideIndex(paging)
|
if (isPaging) slidesStore.updateSlideIndex(paging)
|
||||||
if (isAnim) slidesStore.updateAnimationIndex(cartoonTimes+1)
|
if (isAnim) slidesStore.updateAnimationIndex(cartoonTimes)
|
||||||
// 课堂信息-状态管理
|
// 课堂信息-状态管理
|
||||||
classcourseStore.setClasscourse(classcourse)
|
classcourseStore.setClasscourse(classcourse)
|
||||||
// 待上课提示
|
// 待上课提示
|
||||||
|
|
|
@ -124,6 +124,8 @@ export class MsgEnum {
|
||||||
MSG_classlecturePagesrc : 'classlecturePagesrc',
|
MSG_classlecturePagesrc : 'classlecturePagesrc',
|
||||||
/** @desc: 课堂作业|活动 */
|
/** @desc: 课堂作业|活动 */
|
||||||
MSG_homework : 'HOMEWORK',
|
MSG_homework : 'HOMEWORK',
|
||||||
|
/** @desc: 公屏 - 课堂作业|活动 */
|
||||||
|
MSG_pushSreen_work : 'pushSreen-work',
|
||||||
/** @desc: 点赞 */
|
/** @desc: 点赞 */
|
||||||
MSG_dz : 'dz',
|
MSG_dz : 'dz',
|
||||||
/** @desc: 疑惑 */
|
/** @desc: 疑惑 */
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default () => {
|
||||||
const classcourseStore = store.useClasscourseStore() // 课堂信息-状态管理
|
const classcourseStore = store.useClasscourseStore() // 课堂信息-状态管理
|
||||||
const resource = sessionStore.get('curr.resource') // apt 资源
|
const resource = sessionStore.get('curr.resource') // apt 资源
|
||||||
const smarttalk = sessionStore.get('curr.smarttalk') // 备课资源
|
const smarttalk = sessionStore.get('curr.smarttalk') // 备课资源
|
||||||
const { execNext, turnPrevSlide } = useExecPlay()
|
const { execNext, turnPrevSlide } = useExecPlay(false) // 不加载钩子
|
||||||
// 监听幻灯片内容变化
|
// 监听幻灯片内容变化
|
||||||
watch(() => slidesStore.slides, (newVal, oldVal) => {
|
watch(() => slidesStore.slides, (newVal, oldVal) => {
|
||||||
PPTApi.updateSlides(newVal, oldVal) // 更新幻灯片内容
|
PPTApi.updateSlides(newVal, oldVal) // 更新幻灯片内容
|
||||||
|
@ -103,9 +103,10 @@ export default () => {
|
||||||
else if (type === 'Previoustep') turnPrevSlide() // 上一步清空-动画
|
else if (type === 'Previoustep') turnPrevSlide() // 上一步清空-动画
|
||||||
else slidesStore.updateSlideIndex(slideIndex) // 更新幻灯片下标
|
else slidesStore.updateSlideIndex(slideIndex) // 更新幻灯片下标
|
||||||
break
|
break
|
||||||
case MsgEnum.HEADS.MSG_homework: // 作业|活动-布置
|
// case MsgEnum.HEADS.MSG_homework: // 作业|活动-布置 不处理
|
||||||
if (!content.classWorkId) return
|
case MsgEnum.HEADS.MSG_pushSreen_work: // 打开-作业|活动
|
||||||
Homework.showHomework(content.classWorkId)
|
if (!content.id) return
|
||||||
|
Homework.showHomework(content.id)
|
||||||
break
|
break
|
||||||
case MsgEnum.HEADS.MSG_closed: // 下课:
|
case MsgEnum.HEADS.MSG_closed: // 下课:
|
||||||
close()
|
close()
|
||||||
|
|
|
@ -6,10 +6,13 @@ import { KEYS } from '../../../configs/hotkey'
|
||||||
import { ANIMATION_CLASS_PREFIX } from '../../../configs/animation'
|
import { ANIMATION_CLASS_PREFIX } from '../../../configs/animation'
|
||||||
import message from '../../../utils/message'
|
import message from '../../../utils/message'
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import ChatWs from '@/plugins/socket' // 聊天socket
|
import Chat from '../../../api/chat' // 聊天封装
|
||||||
import { MsgEnum } from '../../../api/types' // 消息枚举
|
// import ChatWs from '@/plugins/socket' // 聊天socket
|
||||||
|
// import { MsgEnum } from '../../../api/types' // 消息枚举
|
||||||
|
|
||||||
export default () => {
|
export default (isLoader?: boolean = true) => {
|
||||||
|
// isLoader 是否执行 onMounted, onUnmounted
|
||||||
|
const chatApi = Chat()
|
||||||
const slidesStore = useSlidesStore()
|
const slidesStore = useSlidesStore()
|
||||||
const classcourseStore = useClasscourseStore() // 课堂信息-状态管理
|
const classcourseStore = useClasscourseStore() // 课堂信息-状态管理
|
||||||
const { slides, slideIndex, formatedAnimations, animationIndex } = storeToRefs(slidesStore)
|
const { slides, slideIndex, formatedAnimations, animationIndex } = storeToRefs(slidesStore)
|
||||||
|
@ -73,7 +76,7 @@ export default () => {
|
||||||
elRef.addEventListener('animationend', handleAnimationEnd, { once: true })
|
elRef.addEventListener('animationend', handleAnimationEnd, { once: true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isLoader) { // 加载相关钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const firstAnimations = formatedAnimations.value[0]
|
const firstAnimations = formatedAnimations.value[0]
|
||||||
if (firstAnimations && firstAnimations.animations.length) {
|
if (firstAnimations && firstAnimations.animations.length) {
|
||||||
|
@ -81,6 +84,7 @@ export default () => {
|
||||||
if (autoExecFirstAnimations) runAnimation()
|
if (autoExecFirstAnimations) runAnimation()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 撤销元素动画,除了将索引前移外,还需要清除动画状态
|
// 撤销元素动画,除了将索引前移外,还需要清除动画状态
|
||||||
const revokeAnimation = () => {
|
const revokeAnimation = () => {
|
||||||
|
@ -144,7 +148,6 @@ export default () => {
|
||||||
inAnimation.value = false
|
inAnimation.value = false
|
||||||
}
|
}
|
||||||
const execNext = (isAsync: boolean) => {
|
const execNext = (isAsync: boolean) => {
|
||||||
console.log('execNext', isAsync)
|
|
||||||
if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {
|
if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {
|
||||||
runAnimation(isAsync)
|
runAnimation(isAsync)
|
||||||
}
|
}
|
||||||
|
@ -211,16 +214,16 @@ export default () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 向上翻页/向下翻页
|
// 向上翻页/向下翻页
|
||||||
const turning = (e, type) => {
|
const turning = async (e, type) => {
|
||||||
e.preventDefault() // 阻止默认事件
|
e.preventDefault() // 阻止默认事件
|
||||||
if (type === 'prev') execPrev()
|
if (type === 'prev') execPrev()
|
||||||
else if (type === 'next') execNext()
|
else if (type === 'next') execNext()
|
||||||
// 发送sokcet消息
|
if (classcourseStore.classcourse) { // 上课中
|
||||||
const isSend = classcourseStore.classcourse && !!ChatWs.ws && ChatWs.ws.readyState === 1
|
const current = slideIndex.value
|
||||||
console.log('isSend', isSend, ChatWs.ws.readyState)
|
const animation = animationIndex.value
|
||||||
if (isSend) { // 有课堂信息,发送,没有就是编辑状态
|
const animationSteps = type == 'next'?'Nextsteps':'Previoustep'
|
||||||
// const head = MsgEnum.HEADS.MSG_slideFlapping
|
const msg = { current, animation, animationSteps}
|
||||||
// ChatWs.sendMsg(head, {type})
|
chatApi.slideFlapping(msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 快捷键翻页
|
// 快捷键翻页
|
||||||
|
@ -236,9 +239,10 @@ export default () => {
|
||||||
key === KEYS.PAGEDOWN
|
key === KEYS.PAGEDOWN
|
||||||
) turning(e, 'next')
|
) turning(e, 'next')
|
||||||
}
|
}
|
||||||
|
if (isLoader) { // 加载相关钩子
|
||||||
onMounted(() => {document.addEventListener('keydown', keydownListener)})
|
onMounted(() => {document.addEventListener('keydown', keydownListener)})
|
||||||
onUnmounted(() => {document.removeEventListener('keydown', keydownListener)})
|
onUnmounted(() => {document.removeEventListener('keydown', keydownListener)})
|
||||||
|
}
|
||||||
|
|
||||||
// 切换到上一张/上一张幻灯片(无视元素的入场动画)
|
// 切换到上一张/上一张幻灯片(无视元素的入场动画)
|
||||||
const turnPrevSlide = () => {
|
const turnPrevSlide = () => {
|
||||||
|
|
|
@ -95,3 +95,11 @@ export function getCourseTeachingMsg(id) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setPaging(data) {
|
||||||
|
return request({
|
||||||
|
url: '/education/classcourse/record/paging',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/**
|
||||||
|
* 无限滚动
|
||||||
|
*/
|
||||||
|
import { nextTick } from 'vue'
|
||||||
|
const mountedHook = async (el, binding) => {
|
||||||
|
console.log(el, binding)
|
||||||
|
const value = binding.value
|
||||||
|
if (typeof value !== 'function') return console.error('v-scroll must be a function')
|
||||||
|
await nextTick()
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
// Hooks for Vue3
|
||||||
|
mounted(el, binding) {
|
||||||
|
mountedHook(el, binding)
|
||||||
|
},
|
||||||
|
// Hooks for Vue2
|
||||||
|
inserted(el, binding) {
|
||||||
|
mountedHook(el, binding)
|
||||||
|
},
|
||||||
|
|
||||||
|
update(el, binding){
|
||||||
|
},
|
||||||
|
updated(el, binding){
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
|
@ -98,6 +98,8 @@ export class MsgEnum {
|
||||||
MSG_classlecturePagesrc : 'classlecturePagesrc',
|
MSG_classlecturePagesrc : 'classlecturePagesrc',
|
||||||
/** @desc: 课堂作业|活动 */
|
/** @desc: 课堂作业|活动 */
|
||||||
MSG_homework : 'HOMEWORK',
|
MSG_homework : 'HOMEWORK',
|
||||||
|
/** @desc: 公屏 - 课堂作业|活动 */
|
||||||
|
MSG_pushSreen_work : 'pushSreen-work',
|
||||||
/** @desc: 点赞 */
|
/** @desc: 点赞 */
|
||||||
MSG_dz : 'dz',
|
MSG_dz : 'dz',
|
||||||
/** @desc: 疑惑 */
|
/** @desc: 疑惑 */
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
<!-- <div class="class-reserv-tabs">
|
<!-- <div class="class-reserv-tabs">
|
||||||
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
<el-segmented v-model="tabActive" block :options="tabOptions" size="large" />
|
||||||
</div>-->
|
</div>-->
|
||||||
<div class="class-reserv-body">
|
<div class="class-reserv-body" v-infinite-scroll="load">
|
||||||
<template v-for="(item, index) in dataList" :key="index">
|
<template v-for="(item, index) in dataList" :key="index">
|
||||||
<reserv-item
|
<!-- <reserv-item
|
||||||
:style="{'background-color': index%2==0?'#f5f5f5':''}"
|
:style="{'background-color': index%2==0?'#f5f5f5':''}"
|
||||||
:item="item"
|
:item="item"
|
||||||
v-if="item.bookImg"
|
v-if="item.bookImg"
|
||||||
@open-edit="reservDialog.openDialog(item)"
|
@open-edit="reservDialog.openDialog(item)"
|
||||||
@delete-reserv="deleteReserv(item)"
|
@delete-reserv="deleteReserv(item)"
|
||||||
@change="(...o) => emit('change', ...o)"
|
@change="(...o) => emit('change', ...o)"
|
||||||
></reserv-item>
|
></reserv-item> -->
|
||||||
<reserv-item-apt
|
<reserv-item-apt
|
||||||
v-if="!item.bookImg"
|
v-if="!item.bookImg"
|
||||||
:style="{'background-color': index%2==0?'#f5f5f5':''}"
|
:style="{'background-color': index%2==0?'#f5f5f5':''}"
|
||||||
|
@ -22,13 +22,14 @@
|
||||||
@change="(...o) => emit('change', ...o)"
|
@change="(...o) => emit('change', ...o)"
|
||||||
></reserv-item-apt>
|
></reserv-item-apt>
|
||||||
</template>
|
</template>
|
||||||
|
<el-divider v-if="page.isEnd">到底了,没了</el-divider>
|
||||||
</div>
|
</div>
|
||||||
<reserv ref="reservDialog"></reserv>
|
<reserv ref="reservDialog"></reserv>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, computed, watch } from 'vue'
|
import { ref, onMounted, computed, watch, reactive } from 'vue'
|
||||||
import { getSelfReserv } from '@/api/classManage'
|
import { getSelfReserv } from '@/api/classManage'
|
||||||
import { listClasscourseNew } from '@/api/teaching/classcourse' // api接口
|
import { listClasscourseNew } from '@/api/teaching/classcourse' // api接口
|
||||||
import ReservItem from '@/views/classManage/reserv-item.vue'
|
import ReservItem from '@/views/classManage/reserv-item.vue'
|
||||||
|
@ -36,6 +37,7 @@ import Reserv from '@/views/prepare/container/reserv.vue'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
import { useToolState } from '@/store/modules/tool'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import ReservItemApt from '@/views/classManage/reserv-item-apt.vue'
|
import ReservItemApt from '@/views/classManage/reserv-item-apt.vue'
|
||||||
|
import vScroll from '@/directive/scroll' // 指令--滚动
|
||||||
// import Chat from '@/utils/chat' // im 登录初始化
|
// import Chat from '@/utils/chat' // im 登录初始化
|
||||||
// if (!Chat.imChat) Chat.init()
|
// if (!Chat.imChat) Chat.init()
|
||||||
|
|
||||||
|
@ -44,6 +46,12 @@ const reservDialog = ref(null)
|
||||||
const tabOptions = ref(['进行中', '已结束'])
|
const tabOptions = ref(['进行中', '已结束'])
|
||||||
const tabActive = ref('进行中')
|
const tabActive = ref('进行中')
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
|
const page = reactive({
|
||||||
|
pageNum: 0, // 页码
|
||||||
|
pageSize: 10, // 每页条数
|
||||||
|
total: 0, // 总条数
|
||||||
|
isEnd: false // 是否加载完
|
||||||
|
})
|
||||||
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
@ -72,21 +80,42 @@ const deleteReserv = (item) => {
|
||||||
})*/
|
})*/
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
Promise.all([listClasscourseNew({teacherid: userStore.id,evalid: props.curNode.id,pageSize:1000}), getSelfReserv({ex2:props.curNode.id})]).then(([res1,res2])=>{
|
const { pageNum, pageSize } = page
|
||||||
let list = res2.data || []
|
const params = {
|
||||||
let list2 = res1.rows || []
|
evalid: props.curNode.id,
|
||||||
// list.sort((a,b) => { if(a.status=='上课中') return -1; else return 0 })
|
teacherid: userStore.id,
|
||||||
list = list.concat(list2)
|
pageNum, pageSize
|
||||||
|
}
|
||||||
|
listClasscourseNew(params)
|
||||||
|
.then((res) => {
|
||||||
|
const list = res.rows || []
|
||||||
|
const total = res.total || 0
|
||||||
list.sort((a,b) => { return new Date(b.createTime) - new Date(a.createTime) })
|
list.sort((a,b) => { return new Date(b.createTime) - new Date(a.createTime) })
|
||||||
dataList.value = list
|
dataList.value.push(...list)
|
||||||
|
page.total = total // 总条数
|
||||||
|
page.isEnd = dataList.value.length == total // 是否结束
|
||||||
})
|
})
|
||||||
|
// aippt+ppt 获取数据
|
||||||
|
// Promise.all([listClasscourseNew({teacherid: userStore.id,evalid: props.curNode.id,pageSize:1000}), getSelfReserv({ex2:props.curNode.id})]).then(([res1,res2])=>{
|
||||||
|
// let list = res2.data || []
|
||||||
|
// let list2 = res1.rows || []
|
||||||
|
// // list.sort((a,b) => { if(a.status=='上课中') return -1; else return 0 })
|
||||||
|
// list = list.concat(list2)
|
||||||
|
// list.sort((a,b) => { return new Date(b.createTime) - new Date(a.createTime) })
|
||||||
|
// dataList.value = list
|
||||||
|
// })
|
||||||
/*getSelfReserv().then((res) => {
|
/*getSelfReserv().then((res) => {
|
||||||
const list = res.data || []
|
const list = res.data || []
|
||||||
list.sort((a,b) => { if(a.status=='上课中') return -1; else return 0 })
|
list.sort((a,b) => { if(a.status=='上课中') return -1; else return 0 })
|
||||||
dataList.value = list
|
dataList.value = list
|
||||||
})*/
|
})*/
|
||||||
}
|
}
|
||||||
|
// 列表加载更多
|
||||||
|
const load = () => {
|
||||||
|
if(page.isEnd) return console.log('已加载完-所有') // 结束
|
||||||
|
page.pageNum++
|
||||||
|
getData()
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => [dataList,toolStore.isToolWin,props.curNode],
|
() => [dataList,toolStore.isToolWin,props.curNode],
|
||||||
() => {
|
() => {
|
||||||
|
@ -96,13 +125,14 @@ watch(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData() // 加载数据
|
// getData() // 加载数据
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.class-reserv-wrap {
|
.class-reserv-wrap {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
// height: 300px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
//padding: 15px 10px;
|
//padding: 15px 10px;
|
||||||
|
|
|
@ -61,8 +61,8 @@
|
||||||
<div>
|
<div>
|
||||||
<div v-if="myClassActive.filetype=='apt'">开始新的课堂,需要点击先创建课堂,才能显示手机二维码</div>
|
<div v-if="myClassActive.filetype=='apt'">开始新的课堂,需要点击先创建课堂,才能显示手机二维码</div>
|
||||||
<div v-else>开始新的课堂,需要点击先创建课堂</div>
|
<div v-else>开始新的课堂,需要点击先创建课堂</div>
|
||||||
<el-button type="warning" :loading="dt.loading" @click="createClasscourse">创建课堂</el-button>
|
<el-button type="warning" :loading="dt.loading" @click="createClasscourse()">创建课堂</el-button>
|
||||||
<el-button type="success" @click="publicScreenClass">公屏上课</el-button>
|
<el-button type="success" @click="createClasscourse(true)">公屏上课</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- 故障备用 -->
|
<!-- 故障备用 -->
|
||||||
|
|
|
@ -364,8 +364,8 @@ export default {
|
||||||
// 开始上课
|
// 开始上课
|
||||||
startClass(item, classObj) {
|
startClass(item, classObj) {
|
||||||
// 关闭状态,打开上课相关功能(已打开,忽略)
|
// 关闭状态,打开上课相关功能(已打开,忽略)
|
||||||
// const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
|
const iscourse = !!sessionStore.get('curr.classcourse')
|
||||||
// if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
|
if (iscourse) return ElMessage.warning('公屏已打开,请勿重复操作')
|
||||||
// 当前上课-store
|
// 当前上课-store
|
||||||
sessionStore.set('activeClass', item)
|
sessionStore.set('activeClass', item)
|
||||||
this.activeClass = item
|
this.activeClass = item
|
||||||
|
@ -390,6 +390,7 @@ export default {
|
||||||
const resource = res.data
|
const resource = res.data
|
||||||
if (resource.filetype != 'aippt') this.$refs.calssRef.open(aptFileId, row)
|
if (resource.filetype != 'aippt') this.$refs.calssRef.open(aptFileId, row)
|
||||||
else {
|
else {
|
||||||
|
if (!!sessionStore.get('curr.classcourse')) return ElMessage.warning('公屏已打开,请勿重复操作')
|
||||||
const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0})
|
const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0})
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
msgEl.close()
|
msgEl.close()
|
||||||
|
@ -460,6 +461,8 @@ export default {
|
||||||
}
|
}
|
||||||
case 'wsApp': { // 发送app端待开课消息
|
case 'wsApp': { // 发送app端待开课消息
|
||||||
// console.log('wsApp', row)
|
// console.log('wsApp', row)
|
||||||
|
window.test = sessionStore
|
||||||
|
if (!!sessionStore.get('curr.classcourse')) return ElMessage.warning('公屏已打开,请勿重复操作')
|
||||||
const head = MsgEnum.HEADS.MSG_0000
|
const head = MsgEnum.HEADS.MSG_0000
|
||||||
const data = { id: row.id }
|
const data = { id: row.id }
|
||||||
const type = ChatWs.TYPES.single
|
const type = ChatWs.TYPES.single
|
||||||
|
@ -475,15 +478,6 @@ export default {
|
||||||
const resource = res?.data||{}
|
const resource = res?.data||{}
|
||||||
const classcourse = row
|
const classcourse = row
|
||||||
this.openPublicScreen('class',resource, classcourse) // 打开公屏-窗口
|
this.openPublicScreen('class',resource, classcourse) // 打开公屏-窗口
|
||||||
// sessionStore.set('curr.resource', resource) // 缓存当前资源信息
|
|
||||||
// sessionStore.set('curr.classcourse', classcourse) // 缓存当前当前上课
|
|
||||||
// createWindow('open-win', {
|
|
||||||
// url: '/pptist', // 窗口关闭时,清除缓存
|
|
||||||
// close: () => {
|
|
||||||
// sessionStore.set('curr.resource', null) // 清除缓存
|
|
||||||
// sessionStore.set('curr.classcourse', null) // 清除缓存
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -514,7 +508,7 @@ export default {
|
||||||
|
|
||||||
closeChange() { // 上课弹窗被关闭-触发
|
closeChange() { // 上课弹窗被关闭-触发
|
||||||
// console.log('关闭上课弹窗')
|
// console.log('关闭上课弹窗')
|
||||||
// this.activeClass = null
|
this.activeClass = null
|
||||||
sessionStore.delete('activeClass')
|
sessionStore.delete('activeClass')
|
||||||
},
|
},
|
||||||
initReserv(id) {
|
initReserv(id) {
|
||||||
|
@ -930,6 +924,7 @@ export default {
|
||||||
return getSmarttalkPage({
|
return getSmarttalkPage({
|
||||||
...this.uploadData,
|
...this.uploadData,
|
||||||
orderByColumn: 'createTime',
|
orderByColumn: 'createTime',
|
||||||
|
fileFlag: 'aippt',
|
||||||
isAsc: 'desc',
|
isAsc: 'desc',
|
||||||
pageSize: 500
|
pageSize: 500
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue