TIANYONG hace 1 año
padre
commit
b79b5d95d0

+ 3 - 1
src/pages/detail/helpers.ts

@@ -236,6 +236,7 @@ export const getAllNodes = (osmd: any) => {
       for (const v of voiceEntries) {
         // 始终只取第一个声部中第一个音符的时间
         let note: any = v.notes[0]
+        // console.log( note.sourceMeasure.verticalMeasureList)
         if (['Piano'].includes(state.activeDetail?.code) || state.activeDetail?.musicSheetType == 'CONCERT') {
           let _notes = []
           try {
@@ -1521,6 +1522,7 @@ const getImageSize = (src: string): Promise<HTMLImageElement> => {
 
 // 计算选择范围内的小节宽度高度
 export const setSettionBackground = () => {
+  // console.log(1111)
   state.sectionBoundingBoxs = []
   const [start, end] = state.section.sort((a, b) => a.i - b.i)
   let startIndex = 0,
@@ -1553,7 +1555,7 @@ export const setSettionBackground = () => {
                 const boundingBox = getBoundingBoxByNote(item.noteElement, {
                   before: true,
                 })
-                state.befireSection = item
+                state.befireSection = !boundingBox && state.befireSection ? state.befireSection : item
                 if (!boundingBox) {
                   continue
                 }

+ 1 - 1
src/subpages/colexiu/buttons/evaluating.tsx

@@ -562,7 +562,7 @@ const handleComplexButton = (res?: IPostMessage) => {
 };
 
 // 离开之前再提交一次最高分数
-const submitMaxScore = () => {
+export const submitMaxScore = () => {
   const search = useOriginSearch()
   if (search.unitId && scoreList.length) {
     console.log('最高分',scoreList,Math.max(...scoreList))

+ 2 - 0
src/subpages/colexiu/buttons/index.tsx

@@ -35,6 +35,7 @@ import { toggleMusicSheet } from '../plugins/toggleMusicSheet'
 import classNames from 'classnames'
 import Metronome, { metronomeData } from '/src/helpers/metronome'
 import { getAllNodes } from '/src/pages/detail/helpers'
+import { submitMaxScore } from '/src/subpages/colexiu/buttons/evaluating'
 
 export const confirmShow: Ref<boolean> = ref(false)
 
@@ -91,6 +92,7 @@ const beforeCheck = (cb: (status: boolean) => void) => {
 }
 
 const back: () => void = () => {
+  submitMaxScore()
   sendBackRecordTotalTime()
   postMessage({
     api: 'back',