소스 검색

更新声部

lex 2 년 전
부모
커밋
14c0a78beb
3개의 변경된 파일21개의 추가작업 그리고 12개의 파일을 삭제
  1. 7 4
      src/student/teacher-dependent/teacher-elegant.tsx
  2. 7 4
      src/views/live-class/index.tsx
  3. 7 4
      src/views/video-class/index.tsx

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

@@ -48,10 +48,13 @@ export default defineComponent({
       const subjectIds = state.user.data?.subjectId || ''
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       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()

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

@@ -54,10 +54,13 @@ export default defineComponent({
       const subjectIds = state.user.data?.subjectId || ''
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       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()

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

@@ -55,10 +55,13 @@ export default defineComponent({
       const subjectIds = state.user.data?.subjectId || ''
       const subjectId = subjectIds ? Number(subjectIds.split(',')[0]) : null
       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()