lex 1 year ago
parent
commit
245d4c6282

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

@@ -1699,6 +1699,7 @@ export default defineComponent({
           ]}
           title={'选择课件'}>
           <SelectClass
+            classId={data.classId}
             courseId={popupData.courseId}
             subjectId={data.subjectId}
             onConfirm={async (val: any) => {

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

@@ -15,6 +15,10 @@ export default defineComponent({
     subjectId: {
       type: String,
       default: ''
+    },
+    classId: {
+      type: String,
+      default: ''
     }
   },
   emits: ['confirm', 'close'],
@@ -26,9 +30,10 @@ export default defineComponent({
     const getDetail = async () => {
       forms.loading = true;
       try {
+        // 如果是上课则查询班级声部,预览查询全部
         const { data } = await teacherChapterLessonCoursewareList({
-          coursewareDetailKnowledgeId: props.courseId
-          // subjectId: props.subjectId
+          coursewareDetailKnowledgeId: props.courseId,
+          subjectId: props.classId ? props.subjectId : null
         });
 
         if (!Array.isArray(data)) {

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

@@ -349,6 +349,7 @@ export default defineComponent({
     };
 
     const onStartClass = async (item: any, classGroupId: any) => {
+      console.log(item, classGroupId);
       if (classGroupId) {
         // 开始上课
         const res = await courseScheduleStart({
@@ -394,7 +395,6 @@ export default defineComponent({
         forms.attendClassType = 'change';
         forms.attendClassItem = item;
       }
-      forms.showAttendClass = false;
     };
 
     const carouselRef = ref();

+ 4 - 0
src/views/prepare-lessons/components/lesson-main/courseware/addCourseware.module.less

@@ -438,4 +438,8 @@
 
 .subjectSyncModal {
   width: 1070px;
+}
+
+.addOtherSource {
+  width: 726px;
 }

+ 5 - 27
src/views/prepare-lessons/components/lesson-main/courseware/addCourseware.tsx

@@ -48,6 +48,7 @@ import { eventGlobal } from '/src/utils';
 // import iconTips from '../../../images/icon-tips.png';
 import TheMessageDialog from '/src/components/TheMessageDialog';
 import AddItemModel from '../../../model/add-item-model';
+import AddOtherSource from '../../../model/add-other-source';
 export default defineComponent({
   name: 'courseware-modal',
   props: {
@@ -680,12 +681,7 @@ export default defineComponent({
                                   'handle'
                                 ]}
                                 onClick={() => {
-                                  // 直接跳转到制谱页面 (临时存储数据)
-                                  sessionStorage.setItem(
-                                    'notation-open-create',
-                                    '1'
-                                  );
-                                  router.push('/notation');
+                                  forms.addOtherSource = true;
                                 }}>
                                 <img src={iconAddMusic} />
 
@@ -708,12 +704,7 @@ export default defineComponent({
                               'handle'
                             ]}
                             onClick={() => {
-                              // 直接跳转到制谱页面 (临时存储数据)
-                              sessionStorage.setItem(
-                                'notation-open-create',
-                                '1'
-                              );
-                              router.push('/notation');
+                              forms.addOtherSource = true;
                             }}>
                             <img src={iconAddMusic} />
 
@@ -834,21 +825,8 @@ export default defineComponent({
           v-model:show={forms.addOtherSource}
           preset="card"
           class={['modalTitle background', styles.addOtherSource]}
-          title={'同步声部'}>
-          <SubjectSync
-            subjectId={prepareStore.getSubjectId as any}
-            onClose={() => (forms.addOtherSource = false)}
-            onConfirm={async (subjectIds: any) => {
-              //
-              try {
-                forms.editSubjectIds = subjectIds.join(',');
-                await onOverEdit();
-                forms.addOtherSource = false;
-              } catch {
-                //
-              }
-            }}
-          />
+          title={'添加功能'}>
+          <AddOtherSource />
         </NModal>
       </div>
     );

+ 34 - 0
src/views/prepare-lessons/model/add-other-source/index.module.less

@@ -0,0 +1,34 @@
+.addOtherSource {
+  padding: 42px 50px;
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  gap: 30px 30px;
+
+  .sourceItem {
+    cursor: pointer;
+    transition: all .2s ease;
+
+    &:hover {
+      transform: scale(1.03);
+      transition: all .2s ease;
+    }
+
+    .coverImg {
+      width: 133px;
+      height: 133px;
+    }
+
+    .name {
+      text-align: center;
+      font-size: max(15px, 12Px);
+      color: #131415;
+      line-height: 21px;
+    }
+  }
+}
+
+
+.addOtherSourceModal {
+  width: 958px;
+}

+ 105 - 0
src/views/prepare-lessons/model/add-other-source/index.tsx

@@ -0,0 +1,105 @@
+import { defineComponent, reactive, ref } from 'vue';
+import { NImage, NModal } from 'naive-ui';
+import styles from './index.module.less';
+import icon1 from '../../images/addSource/icon1.png';
+import icon2 from '../../images/addSource/icon2.png';
+import icon3 from '../../images/addSource/icon3.png';
+import icon4 from '../../images/addSource/icon4.png';
+import icon5 from '../../images/addSource/icon5.png';
+import icon6 from '../../images/addSource/icon6.png';
+import icon7 from '../../images/addSource/icon7.png';
+import { useRouter } from 'vue-router';
+import SourceRhythm from '../source-rhythm';
+
+export default defineComponent({
+  name: 'add-other-source',
+  emits: ['close', 'comfirm'],
+  setup(props, { emit }) {
+    const router = useRouter();
+    const sourceList = ref([
+      {
+        image: icon1,
+        name: '听音练习',
+        index: 0
+      },
+      {
+        image: icon2,
+        name: '节奏练习',
+        index: 1
+      },
+      {
+        image: icon3,
+        name: '乐器百科',
+        index: 2
+      },
+      {
+        image: icon4,
+        name: '名曲鉴赏',
+        index: 3
+      },
+      {
+        image: icon5,
+        name: '音乐家',
+        index: 4
+      },
+      {
+        image: icon6,
+        name: '乐理知识',
+        index: 5
+      },
+      {
+        image: icon7,
+        name: '制作曲谱',
+        index: 6
+      }
+    ]);
+    const state = reactive({
+      listenStatus: false, // 听音练习
+      rhythmStatus: false, //节奏
+      theoryStatus: false, //
+      musicStatus: false, //
+      instrumentStatus: false, //
+      musicianStatus: false //
+    });
+    // LISTEN:听音,RHYTHM:节奏,THEORY:乐理知识,MUSIC:曲目 INSTRUMENT:乐器 MUSICIAN:音乐家)
+
+    const onDetail = (item: any) => {
+      switch (item.index) {
+        case 1:
+          state.rhythmStatus = true;
+          break;
+        case 6:
+          // 直接跳转到制谱页面 (临时存储数据)
+          sessionStorage.setItem('notation-open-create', '1');
+          router.push('/notation');
+          break;
+        default:
+          break;
+      }
+    };
+    return () => (
+      <>
+        <div class={styles.addOtherSource}>
+          {sourceList.value.map(source => (
+            <div class={styles.sourceItem} onClick={() => onDetail(source)}>
+              <NImage
+                class={styles.coverImg}
+                src={source.image}
+                previewDisabled
+              />
+              <p class={styles.name}>{source.name}</p>
+            </div>
+          ))}
+        </div>
+        {/* 节奏练习 */}
+        <NModal
+          v-model:show={state.rhythmStatus}
+          preset="card"
+          class={['modalTitle background', styles.addOtherSourceModal]}
+          title={'节奏练习'}>
+          <SourceRhythm />
+        </NModal>
+      </>
+    );
+  }
+});

+ 6 - 2
src/views/prepare-lessons/model/courseware-type/index.module.less

@@ -3,11 +3,11 @@
   background: #F5F6FA;
   border-radius: 13px;
   padding: 10px;
-  transition: all 0.3 ease;
+  transition: all 0.2s ease;
 
   &:hover {
     transform: scale(1.01);
-    transition: all 0.3 ease;
+    transition: all 0.2s ease;
   }
 
   &.coursewareTypeHover:hover {
@@ -18,6 +18,10 @@
   }
 
   &.coursewareTypeHocoursewareTypeShow {
+    .cover {
+      cursor: default;
+    }
+
     .addBtn {
       opacity: 1;
       visibility: visible;

+ 0 - 0
src/views/prepare-lessons/model/source-rhythm/index.module.less


+ 10 - 0
src/views/prepare-lessons/model/source-rhythm/index.tsx

@@ -0,0 +1,10 @@
+import { defineComponent } from 'vue';
+import styles from './index.module.less';
+
+export default defineComponent({
+  name: 'source-rhythm',
+  emits: ['close', 'confirm'],
+  setup(props, { emit }) {
+    return () => <div class={styles.sourceRhythm}></div>;
+  }
+});