Sfoglia il codice sorgente

fix: 休止小节选段评测,选段评测报告问题修复

TIANYONG 7 mesi fa
parent
commit
eaa0654253

+ 1 - 1
osmd-extended

@@ -1 +1 @@
-Subproject commit 03fa7c2e5b7ad0445360e69636a441ec4f8ea97a
+Subproject commit 46bdba03a3654e74d0ad2bd61e993a2467d0f80e

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

@@ -185,8 +185,8 @@ export default defineComponent({
       actualBeatLength = Math.round((state.times[0].fixtime * 1000) / 1);
       // 如果是阶段评测,选取该阶段的times
       if (state.isSelectMeasureMode && state.section.length) {
-        const startIndex = state.times.findIndex((n: any) => n.noteId == state.section[0].noteId);
-        let endIndex = state.times.findIndex((n: any) => n.noteId == state.section[1].noteId);
+        const startIndex = state.section[0].noteId ? state.times.findIndex((n: any) => n.noteId == state.section[0].noteId) : state.times.findIndex((n: any) => n.MeasureNumberXML == state.section[0].MeasureNumberXML);
+        let endIndex = state.section[1].noteId ? state.times.findIndex((n: any) => n.noteId == state.section[1].noteId) : state.times.findIndex((n: any) => n.MeasureNumberXML == state.section[1].MeasureNumberXML);
         endIndex = endIndex < state.section[1].i ? state.section[1].i : endIndex;
         if (startIndex > 1) {
           // firstNoteTime应该取预备小节的第一个音符的开始播放的时间

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

@@ -270,7 +270,7 @@ export default defineComponent({
       // console.log(1111,notes)
       for (const note of notes) {
         const idx = note.musicalNotesIndex !== undefined ? note.musicalNotesIndex : note.index;
-        const active = detailData.isNewReport ? allNote.value.find((item: any) => item.i === idx) : allNote.value[idx];
+        const active = detailData.isNewReport ? notes[0]?.measureRenderIndex != 0 ? allNote.value[idx] : allNote.value.find((item: any) => item.i === idx) : allNote.value[idx];
         setTimeout(() => {
           if (!active?.id) return;
           if (active?.id && useedid.value.includes(active?.id)) {

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

@@ -225,7 +225,7 @@ export default defineComponent({
 						})
 						// 获取stave里面vf-custom-bg的位置坐标,才是准确的坐标
 						// const currBgX = document.getElementById(currItem.stave.attrs.id)?.querySelector('.vf-custom-bg')?.getBoundingClientRect()?.x || 0;
-						const currBgX = document.getElementById(currItem.stave.attrs.id)?.querySelector('.vf-custom-bg')?.getBBox()?.x * state.zoom || 0;
+						const currBgX = currItem.stave?.attrs && currItem.stave.attrs.id ? document.getElementById(currItem.stave.attrs.id)?.querySelector('.vf-custom-bg')?.getBBox()?.x * state.zoom || 0 : 0;
 						return currItem && {
 							left: currBgX ? currBgX + 'px' : currItem.staveBox.left,
 							top: currItem.staveBox.top,