lex 1 year ago
parent
commit
e3cf14076e

+ 3 - 0
src/views/attend-class/index.tsx

@@ -172,6 +172,7 @@ export default defineComponent({
       subjectId: '' as any, // 声部编号
       subjectId: '' as any, // 声部编号
       lessonCourseId: '' as any, // 教材编号
       lessonCourseId: '' as any, // 教材编号
       lessonCoursewareDetailId: '' as any, // 章节
       lessonCoursewareDetailId: '' as any, // 章节
+      lessonCoursewareSubjectList: [] as any, // 教材上的声部
       detailId: '' as any, // 编号 - 课程编号
       detailId: '' as any, // 编号 - 课程编号
       classGroupId: '' as any, // 上课时需要 班级编号
       classGroupId: '' as any, // 上课时需要 班级编号
       classId: '' as any, // 上课编号
       classId: '' as any, // 上课编号
@@ -425,6 +426,7 @@ export default defineComponent({
 
 
         const ids = formatParentId(data.detailId, popupData.chapterDetails);
         const ids = formatParentId(data.detailId, popupData.chapterDetails);
         data.lessonCoursewareDetailId = ids[0];
         data.lessonCoursewareDetailId = ids[0];
+        data.lessonCoursewareSubjectList = res.data.subjectList || [];
       } catch {
       } catch {
         //
         //
       }
       }
@@ -1831,6 +1833,7 @@ export default defineComponent({
             classId={data.classId}
             classId={data.classId}
             courseId={popupData.courseId}
             courseId={popupData.courseId}
             subjectId={data.subjectId}
             subjectId={data.subjectId}
+            lessonCoursewareSubjectList={data.lessonCoursewareSubjectList}
             onConfirm={async (val: any) => {
             onConfirm={async (val: any) => {
               popupData.chapterLoading = true;
               popupData.chapterLoading = true;
               try {
               try {

+ 4 - 0
src/views/attend-class/model/select-class/index.module.less

@@ -8,6 +8,10 @@
 
 
 }
 }
 
 
+.searchGroup {
+  padding: 12px 43px;
+}
+
 .list {
 .list {
   display: flex;
   display: flex;
   flex-flow: row wrap;
   flex-flow: row wrap;

+ 36 - 2
src/views/attend-class/model/select-class/index.tsx

@@ -1,7 +1,7 @@
 import { PropType, defineComponent, onMounted, reactive } from 'vue';
 import { PropType, defineComponent, onMounted, reactive } from 'vue';
 import styles from './index.module.less';
 import styles from './index.module.less';
 import { teacherChapterLessonCoursewareList } from '/src/views/prepare-lessons/api';
 import { teacherChapterLessonCoursewareList } from '/src/views/prepare-lessons/api';
-import { NScrollbar, NSpin } from 'naive-ui';
+import { NInput, NScrollbar, NSelect, NSpin } from 'naive-ui';
 import CoursewareType from '/src/views/prepare-lessons/model/courseware-type';
 import CoursewareType from '/src/views/prepare-lessons/model/courseware-type';
 import TheEmpty from '/src/components/TheEmpty';
 import TheEmpty from '/src/components/TheEmpty';
 
 
@@ -16,6 +16,10 @@ export default defineComponent({
       type: String,
       type: String,
       default: ''
       default: ''
     },
     },
+    lessonCoursewareSubjectList: {
+      type: Array,
+      default: () => []
+    },
     classId: {
     classId: {
       type: String,
       type: String,
       default: ''
       default: ''
@@ -25,13 +29,15 @@ export default defineComponent({
   setup(props, { emit }) {
   setup(props, { emit }) {
     const forms = reactive({
     const forms = reactive({
       loading: false,
       loading: false,
+      subjectId: props.subjectId ? Number(props.subjectId) : '',
       tableList: [] as any
       tableList: [] as any
     });
     });
+
     const getDetail = async () => {
     const getDetail = async () => {
       forms.loading = true;
       forms.loading = true;
       try {
       try {
         // 如果是上课则查询班级声部,预览查询全部
         // 如果是上课则查询班级声部,预览查询全部
-        console.log(props.classId, props.subjectId);
+        // console.log(props.classId, props.subjectId);
         const { data } = await teacherChapterLessonCoursewareList({
         const { data } = await teacherChapterLessonCoursewareList({
           coursewareDetailKnowledgeId: props.courseId,
           coursewareDetailKnowledgeId: props.courseId,
           subjectId: props.classId ? props.subjectId : null
           subjectId: props.classId ? props.subjectId : null
@@ -63,10 +69,38 @@ export default defineComponent({
     };
     };
 
 
     onMounted(() => {
     onMounted(() => {
+      if (props.subjectId) {
+        const s = Number(props.subjectId);
+        let isE = false;
+        props.lessonCoursewareSubjectList.forEach((item: any) => {
+          if (item.id === s) {
+            isE = true;
+          }
+        });
+        if (!isE) {
+          forms.subjectId = '';
+        }
+      }
       getDetail();
       getDetail();
     });
     });
     return () => (
     return () => (
       <div class={styles.selectClass}>
       <div class={styles.selectClass}>
+        <div class={styles.searchGroup}>
+          <NSelect
+            options={[
+              { id: '', name: '全部声部' },
+              ...(props.lessonCoursewareSubjectList as any)
+            ]}
+            valueField="id"
+            labelField="name"
+            style={{ width: '220px' }}
+            placeholder={'请选择声部'}
+            v-model:value={forms.subjectId}
+            onUpdate:value={() => {
+              getDetail();
+            }}
+          />
+        </div>
         <NSpin show={forms.loading}>
         <NSpin show={forms.loading}>
           <NScrollbar class={styles.selectClassScroll}>
           <NScrollbar class={styles.selectClassScroll}>
             <div
             <div

+ 6 - 0
src/views/prepare-lessons/components/lesson-main/courseware-presets/index.module.less

@@ -146,6 +146,12 @@
     opacity: 0.6;
     opacity: 0.6;
     filter: blur(7px);
     filter: blur(7px);
   }
   }
+
+  &:hover {
+    // &::after {
+    background: linear-gradient(135deg, #76CEFF 0%, #5FA2FA 100%) !important;
+    // }
+  }
 }
 }
 
 
 
 

+ 13 - 5
src/views/prepare-lessons/components/lesson-main/courseware-presets/index.tsx

@@ -349,14 +349,18 @@ export default defineComponent({
       }
       }
     };
     };
 
 
-    const onStartClass = async (item: any, classGroupId: any) => {
+    const onStartClass = async (
+      item: any,
+      classGroupId: any,
+      subjectId?: any
+    ) => {
       if (classGroupId) {
       if (classGroupId) {
         // 开始上课
         // 开始上课
         const res = await courseScheduleStart({
         const res = await courseScheduleStart({
           lessonCoursewareKnowledgeDetailId: prepareStore.selectKey,
           lessonCoursewareKnowledgeDetailId: prepareStore.selectKey,
           classGroupId: classGroupId,
           classGroupId: classGroupId,
-          useChapterLessonCoursewareId: item.id,
-          subjectId: prepareStore.getSubjectId
+          useChapterLessonCoursewareId: item.id
+          // subjectId: prepareStore.getSubjectId
         });
         });
         if (window.matchMedia('(display-mode: standalone)').matches) {
         if (window.matchMedia('(display-mode: standalone)').matches) {
           state.application = window.matchMedia(
           state.application = window.matchMedia(
@@ -368,7 +372,7 @@ export default defineComponent({
             type: 'class',
             type: 'class',
             classGroupId: classGroupId,
             classGroupId: classGroupId,
             courseId: item.id,
             courseId: item.id,
-            subjectId: prepareStore.getSubjectId,
+            subjectId: subjectId || route.query.subjectId,
             detailId: prepareStore.getSelectKey,
             detailId: prepareStore.getSelectKey,
             classId: res.data,
             classId: res.data,
             lessonCourseId: prepareStore.getBaseCourseware.id,
             lessonCourseId: prepareStore.getBaseCourseware.id,
@@ -686,7 +690,11 @@ export default defineComponent({
               }
               }
             }}
             }}
             onConfirm={async (item: any) => {
             onConfirm={async (item: any) => {
-              onStartClass(forms.attendClassItem, item.classGroupId);
+              onStartClass(
+                forms.attendClassItem,
+                item.classGroupId,
+                item.subjectId
+              );
             }}
             }}
           />
           />
         </NModal>
         </NModal>

+ 6 - 3
src/views/prepare-lessons/components/lesson-main/train/assign-student/index.tsx

@@ -65,7 +65,7 @@ export default defineComponent({
       },
       },
       pagination: {
       pagination: {
         page: 1,
         page: 1,
-        rows: 10,
+        rows: 20,
         pageTotal: 0
         pageTotal: 0
       },
       },
       tableList: [] as any,
       tableList: [] as any,
@@ -136,7 +136,7 @@ export default defineComponent({
 
 
     // 切换学生状态
     // 切换学生状态
     const onCheckStudents = () => {
     const onCheckStudents = () => {
-      state.selectStudents = [];
+      // state.selectStudents = [];
       if (state.checkboxIds.length <= 0 || state.tableList.length <= 0) {
       if (state.checkboxIds.length <= 0 || state.tableList.length <= 0) {
         state.indeterminate = false;
         state.indeterminate = false;
         state.checkAllStatus = false;
         state.checkAllStatus = false;
@@ -147,7 +147,10 @@ export default defineComponent({
       state.tableList.forEach((item: any) => {
       state.tableList.forEach((item: any) => {
         if (state.checkboxIds.includes(item.id)) {
         if (state.checkboxIds.includes(item.id)) {
           count++;
           count++;
-          state.selectStudents.push(item);
+          const index = state.selectStudents.findIndex(
+            (select: any) => select.id === item.id
+          );
+          if (index === -1) state.selectStudents.push(item);
         }
         }
       });
       });
 
 

+ 17 - 17
src/views/prepare-lessons/components/resource-main/components/select-music/index.tsx

@@ -119,8 +119,8 @@ export default defineComponent({
             isCollect: !!row.favoriteFlag,
             isCollect: !!row.favoriteFlag,
             isSelected: row.sourceFrom === 'PLATFORM' ? true : false,
             isSelected: row.sourceFrom === 'PLATFORM' ? true : false,
             content: row.id,
             content: row.id,
-            xmlFileUrl: row.xmlFileUrl,
-            exist: index !== -1 ? true : false // 是否存在
+            xmlFileUrl: row.xmlFileUrl
+            // exist: index !== -1 ? true : false // 是否存在
           });
           });
         });
         });
         state.tableList.push(...temp);
         state.tableList.push(...temp);
@@ -144,21 +144,21 @@ export default defineComponent({
         onSearch(state.searchGroup);
         onSearch(state.searchGroup);
       }
       }
     );
     );
-    watch(
-      () => prepareStore.trainList,
-      () => {
-        state.tableList.forEach((item: any) => {
-          const index = prepareStore.getTrainList.findIndex(
-            (course: any) => course.musicId === item.id
-          );
-          item.exist = index !== -1 ? true : false; // 是否存在
-        });
-      },
-      {
-        deep: true,
-        immediate: true
-      }
-    );
+    // watch(
+    //   () => prepareStore.trainList,
+    //   () => {
+    //     state.tableList.forEach((item: any) => {
+    //       const index = prepareStore.getTrainList.findIndex(
+    //         (course: any) => course.musicId === item.id
+    //       );
+    //       item.exist = index !== -1 ? true : false; // 是否存在
+    //     });
+    //   },
+    //   {
+    //     deep: true,
+    //     immediate: true
+    //   }
+    // );
 
 
     const throttledFn = useThrottleFn(() => {
     const throttledFn = useThrottleFn(() => {
       state.pagination.page = state.pagination.page + 1;
       state.pagination.page = state.pagination.page + 1;

+ 1 - 1
src/views/prepare-lessons/model/add-courseware-protocol/index.tsx

@@ -86,7 +86,7 @@ export default defineComponent({
               onClick={() => {
               onClick={() => {
                 // showModalMask.value = false;
                 // showModalMask.value = false;
                 // checkAuthShow();
                 // checkAuthShow();
-                emit('close');
+                forms.protocolShow = false;
               }}
               }}
               alt=""
               alt=""
             />
             />

+ 2 - 2
src/views/prepare-lessons/model/related-class/index.module.less

@@ -8,7 +8,7 @@
   align-items: center;
   align-items: center;
   gap: 0 24px;
   gap: 0 24px;
   margin-bottom: 18px;
   margin-bottom: 18px;
-  padding: 0 40px;
+  padding: 0 50px;
 
 
   :global {
   :global {
 
 
@@ -24,7 +24,7 @@
 
 
     .n-input,
     .n-input,
     .n-select {
     .n-select {
-      max-width: 250px;
+      max-width: 280px;
     }
     }
   }
   }