From d1f3abcc7272f92cdca92c1502de3feb2d69e5b5 Mon Sep 17 00:00:00 2001
From: zhuhao <979263092@qq.com>
Date: Wed, 16 Oct 2024 10:58:42 +0800
Subject: [PATCH] =?UTF-8?q?#882=20V2.1.5=20=E6=95=99=E5=AD=A6=E5=AE=9E?=
=?UTF-8?q?=E5=BD=95=E5=8F=AA=E8=AE=B0=E5=BD=95=E5=B7=B2=E7=BB=93=E6=9D=9F?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=BB=A7=E7=BB=AD?=
=?UTF-8?q?=E4=B8=8A=E8=AF=BE=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 2 +-
.../views/prepare/container/kj-list-item.vue | 48 +++++++++++++++++--
.../src/views/prepare/container/reserv.vue | 9 +++-
src/renderer/src/views/prepare/index.vue | 5 +-
4 files changed, 55 insertions(+), 9 deletions(-)
diff --git a/package.json b/package.json
index bba0704..7e2e499 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "aix-win",
- "version": "2.1.8",
+ "version": "2.1.9",
"description": "",
"main": "./out/main/index.js",
"author": "example.com",
diff --git a/src/renderer/src/views/prepare/container/kj-list-item.vue b/src/renderer/src/views/prepare/container/kj-list-item.vue
index 164aa91..a4b0260 100644
--- a/src/renderer/src/views/prepare/container/kj-list-item.vue
+++ b/src/renderer/src/views/prepare/container/kj-list-item.vue
@@ -148,8 +148,26 @@ export default {
this.userInfo = useUserStore().user
},
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
if (isApt) { // APT课程
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 === "上课中")
})
}
- },
+ },*/
clickStartClass(item) {
const isApt = item.fileFlag === 'apt'
this.getOpenCourse(isApt).then(res => {
- if(!res || res.length === 0){
+ console.log(res)
+ if(!res){
this.$emit('on-start-class', item)
}else{
ElMessageBox.alert('上次课程尚未结束,是否继续上课?', '', {
@@ -182,7 +201,7 @@ export default {
confirmButtonClass: "el-button--danger",
center: true,
beforeClose: (action, instance, done) => {
- const obj = res[0]
+ const obj = res
if (action === 'confirm'){
// 下课
this.$emit('change', 'close', obj, { type: 1, instance, done })
@@ -190,7 +209,6 @@ export default {
if (action === 'cancel'){
// 继续上课
if (obj.bookImg) {
- console.log('PPT')
//PPT
listEntpcourse({
evalid: obj.ex2,
@@ -199,6 +217,26 @@ export default {
}).then(async res1=>{
if (res1.rows[0].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()
}
})
diff --git a/src/renderer/src/views/prepare/container/reserv.vue b/src/renderer/src/views/prepare/container/reserv.vue
index 99f660d..116b5e9 100644
--- a/src/renderer/src/views/prepare/container/reserv.vue
+++ b/src/renderer/src/views/prepare/container/reserv.vue
@@ -101,6 +101,12 @@ const props = defineProps({
default: () => {
return {}
}
+ },
+ curFile: {
+ type: Object,
+ default: () => {
+ return {}
+ }
}
})
const ruleFormDialog = ref(null)
@@ -292,7 +298,8 @@ const addClassReserv = (formData) => {
classRoom: formData.classRoom,
classSubject: props.currentNode.edusubject,
ex1: props.bookId,
- ex2: props.currentNode.id
+ ex2: props.currentNode.id,
+ ex4: props.curFile.id
}
addSmartClassReserv(param).then((res) => {
if (res.msg) {
diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue
index 06e709f..be14fab 100644
--- a/src/renderer/src/views/prepare/index.vue
+++ b/src/renderer/src/views/prepare/index.vue
@@ -34,7 +34,7 @@
-
@@ -132,6 +132,7 @@
ref="reservDialog"
:current-node="currentNode"
:book-id="uploadData.textbookId"
+ :cur-file="activeClass"
@add-success="initReserv"
@close="closeChange"
>
@@ -354,7 +355,7 @@ export default {
}, 1000)
break
}
- default:
+ default:
break
}
},