浏览代码

fix: bug修复

TIANYONG 11 月之前
父节点
当前提交
1d0a3e28e4

+ 1 - 1
src/helpers/customMusicScore.ts

@@ -538,7 +538,7 @@ export const resetFormate = () => {
 		};
 
 		// 给小节添加背景色
-		if (!state.isCreateImg) {
+		if (!state.isCreateImg && !state.isPreView) {
 			staves.forEach((stave: any) => {
 				const list = [
 					Array.from(stave?.querySelectorAll(".vf-StaveSection") || []),

+ 7 - 1
src/page-instrument/evaluat-model/index.tsx

@@ -194,6 +194,11 @@ export default defineComponent({
       }
       // 阶段评测beatLength需要加上预备小节的持续时长
       actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].relaMeasureLength * 1000 : actualBeatLength;
+      // 如果是弱起,并且预备小节是第一节
+      if (state.section.length && state.sectionFirst && state.sectionFirst.measureListIndex == 0) {
+        actualBeatLength = actualBeatLength < Math.round((state.times[0].fixtime * 1000) / 1) ? Math.round((state.times[0].fixtime * 1000) / 1) : actualBeatLength;
+      }
+      
       let firstNoteTime = unitTestIdx > 1 ? preTime : 0;
       let measureIndex = -1;
       let recordMeasure = -1;
@@ -204,7 +209,8 @@ export default defineComponent({
         // #8701 bug: 评测模式,是以曲谱本身的速度进行评测,所以rate取1,不需要转换
         // const rate = state.speed / state.originSpeed;
         const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率
-        const difftime = item.difftime;
+        // const difftime = item.difftime;
+        const difftime = 0;
         const start = difftime + (item.sourceRelativeTime || item.relativeTime) - starTime;
         const end = difftime + (item.sourceRelaEndtime || item.relaEndtime) - starTime;
         const isStaccato = note.noteElement.voiceEntry.isStaccato();

+ 12 - 0
src/page-instrument/view-detail/index.module.less

@@ -171,6 +171,9 @@
 
 .preViewDetail {
     background: #fff !important;
+    >.pageBg {
+        display: none;
+    }
     .headHeight {
         background: #fff !important;
     }
@@ -186,6 +189,15 @@
         #cursorImg-0 {
             opacity: 0 !important;
         }
+        .noteActive {
+            path {
+                fill: #000000;
+                stroke: #000000;
+            }
+            rect {
+                stroke: #000000;
+            }
+        }
     }
 }
 

+ 1 - 1
src/page-instrument/view-detail/index.tsx

@@ -495,7 +495,7 @@ export default defineComponent({
           {!detailData.isLoading && 
             <MusicScore 
               ref={musicScoreRef}
-              musicColor={'#FFFFFF'}
+              musicColor={state.isPreView ? '#000000' : '#FFFFFF'}
               showPartNames={state.isCombineRender}
               onRendered={handleRendered} 
             > 

+ 1 - 1
src/view/music-score/index.tsx

@@ -225,7 +225,7 @@ export default defineComponent({
 					isInTheGradualRange.value && styles.inGradualRange,
 					state.musicRenderType == EnumMusicRenderType.staff ? "staff" : "jianpuTone",
 					state.isSingleLine && "singleLineMusicBox",
-					(!state.isCreateImg && state.musicRenderType === EnumMusicRenderType.staff) ? "blueMusicXml" : ""
+					(!state.isCreateImg && !state.isPreView && state.musicRenderType === EnumMusicRenderType.staff) ? "blueMusicXml" : ""
 				]}
 			>
 				{slots.default?.()}