#924 V2.1.5 PPT上课,点击上课之后,默认打开当前课程PPT

This commit is contained in:
朱浩 2024-10-11 14:41:36 +08:00
parent 07fa4c9790
commit 3c064ebffd
2 changed files with 8 additions and 5 deletions

View File

@ -106,6 +106,7 @@ import { listClasscourseNew } from '@/api/teaching/classcourse'
import { endClass, getSelfReserv } from '@/api/classManage' import { endClass, getSelfReserv } from '@/api/classManage'
import { listEntpcourse } from '@/api/teaching/classwork' import { listEntpcourse } from '@/api/teaching/classwork'
import { createWindow } from '@/utils/tool' import { createWindow } from '@/utils/tool'
import { defineExpose } from 'vue'
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
export default { export default {
@ -135,6 +136,7 @@ export default {
default: '' default: ''
} }
}, },
expose: ['openFileWin'],
emits: { 'on-start-class': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null,'on-filearg': null }, emits: { 'on-start-class': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null,'on-filearg': null },
data() { data() {
return { return {

View File

@ -18,6 +18,7 @@
<kj-list-item <kj-list-item
v-for="(item, index) in currentKJFileList" v-for="(item, index) in currentKJFileList"
:key="index" :key="index"
:ref="'kjItemRef'+item.id"
:item="item" :item="item"
:index="index" :index="index"
:curNode="currentNode" :curNode="currentNode"
@ -303,29 +304,29 @@ export default {
// }, // },
methods: { methods: {
startClass(item) { startClass(item) {
// console.log(item, sessionStore)
// () // ()
const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作') if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
// -store
sessionStore.set('activeClass', item)
this.activeClass = item
if(item.fileFlag === '课件') { if(item.fileFlag === '课件') {
this.openReserv() this.openReserv()
} }
if(item.fileFlag === 'apt') { if(item.fileFlag === 'apt') {
this.$refs.calssRef.open(item.fileId) this.$refs.calssRef.open(item.fileId)
} }
// -store
sessionStore.set('activeClass', item)
this.activeClass = item
}, },
closeChange() { // - closeChange() { // -
console.log('关闭上课弹窗') console.log('关闭上课弹窗')
this.activeClass = null // this.activeClass = null
sessionStore.delete('activeClass') sessionStore.delete('activeClass')
}, },
initReserv(id) { initReserv(id) {
getClassInfo(id).then((res) => { getClassInfo(id).then((res) => {
this.curClassReserv = res.data this.curClassReserv = res.data
this.openLesson(res.data.id); this.openLesson(res.data.id);
this.$refs['kjItemRef'+this.activeClass.id][0].openFileWin(this.activeClass);
}) })
}, },
getBookPathFromServer() { getBookPathFromServer() {