lex 1 år sedan
förälder
incheckning
fb9c5ab9d2
1 ändrade filer med 22 tillägg och 9 borttagningar
  1. 22 9
      src/views/prepare-lessons/components/lesson-main/courseware/index.tsx

+ 22 - 9
src/views/prepare-lessons/components/lesson-main/courseware/index.tsx

@@ -49,6 +49,8 @@ export default defineComponent({
     const forms = reactive({
       className: route.query.name as any,
       classGroupId: route.query.classGroupId,
+      preStudentNum: route.query.preStudentNum,
+      courseScheduleSubjectId: route.query.courseScheduleSubjectId,
       // 选取参数带的,后取缓存
       subjectId: route.query.subjectId
         ? Number(route.query.subjectId)
@@ -247,11 +249,12 @@ export default defineComponent({
       }
     };
     const fscreen = () => {
-      const el = document.documentElement;
+      const el: any = document.documentElement;
+      const documentDom: any = document;
       const isFullscreen =
-        document.fullScreen ||
-        document.mozFullScreen ||
-        document.webkitIsFullScreen;
+        documentDom.fullScreen ||
+        documentDom.mozFullScreen ||
+        documentDom.webkitIsFullScreen;
       if (!isFullscreen) {
         //进入全屏
         (el.requestFullscreen && el.requestFullscreen()) ||
@@ -296,6 +299,7 @@ export default defineComponent({
         const localStorageSubjectId = localStorage.getItem(
           'prepareLessonSubjectId'
         );
+        // 先取 上次上课声部,在取班级声部 最后取缓存
         const subjectId =
           forms.courseScheduleSubjectId ||
           forms.subjectId ||
@@ -331,6 +335,7 @@ export default defineComponent({
       async () => {
         forms.className = route.query.name as any;
         forms.classGroupId = route.query.classGroupId as any;
+        forms.preStudentNum = route.query.preStudentNum as any;
         forms.subjectId = route.query.subjectId
           ? Number(route.query.subjectId)
           : null;
@@ -648,7 +653,8 @@ export default defineComponent({
                     // 开始上课
                     const res = await courseScheduleStart({
                       lessonCoursewareKnowledgeDetailId: prepareStore.selectKey,
-                      classGroupId: forms.classGroupId
+                      classGroupId: forms.classGroupId,
+                      subjectId: prepareStore.getSubjectId
                     });
                     if (
                       window.matchMedia('(display-mode: standalone)').matches
@@ -664,7 +670,8 @@ export default defineComponent({
                         subjectId: prepareStore.getSubjectId,
                         detailId: prepareStore.getSelectKey,
                         classId: res.data,
-                        lessonCourseId: prepareStore.getBaseCourseware.id
+                        lessonCourseId: prepareStore.getBaseCourseware.id,
+                        preStudentNum: forms.preStudentNum
                       };
                     } else {
                       const { href } = router.resolve({
@@ -675,7 +682,8 @@ export default defineComponent({
                           subjectId: prepareStore.getSubjectId,
                           detailId: prepareStore.getSelectKey,
                           classId: res.data,
-                          lessonCourseId: prepareStore.getBaseCourseware.id
+                          lessonCourseId: prepareStore.getBaseCourseware.id,
+                          preStudentNum: forms.preStudentNum
                         }
                       });
                       window.open(href, +new Date() + '');
@@ -726,11 +734,13 @@ export default defineComponent({
               if (forms.classGroupId) {
                 forms.className = item.name;
                 forms.classGroupId = item.classGroupId;
+                forms.preStudentNum = item.preStudentNum;
                 forms.subjectId = item.subjectId;
+                forms.courseScheduleSubjectId = item.courseScheduleSubjectId;
                 forms.showAttendClass = false;
 
                 prepareStore.setClassGroupId(item.classGroupId);
-
+                console.log(forms, 'forms', item);
                 checkSubjectIds();
                 // 声部切换时
                 eventGlobal.emit('onChangeClass', {
@@ -740,7 +750,8 @@ export default defineComponent({
               } else {
                 const res = await courseScheduleStart({
                   lessonCoursewareKnowledgeDetailId: prepareStore.selectKey,
-                  classGroupId: item.classGroupId
+                  classGroupId: item.classGroupId,
+                  subjectId: prepareStore.getSubjectId
                 });
                 forms.showAttendClass = false;
                 if (window.matchMedia('(display-mode: standalone)').matches) {
@@ -752,6 +763,7 @@ export default defineComponent({
                     type: 'class',
                     classId: res.data, // 上课编号
                     classGroupId: item.classGroupId,
+                    preStudentNum: item.preStudentNum,
                     subjectId: prepareStore.getSubjectId,
                     detailId: prepareStore.getSelectKey,
                     lessonCourseId: prepareStore.getBaseCourseware.id
@@ -766,6 +778,7 @@ export default defineComponent({
                       type: 'class',
                       classId: res.data, // 上课编号
                       classGroupId: item.classGroupId,
+                      preStudentNum: item.preStudentNum,
                       subjectId: prepareStore.getSubjectId,
                       detailId: prepareStore.getSelectKey,
                       lessonCourseId: prepareStore.getBaseCourseware.id