#882 V2.1.5 教学实录只记录已结束课程,添加继续上课逻辑
This commit is contained in:
parent
d39d96f733
commit
d1f3abcc72
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win",
|
"name": "aix-win",
|
||||||
"version": "2.1.8",
|
"version": "2.1.9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "example.com",
|
"author": "example.com",
|
||||||
|
|
|
@ -148,8 +148,26 @@ export default {
|
||||||
this.userInfo = useUserStore().user
|
this.userInfo = useUserStore().user
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getOpenCourse() {
|
||||||
|
return Promise.all([listClasscourseNew({teacherid: this.userInfo.userId,status:"open",evalid: this.curNode.id,pageSize:1000}), getSelfReserv({ex2:this.curNode.id})]).then(([res1,res2])=>{
|
||||||
|
let list2 = res1.rows || []
|
||||||
|
let list = res2.data || []
|
||||||
|
let one = list.find(item1 => {
|
||||||
|
if (item1.status === "上课中") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (one) {
|
||||||
|
return one
|
||||||
|
}
|
||||||
|
if (list2.length>0) {
|
||||||
|
one = list2[0]
|
||||||
|
}
|
||||||
|
return one
|
||||||
|
})
|
||||||
|
},
|
||||||
// 获取当前上课的课程列表
|
// 获取当前上课的课程列表
|
||||||
getOpenCourse(isApt) {
|
/*getOpenCourse(isApt) {
|
||||||
const curNodeId = this.curNode.id
|
const curNodeId = this.curNode.id
|
||||||
if (isApt) { // APT课程
|
if (isApt) { // APT课程
|
||||||
const params = {teacherid: this.userInfo.userId,status:"open",evalid: curNodeId,pageSize:1000}
|
const params = {teacherid: this.userInfo.userId,status:"open",evalid: curNodeId,pageSize:1000}
|
||||||
|
@ -161,11 +179,12 @@ export default {
|
||||||
return (res.data || []).filter(o => o.status === "上课中")
|
return (res.data || []).filter(o => o.status === "上课中")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},*/
|
||||||
clickStartClass(item) {
|
clickStartClass(item) {
|
||||||
const isApt = item.fileFlag === 'apt'
|
const isApt = item.fileFlag === 'apt'
|
||||||
this.getOpenCourse(isApt).then(res => {
|
this.getOpenCourse(isApt).then(res => {
|
||||||
if(!res || res.length === 0){
|
console.log(res)
|
||||||
|
if(!res){
|
||||||
this.$emit('on-start-class', item)
|
this.$emit('on-start-class', item)
|
||||||
}else{
|
}else{
|
||||||
ElMessageBox.alert('<strong>上次课程尚未结束,是否继续上课?</strong>', '', {
|
ElMessageBox.alert('<strong>上次课程尚未结束,是否继续上课?</strong>', '', {
|
||||||
|
@ -182,7 +201,7 @@ export default {
|
||||||
confirmButtonClass: "el-button--danger",
|
confirmButtonClass: "el-button--danger",
|
||||||
center: true,
|
center: true,
|
||||||
beforeClose: (action, instance, done) => {
|
beforeClose: (action, instance, done) => {
|
||||||
const obj = res[0]
|
const obj = res
|
||||||
if (action === 'confirm'){
|
if (action === 'confirm'){
|
||||||
// 下课
|
// 下课
|
||||||
this.$emit('change', 'close', obj, { type: 1, instance, done })
|
this.$emit('change', 'close', obj, { type: 1, instance, done })
|
||||||
|
@ -190,7 +209,6 @@ export default {
|
||||||
if (action === 'cancel'){
|
if (action === 'cancel'){
|
||||||
// 继续上课
|
// 继续上课
|
||||||
if (obj.bookImg) {
|
if (obj.bookImg) {
|
||||||
console.log('PPT')
|
|
||||||
//PPT
|
//PPT
|
||||||
listEntpcourse({
|
listEntpcourse({
|
||||||
evalid: obj.ex2,
|
evalid: obj.ex2,
|
||||||
|
@ -199,6 +217,26 @@ export default {
|
||||||
}).then(async res1=>{
|
}).then(async res1=>{
|
||||||
if (res1.rows[0].id) {
|
if (res1.rows[0].id) {
|
||||||
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res1.rows[0].id + "&reservId=" + obj.id })
|
createWindow('tool-sphere', { url: '/tool/sphere?entpcourseid=' + res1.rows[0].id + "&reservId=" + obj.id })
|
||||||
|
if (obj.ex4) {
|
||||||
|
getPrepareById(obj.ex4).then(res2=>{
|
||||||
|
console.log(res2)
|
||||||
|
this.openFileWin(res2);
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'抱歉,版本V2.1.9前创建的课程,无法直接打开PPT,请自行打开PPT!',
|
||||||
|
'Warning',
|
||||||
|
{
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
type: 'warning',
|
||||||
|
center: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -101,6 +101,12 @@ const props = defineProps({
|
||||||
default: () => {
|
default: () => {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
curFile: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const ruleFormDialog = ref(null)
|
const ruleFormDialog = ref(null)
|
||||||
|
@ -292,7 +298,8 @@ const addClassReserv = (formData) => {
|
||||||
classRoom: formData.classRoom,
|
classRoom: formData.classRoom,
|
||||||
classSubject: props.currentNode.edusubject,
|
classSubject: props.currentNode.edusubject,
|
||||||
ex1: props.bookId,
|
ex1: props.bookId,
|
||||||
ex2: props.currentNode.id
|
ex2: props.currentNode.id,
|
||||||
|
ex4: props.curFile.id
|
||||||
}
|
}
|
||||||
addSmartClassReserv(param).then((res) => {
|
addSmartClassReserv(param).then((res) => {
|
||||||
if (res.msg) {
|
if (res.msg) {
|
||||||
|
|
|
@ -132,6 +132,7 @@
|
||||||
ref="reservDialog"
|
ref="reservDialog"
|
||||||
:current-node="currentNode"
|
:current-node="currentNode"
|
||||||
:book-id="uploadData.textbookId"
|
:book-id="uploadData.textbookId"
|
||||||
|
:cur-file="activeClass"
|
||||||
@add-success="initReserv"
|
@add-success="initReserv"
|
||||||
@close="closeChange"
|
@close="closeChange"
|
||||||
></reserv>
|
></reserv>
|
||||||
|
|
Loading…
Reference in New Issue