فهرست منبع

feat: 评测选段暂时不支持保存演奏

TIANYONG 9 ماه پیش
والد
کامیت
2d9134fde0

+ 2 - 0
src/pages/detail/state.ts

@@ -92,6 +92,8 @@ const state = reactive({
   isCombineRender: false,
   /** 大雅金唐类目 */
   isDaYaCategory: false,
+  /** 选段评测,开始播放的音符的时值 */
+  firstNoteTime: 0,
 })
 
 export const isRhythmicExercises = (musicName?: string) => {

+ 14 - 7
src/subpages/colexiu/buttons/evaluating.tsx

@@ -381,7 +381,7 @@ const formatTimes = () => {
     preLyricsContent = preLyricsContent ? preLyricsContent : 'Play'
   }
   // 阶段评测beatLength需要加上预备小节的持续时长
-  actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].duration * 1000 : actualBeatLength
+  actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].measureLength * 1000 : actualBeatLength
   let measureIndex = -1
   let recordMeasure = -1
   let firstNoteTime = unitTestIdx > 1 ? preTime : 0
@@ -432,7 +432,8 @@ const formatTimes = () => {
       nextFrequency: formatPitch(item.noteElement?.pitch?.nextFrequency),
       prevFrequency: formatPitch(item.noteElement?.pitch?.prevFrequency),
       measureIndex: measureIndex, //note.measureOpenIndex,
-      measureRenderIndex: note.noteElement.sourceMeasure.measureListIndex,
+      // measureRenderIndex: note.noteElement.sourceMeasure.measureListIndex,
+      measureRenderIndex: item.measureNumberPrinted >= 1 ? item.measureNumberPrinted - 1 : note.noteElement.sourceMeasure.measureListIndex,
       dontEvaluating: ListenMode || dontEvaluatingMode || item.skipMode,
       musicalNotesIndex: index, //item.i,
       denominator: note.noteElement?.Length.denominator,
@@ -448,11 +449,13 @@ const formatTimes = () => {
   }
 }
 const connect = async () => {
+  detailState.firstNoteTime = 0;
   const search = useOriginSearch()
   connentLoading.value = true
   const behaviorId = sessionStorage.getItem('behaviorId') || search.behaviorId || initBehaviorId
   const rate = runtime.speed / detailState.baseSpeed //1
   calculateInfo = formatTimes()
+  detailState.firstNoteTime = calculateInfo.firstNoteTime;
   const content = {
     musicXmlInfos: calculateInfo.datas,
     firstNoteTime: calculateInfo.firstNoteTime,
@@ -816,6 +819,7 @@ const sendResult = (evt?: IPostMessage) => {
         }
       }
       const setEvaluatings = (note: any, data: any, dontTransition = false) => {
+        // console.log('note',note,data)
         const startNote = getBoundingBoxByverticalNote(note)
         // console.log(detailState.evaluatings, startNote)
         detailState.evaluatings = {
@@ -843,13 +847,16 @@ const sendResult = (evt?: IPostMessage) => {
             setEvaluatings(time, data)
           } else {
             for (const item of time.noteElement.tie.notes) {
+              const currentMeasureNum = time.noteElement.measureNumber;
               const note = getParentNote(item)
               if (!note) continue
-              setEvaluatings(
-                note,
-                data,
-                item.NoteToGraphicalNoteObjectId !== time.noteElement.tie.StartNote?.NoteToGraphicalNoteObjectId
-              )
+              if (note.measureNumberPrinted === currentMeasureNum) {
+                setEvaluatings(
+                  note,
+                  data,
+                  item.NoteToGraphicalNoteObjectId !== time.noteElement.tie.StartNote?.NoteToGraphicalNoteObjectId
+                )
+              }
             }
           }
           break

+ 1 - 1
src/subpages/colexiu/popups/evaluating/content.tsx

@@ -249,7 +249,7 @@ export default defineComponent({
                 </div>
               </div>
 
-              {isUnitTest ? null : !detailState.isHideEvaluatReportSaveBtn ? (
+              {isUnitTest || detailState.section.length === 2 ? null : !detailState.isHideEvaluatReportSaveBtn ? (
                 // <div class={styles.rigthBtns}>
                 //   <div class={styles.skepBtn} onClick={() => emit('upload')}>
                 //     <img src={iconUpload} />

+ 1 - 0
src/subpages/colexiu/popups/evaluating/index.tsx

@@ -105,6 +105,7 @@ export default defineComponent({
             title: detailState.activeDetail?.musicSheetName || "曲谱演奏",
             coverImg: detailState.activeDetail?.titleImg || '',
             speedRate: parseFloat(runtime.basePlayRate.toFixed(2)), // 播放倍率
+            // firstNoteTime: detailState.firstNoteTime,
           });
         }
       }