浏览代码

Merge branch 'feature-tianyong' into gym-online

TIANYONG 6 天之前
父节点
当前提交
587dd71205

+ 2 - 2
src/helpers/formateMusic.ts

@@ -1409,8 +1409,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				trackIndex: note.trackIndex, // 当前的音符属于第几条分轨
 				isStaccato: note.voiceEntry.isStaccato(),
 				isRestFlag: note.isRestFlag,
-				// noteId: note.NoteToGraphicalNoteObjectId || `restNote${note.sourceMeasure.MeasureNumberXML}`,
-				noteId: note.NoteToGraphicalNoteObjectId,
+				noteId: note.NoteToGraphicalNoteObjectId === undefined ? `restNote${note.sourceMeasure.MeasureNumberXML}` : note.NoteToGraphicalNoteObjectId,
+				// noteId: note.NoteToGraphicalNoteObjectId,
 				measureListIndex: note.sourceMeasure.measureListIndex,
 				MeasureNumberXML: note.sourceMeasure.MeasureNumberXML, // 当前的小节数,(从1开始)
 				_noteLength: _noteLength,

+ 7 - 2
src/page-instrument/custom-plugins/guide-driver/index.tsx

@@ -1346,13 +1346,18 @@ export const EvaluatingReportDriver = defineComponent({
             title: "",
             description: "",
             popoverClass: "popoverClass popoverClassReport3 popoverClose",
-            align: "start",
+            align: "end",
             side: "bottom",
             prevBtnText: "再看一遍",
             doneBtnText: "完成",
             showButtons: ["next", "previous"],
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
-              driverInitialPosition(popover, options);
+              options.config.stageRadius = 8;
+              options.config.stagePadding = 5;
+              try {
+                const rect = options.state.activeElement?.getBoundingClientRect();
+                popover.wrapper.style.marginLeft = ((rect?.width || 0) / 2) * -1 + 4 + "px";
+              } catch {}
             },
             onPrevClick: () => {
               driverObj.drive(0);

+ 4 - 2
src/page-instrument/evaluat-model/index.tsx

@@ -224,7 +224,8 @@ export default defineComponent({
       if (preTimes.length) {
         for (let index = preTimes.length-1; index >= 0; index--) {
           const item = preTimes[index]
-          const note = getNoteByMeasuresSlursStart(item)
+          // const note = getNoteByMeasuresSlursStart(item)
+          const note = item
           if (note.formatLyricsEntries.contains('Play') || note.formatLyricsEntries.contains('Play...')) {
             preLyricsContent = 'Play'
             break
@@ -238,7 +239,8 @@ export default defineComponent({
       } 
       for (let index = 0; index < selectTimes.length; index++) {
         const item = selectTimes[index];
-        const note = getNoteByMeasuresSlursStart(item);
+        // const note = getNoteByMeasuresSlursStart(item);
+        const note = item;
         // #8701 bug: 评测模式,是以曲谱本身的速度进行评测,所以rate取1,不需要转换
         // const rate = state.speed / state.originSpeed;
         const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率

+ 5 - 6
src/page-instrument/view-evaluat-report/index.tsx

@@ -365,13 +365,12 @@ export default defineComponent({
       console.log("🚀 ~ state.times:", allNote.value);
       // @ts-ignore
       const startMeasureNum = detailData.musicalNotesPlayStats?.[0]?.measureRenderIndex, endMeasureNum = detailData.musicalNotesPlayStats?.last()?.measureRenderIndex;
-      allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum+1 && item.MeasureNumberXML <= endMeasureNum+1))
       // 从0开始的曲子,MeasureNumberXML也是从0开始,需要兼容处理
-      // if (state.firstMeasureNumber === 0) {
-      //   allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum && item.MeasureNumberXML <= endMeasureNum))
-      // } else {
-      //   allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum+1 && item.MeasureNumberXML <= endMeasureNum+1))
-      // }
+      if (state.firstMeasureNumber === 0) {
+        allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum && item.MeasureNumberXML <= endMeasureNum))
+      } else {
+        allNote.value = allNote.value.filter((item: any) => (item.MeasureNumberXML >= startMeasureNum+1 && item.MeasureNumberXML <= endMeasureNum+1))
+      }
       // @ts-ignore
       const beams = Array.from(new Set(document.getElementsByClassName("vf-beam")));
       beams.forEach((item: any) => {

+ 4 - 1
src/state.ts

@@ -1294,7 +1294,10 @@ const queryMusicXml = async (id: string, xmlUr: string) => {
 
 const getMusicInfo = async (res: any) => {
   try {
-    await initInstrumentCode()
+    // 单行谱页面不需要调用此接口
+    if (!state.isSimplePage) {
+      await initInstrumentCode()
+    }
   } catch (error) {
     // console.log(error)
   }

+ 1 - 1
src/view/evaluating/index.tsx

@@ -854,7 +854,7 @@ export default defineComponent({
       } else {
         removeSocketStatus(handleSocketStatus);
       }
-      api_closeCamera();
+      // api_closeCamera();
       api_disconnectSocket();
       console.log("卸载评测模块成功");
     });

+ 2 - 5
src/view/selection/index.module.less

@@ -83,11 +83,8 @@
 
 .scoreItem {
     position: absolute;
-    left: 80%;
-    top: -120%;
-    transform: translateX(-50%);
-    // right: 10px;
-    // top: -45px;
+    right: 10px;
+    top: -45px;
     // transform: translateX(-50%);    
     font-size: 16px;
     font-family: "Roboto", sans-serif;