Browse Source

Merge branch 'iteration-classroom-listen' into jenkins

lex 1 year ago
parent
commit
b5a156c111

+ 1 - 1
public/version.json

@@ -1 +1 @@
-{"version":1710745467236}
+{ "version": 1710745467236 }

+ 9 - 6
src/components/card-preview/listen-modal/index.tsx

@@ -21,12 +21,12 @@ export default defineComponent({
     const iframeRef = ref();
     const isLoaded = ref(false);
 
-    let src = `${vaildMusicScoreUrl()}/instrument/#/view-figner?Authorization=${
+    const src = `${vaildMusicScoreUrl()}/instrument?v=${new Date().getTime()}/#/view-figner?Authorization=${
       userStore.getToken
-    }&code=${props.item.content}&platform=pc&type=listenMode`;
-    if (/(localhost|192)/.test(location.host)) {
-      src = `http://localhost:3001/instrument.html#/view-figner?Authorization=${userStore.getToken}&code=${props.item.content}&platform=pc&type=listenMode`;
-    }
+    }&code=${props.item.content}&platform=pc&type=listenMode&linkSource=class`;
+    // if (/(localhost|192)/.test(location.host)) {
+    //   src = `http://localhost:3001/instrument.html#/view-figner?Authorization=${userStore.getToken}&code=${props.item.content}&platform=pc&type=listenMode`;
+    // }
     // if (props.item.dataJson) {
     //   src += '&dataJson=' + props.item.dataJson;
     // }
@@ -35,7 +35,10 @@ export default defineComponent({
       () => props.activeStatus,
       () => {
         if (!props.activeStatus) {
-          iframeRef.value.contentWindow?.postMessage({ api: 'resetPlay' }, '*');
+          iframeRef.value.contentWindow?.postMessage(
+            { api: 'resetPlay', data: { code: props.item.content } },
+            '*'
+          );
         }
       }
     );

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

@@ -343,7 +343,6 @@ export default defineComponent({
       if (data.type === 'preview') {
         rightList.splice(6, 1);
       }
-
       rollCallStudentList();
     });
 
@@ -1676,7 +1675,7 @@ export default defineComponent({
                   trigger: () => <img src={item.icon} />,
                   default: (
                     <>
-                      {index === 0 && data.type === 'preview'
+                      {index === rightList.length - 2 && data.type === 'preview'
                         ? item.name2
                         : item.name}
                     </>

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

@@ -361,6 +361,10 @@ export default defineComponent({
           message.error('请选择声部');
           return;
         }
+        if (forms.coursewareList.length <= 0) {
+          message.error('请至少添加一个知识点');
+          return;
+        }
 
         let isNotAdd = false;
         for (const item of forms.coursewareList) {

+ 22 - 6
src/views/prepare-lessons/model/subject-sync/index.tsx

@@ -47,16 +47,32 @@ export default defineComponent({
       }
 
       const subjectCode: any[] = [];
-      subjectList.value.forEach((subject: any) => {
-        if (selectSubjectIds.value.includes(subject.id)) {
+      // subjectList.value.forEach((subject: any) => {
+      //   if (selectSubjectIds.value.includes(subject.id)) {
+      //     subjectCode.push({
+      //       materialId: subject.id,
+      //       coverImg: subjectImgs[subject.code] || subjectImgs.Panpipes,
+      //       dataJson: null,
+      //       title: subject.name,
+      //       isCollect: false,
+      //       isSelected: false,
+      //       content: subject.code
+      //     });
+      //   }
+      // });
+      selectSubjectIds.value.forEach((id: any) => {
+        const item = subjectList.value.find(
+          (subject: any) => subject.id === id
+        );
+        if (item) {
           subjectCode.push({
-            materialId: subject.id,
-            coverImg: subjectImgs[subject.code] || subjectImgs.Panpipes,
+            materialId: item.id,
+            coverImg: subjectImgs[item.code] || subjectImgs.Panpipes,
             dataJson: null,
-            title: subject.name,
+            title: item.name,
             isCollect: false,
             isSelected: false,
-            content: subject.code
+            content: item.code
           });
         }
       });