Просмотр исходного кода

Merge branch 'feature-tianyong-newVersion' into ktyq-test-new

TIANYONG 7 месяцев назад
Родитель
Сommit
432da9711a

+ 6 - 3
src/helpers/customMusicScore.ts

@@ -595,8 +595,8 @@ export const resetFormate = () => {
 		if (!state.isCreateImg && !state.isPreView) {
 			staves.forEach((stave: any,i: number) => {
 				const list = [
-					Array.from(stave?.getElementsByTagName("text") || []),
 					Array.from(stave?.querySelectorAll(".vf-StaveSection") || []),
+					Array.from(stave?.getElementsByTagName("text") || []),
 					Array.from(stave?.querySelectorAll(".vf-Volta") || []),
 					Array.from(stave?.querySelectorAll(".vf-clef") || []),
 					Array.from(stave?.querySelectorAll(".vf-keysignature") || []),
@@ -625,10 +625,13 @@ export const resetFormate = () => {
 				const customG = `<g>${rect}${rectBottom}</g>`
 				try {
 					if (list.length) {
-						list.forEach((_el: any) => {
+						for(const _el of list) {
+							if (_el?.parentElement?.classList?.contains('vf-StaveSection')) {
+								continue;
+							}
 							stave?.appendChild(_el)
 							_el?.style?.removeProperty("display");
-						});
+						}
 					}
 				} catch (error) {}
 				stave.innerHTML = customG + stave.innerHTML;

+ 21 - 1
src/helpers/formateMusic.ts

@@ -1260,7 +1260,27 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			 */
 			if (state.isEvxml && note.isRestFlag && note?.noteTimeInfo?.length === 0 && state.xmlHasTimes ) {
 				const idx = _notes.findIndex(item=>item.note === note);
-				const allowRange = Math.abs(_notes[idx+1]?.note?.noteTimeInfo?.[0]?.begin*1000 - _notes[idx-1]?.note?.noteTimeInfo?.[0]?.end*1000) < 10;
+				let nextNoteTimes = _notes[idx+1]?.note?.noteTimeInfo?.[0]?.begin*1000 
+				let preNoteTImes = _notes[idx-1]?.note?.noteTimeInfo?.[0]?.end*1000
+				// 当下一个音符也没有时间的时候,再往下一个找
+				if(!nextNoteTimes && nextNoteTimes!==0){
+					let nextIndex = idx + 2
+					while(!nextNoteTimes && nextIndex<_notes.length){
+						nextNoteTimes = _notes[nextIndex]?.note?.noteTimeInfo?.[0]?.begin*1000
+						nextIndex ++
+					}
+					// 当最后音符就是没有打时间的休止小节,可能nextNoteTimes时间找不到,目前没有处理
+				}
+				if(!preNoteTImes && preNoteTImes!==0){
+					let preIndex = idx - 2
+					while(!preNoteTImes && preIndex>-1){
+						preNoteTImes = _notes[preIndex]?.note?.noteTimeInfo?.[0]?.end*1000
+						preIndex --
+					}
+					// 当没有找到preNoteTImes的时候 赋值为0 (当第一个音符就是没有打时间的休止小节会出现这种情况)
+					preNoteTImes || (preNoteTImes = 0)
+				}
+				const allowRange = Math.abs(nextNoteTimes - preNoteTImes)< 10;
 				if (allowRange) {
 					note.maxNoteNum = note.maxNoteNum - 1;
 					// 唱名时间补齐,当删除这个音符的时候,上个音符的持续时间要加上这个音符的时间

+ 3 - 1
src/page-instrument/header-top/index.tsx

@@ -690,7 +690,9 @@ export default defineComponent({
           {/* 返回和标题 */}
           {!(state.playState == "play" || followData.start || evaluatingData.startBegin) && (
             <div id="noticeBarRollDom" class={styles.headTopLeftBox}>
-              <img src={iconBack} class={["headTopBackBtn", styles.img, !headTopData.showBack && styles.hidenBack]} onClick={handleBack} />
+              {
+                !query.isMove && <img src={iconBack} class={["headTopBackBtn", styles.img, !headTopData.showBack && styles.hidenBack]} onClick={handleBack} />
+              }
               {smoothAnimationState.isShow.value || state.isCombineRender ? (
                 <div
                   style={

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

@@ -519,7 +519,6 @@ export default defineComponent({
           "--detailDataPaddingLeft": detailData.paddingLeft,
           paddingLeft: detailData.paddingLeft,
           background: state.setting.camera && state.modeType === 'evaluating' ? `rgba(${state.setting.eyeProtection ? "253,244,229" : "255,255,255"} ,${state.setting.cameraOpacity / 100}) !important` : "",
-          paddingTop: query.isMove == "1" ? "60px" : "inherit"
         }}
       >
         {bgJsonData.value ? 

+ 19 - 17
src/view/plugins/move-music-score/index.module.less

@@ -61,47 +61,49 @@
     left: 0;
     top: 0;
     width: 100%;
-    background: #132440;
+    background: rgba(19, 36, 64, 0.5);
     z-index: 999999;
     display: flex;
     align-items: center;
     justify-content: flex-end;
-    padding: 14px 30px;
+    padding: 14PX 30PX;
+    pointer-events: none;
     .editItem {
         display: flex;
         align-items: center;
-        padding: 5px 12px;
+        padding: 5PX 12PX;
         background: rgba(255,255,255,0.2);
-        border-radius: 20px;
-        margin-left: 18px;
+        border-radius: 20PX;
+        margin-left: 18PX;
         cursor: pointer;
+        pointer-events: all;
         &:active {
             opacity: .5;
         }
         img {
-            width: 18px;
-            height: 18px;
-            margin-right: 6px;
+            width: 18PX;
+            height: 18PX;
+            margin-right: 6PX;
         }
         span {
-            font-size: 14px;
+            font-size: 14PX;
             color: #fff;
         }
     }
     .extraItem {
-        margin-left: 18px;
+        margin-left: 18PX;
         display: flex;
         align-items: center;
         justify-content: space-between;
-        padding: 5px 12px;
+        padding: 5PX 12PX;
         background: rgba(255,255,255,0.2);
-        border-radius: 20px;
+        border-radius: 20PX;
         position: relative;
-        width: 76px;
+        width: 76PX;
         box-sizing: border-box;
         img {
-            width: 18px;
-            height: 18px;
+            width: 18PX;
+            height: 18PX;
             cursor: pointer;
             &:active {
                 opacity: .5;
@@ -113,8 +115,8 @@
             left: 50%;
             top: 50%;
             transform: translate(-50%,-50%);
-            width: 1px;
-            height: 20px;
+            width: 1PX;
+            height: 20PX;
             background: rgba(255,255,255,0.3);
             z-index: 1;
         }

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

@@ -78,7 +78,7 @@ function initSvgId() {
 	if (!svg) return;
 	const vfstavetempo: HTMLElement[] = Array.from(svg.querySelectorAll(".vf-stavetempo"));
 	const vftext: HTMLElement[] = Array.from(svg.querySelectorAll(".vf-text"));
-	const vfstaveSection: HTMLElement[] = []; //Array.from(svg.querySelectorAll(".vf-StaveSection"));
+	const vfstaveSection: HTMLElement[] = Array.from(svg.querySelectorAll(".vf-StaveSection"));
 	const vfRepetition: HTMLElement[] = Array.from(svg.querySelectorAll(".vf-Repetition"));
 	const vflineGroup: HTMLElement[] = Array.from(svg.querySelectorAll(".vf-lineGroup"));
 	// console.log('速度标记',vfstavetempo)