Quellcode durchsuchen

Merge branch 'iteration_1.3.4' into dev

lex vor 2 Jahren
Ursprung
Commit
727e4e0f2e

+ 7 - 4
src/student/teacher-dependent/teacher-elegant.tsx

@@ -48,10 +48,13 @@ export default defineComponent({
       const subjectIds = state.user.data?.subjectId || ''
       const subjectIds = state.user.data?.subjectId || ''
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       list.forEach((subject: any) => {
       list.forEach((subject: any) => {
-        if (subject.id === subjectId) {
-          this.params.subjectId = subjects.id
-          this.params.subjectName = subjects.name
-        }
+        const child = subject.subjects || []
+        child.forEach((sub: any) => {
+          if (sub.id === Number(subjectId)) {
+            this.params.subjectId = sub.id
+            this.params.subjectName = sub.name
+          }
+        })
       })
       })
     }
     }
     await this.getList()
     await this.getList()

+ 7 - 4
src/views/live-class/index.tsx

@@ -54,10 +54,13 @@ export default defineComponent({
       const subjectIds = state.user.data?.subjectId || ''
       const subjectIds = state.user.data?.subjectId || ''
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       list.forEach((subject: any) => {
       list.forEach((subject: any) => {
-        if (subject.id === subjectId) {
-          this.params.subjectId = subjects.id
-          this.params.subjectName = subjects.name
-        }
+        const child = subject.subjects || []
+        child.forEach((sub: any) => {
+          if (sub.id === Number(subjectId)) {
+            this.params.subjectId = sub.id
+            this.params.subjectName = sub.name
+          }
+        })
       })
       })
     }
     }
     this.getList()
     this.getList()

+ 7 - 4
src/views/video-class/index.tsx

@@ -55,10 +55,13 @@ export default defineComponent({
       const subjectIds = state.user.data?.subjectId || ''
       const subjectIds = state.user.data?.subjectId || ''
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       list.forEach((subject: any) => {
       list.forEach((subject: any) => {
-        if (subject.id === subjectId) {
-          this.params.lessonSubject = subjects.id
-          this.params.subjectName = subjects.name
-        }
+        const child = subject.subjects || []
+        child.forEach((sub: any) => {
+          if (sub.id === Number(subjectId)) {
+            this.params.lessonSubject = sub.id
+            this.params.subjectName = sub.name
+          }
+        })
       })
       })
     }
     }
     this.getList()
     this.getList()