فهرست منبع

老师多声部筛选

skyblued 2 سال پیش
والد
کامیت
425a3e0612
2فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 3 3
      src/views/live-class/index.tsx
  2. 3 2
      src/views/video-class/index.tsx

+ 3 - 3
src/views/live-class/index.tsx

@@ -46,11 +46,11 @@ export default defineComponent({
       //
     }
     const list = this.subjectList.map((n: any) => n.subjects).flat().sort((a,b) => a.id - b.id)
-    console.log([...list])
-    const userSubjectId = this.params.subjectId
+    const userSubjectId = state.user.data?.subjectId.split(',').map(n => parseInt(n)) || [this.params.subjectId]
     let isRest = true
     for(let i = 0; i < list.length; i++){
-      if (list[i].id == userSubjectId) {
+      if (userSubjectId.includes(list[i].id)) {
+        this.params.subjectId = list[i].id
         this.params.subjectName = list[i].name
         isRest = false
         break;

+ 3 - 2
src/views/video-class/index.tsx

@@ -46,10 +46,11 @@ export default defineComponent({
       //
     }
     const list = this.subjectList.map((n: any) => n.subjects).flat().sort((a,b) => a.id - b.id)
-    const userSubjectId = this.params.lessonSubject
+    const userSubjectId = state.user.data?.subjectId.split(',').map(n => parseInt(n)) || [this.params.lessonSubject]
     let isRest = true
     for(let i = 0; i < list.length; i++){
-      if (list[i].id == userSubjectId) {
+      if (userSubjectId.includes(list[i].id)) {
+        this.params.lessonSubject = list[i].id
         this.params.subjectName = list[i].name
         isRest = false
         break;