Browse Source

fix: bug修改

TIANYONG 9 tháng trước cách đây
mục cha
commit
26f3be5f07

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

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

+ 5 - 2
src/state.ts

@@ -1256,6 +1256,7 @@ export const handleSelection = (item: any) => {
       setSection(state.section[0].MeasureNumberXML, state.section[1].MeasureNumberXML)
       //state.section = formateSelectMearure(state.section);
       closeToast();
+      resetCursorPosition();
     }
   }
   if (state.section.length === 1) {
@@ -1430,7 +1431,7 @@ const getMusicInfo = async (res: any) => {
   let partIndexs = query["part-index"] ? query["part-index"].split(",") : ["-1"] // -1为partIndex没有值的时候
   partIndexs = partIndexs.map((indexStr:string) => {
     return parseInt(indexStr)
-  }).sort();
+  }).sort((a, b) => a - b);
   let partIndex = partIndexs[0]
   // 当partIndexs 大于1个的时候,代表用户自己选择了多个声部,用总谱渲染的逻辑
   if(partIndexs.length > 1){
@@ -2291,7 +2292,9 @@ export const resetCursorPosition = () => {
     currentActive?.classList.remove('dotActive');
     const currentDot = document.querySelector(`.noteIndex_${state.activeNoteIndex}`)
     if (currentDot) {
-      currentDot.classList.add('dotActive')
+      setTimeout(() => {
+        currentDot.classList.add('dotActive')
+      }, 0);
     }
   } else {
     const currentActive = document.querySelector(`.dotActive`);

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

@@ -621,7 +621,7 @@ export const handleViewReport = (key: "recordId" | "recordIdStr", type: "gym" |
       url = location.origin + location.pathname + "report-share.html?id=" + id;
       break;
     case "instrument":
-      url = location.origin + location.pathname + "#/evaluat-report?id=" + id + "&musicRenderType=" + state.musicRenderType;
+      url = location.origin + location.pathname + "#/evaluat-report?id=" + id + "&musicRenderType=" + state.musicRenderType + "&systemType=" + state.systemType;
       break;
     default:
       url = location.origin + location.pathname + "report-share.html?id=" + id;

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

@@ -213,6 +213,7 @@ export default defineComponent({
 			state.isLoading = true
 			state.evXmlBeginArr = [];
 			state.vfmeasures = [];
+			state.activeNoteIndex = 0;
 			musicData.showSelection = false;
 			state.osmd.clear();
 			const container = document.getElementById('musicAndSelection'), svgDom = document.getElementById('osmdCanvasPage1');
@@ -225,6 +226,7 @@ export default defineComponent({
 				// 在滚动过程中(雄鹰高飞这种marginbottom比较大的) 多行谱和一行谱切换 滚动高度会出问题
 				container && (container.scrollTop = 0)
 				//setRenderType();
+				state.basePlayRate = 1;
 				await getXML();
 				await init();
 				musicData.showSelection = true;
@@ -251,7 +253,7 @@ export default defineComponent({
 				]}
 			>
 				{slots.default?.()}
-				{props.showSelection && musicData.showSelection && !state.isEvaluatReport &&!state.isSimplePage && state.musicRendered && <Selection />}
+				{props.showSelection && musicData.showSelection && !state.isEvaluatReport &&!state.isSimplePage && !state.isPreView && state.musicRendered && <Selection />}
 			</div>
 		);
 	},

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

@@ -223,7 +223,8 @@ export default defineComponent({
 							return stave.MeasureNumberXML === item.MeasureNumberXML	
 						})
 						// 获取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')?.getBoundingClientRect()?.x || 0;
+						const currBgX = document.getElementById(currItem.stave.attrs.id)?.querySelector('.vf-custom-bg')?.getBBox()?.x * state.zoom || 0;
 						return currItem && {
 							left: currBgX ? currBgX + 'px' : currItem.staveBox.left,
 							top: currItem.staveBox.top,