瀏覽代碼

Merge branch 'feature-patch' into gym-test

TIANYONG 1 月之前
父節點
當前提交
831647a000

+ 8 - 0
dist/instrument.html

@@ -41,7 +41,11 @@
       })
     }
   </script>
+<<<<<<< HEAD
   <script type="module" crossorigin src="./js/instrument-8c2d9a89.js"></script>
+=======
+  <script type="module" crossorigin src="./js/instrument-19994ef7.js"></script>
+>>>>>>> feature-patch
   <link rel="modulepreload" crossorigin href="./js/node_modules-081fca9f.js">
   <link rel="modulepreload" crossorigin href="./js/src-f076abb8.js">
   <link rel="stylesheet" href="./css/instrument-9723cd86.css">
@@ -128,7 +132,11 @@
   </script>   -->
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-00a2b340.js"></script>
+<<<<<<< HEAD
   <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-7f5032c6.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+=======
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-827ff9a8.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+>>>>>>> feature-patch
 </body>
 
 </html>

+ 4 - 0
dist/js/index-463b63db.js

@@ -1 +1,5 @@
+<<<<<<<< HEAD:dist/js/index-463b63db.js
 import{d as s,g as a,r as e,E as t,o,s as n,c as i,M as r}from"./instrument-8c2d9a89.js";import"./node_modules-081fca9f.js";import"./src-f076abb8.js";const d="_detail_vtlsh_12",l="_container_vtlsh_20",c=s({name:"music-list",setup(){const s=a(),c=e({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:t.staff,base64:""},{state:!1,name:"首调",type:t.firstTone,base64:""},{state:!1,name:"固定调",type:t.fixedTone,base64:""}]});o((()=>{window.appName="colexiu",n.xmlUrl=s.xmlUrl,c.isLoading=!1}));const m=async()=>{console.log("渲染完成")};return()=>i("div",{class:d},[i("div",{id:"scrollContainer",class:[l,"hideCursor"]},[!c.isLoading&&i(r,{onRendered:m},null)])])}});export{c as default};
+========
+import{d as s,g as a,r as e,E as t,o,s as n,c as i,M as r}from"./instrument-19994ef7.js";import"./node_modules-081fca9f.js";import"./src-f076abb8.js";const d="_detail_vtlsh_12",l="_container_vtlsh_20",c=s({name:"music-list",setup(){const s=a(),c=e({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:t.staff,base64:""},{state:!1,name:"首调",type:t.firstTone,base64:""},{state:!1,name:"固定调",type:t.fixedTone,base64:""}]});o((()=>{window.appName="colexiu",n.xmlUrl=s.xmlUrl,c.isLoading=!1}));const m=async()=>{console.log("渲染完成")};return()=>i("div",{class:d},[i("div",{id:"scrollContainer",class:[l,"hideCursor"]},[!c.isLoading&&i(r,{onRendered:m},null)])])}});export{c as default};
+>>>>>>>> feature-patch:dist/js/index-daba13d5.js

文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-50456548.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-860f86a5.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-c55c324a.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-c5646255.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-cefe88cb.js


+ 5 - 0
dist/js/index-daba13d5.js

@@ -0,0 +1,5 @@
+<<<<<<<< HEAD:dist/js/index-463b63db.js
+import{d as s,g as a,r as e,E as t,o,s as n,c as i,M as r}from"./instrument-8c2d9a89.js";import"./node_modules-081fca9f.js";import"./src-f076abb8.js";const d="_detail_vtlsh_12",l="_container_vtlsh_20",c=s({name:"music-list",setup(){const s=a(),c=e({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:t.staff,base64:""},{state:!1,name:"首调",type:t.firstTone,base64:""},{state:!1,name:"固定调",type:t.fixedTone,base64:""}]});o((()=>{window.appName="colexiu",n.xmlUrl=s.xmlUrl,c.isLoading=!1}));const m=async()=>{console.log("渲染完成")};return()=>i("div",{class:d},[i("div",{id:"scrollContainer",class:[l,"hideCursor"]},[!c.isLoading&&i(r,{onRendered:m},null)])])}});export{c as default};
+========
+import{d as s,g as a,r as e,E as t,o,s as n,c as i,M as r}from"./instrument-19994ef7.js";import"./node_modules-081fca9f.js";import"./src-f076abb8.js";const d="_detail_vtlsh_12",l="_container_vtlsh_20",c=s({name:"music-list",setup(){const s=a(),c=e({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:t.staff,base64:""},{state:!1,name:"首调",type:t.firstTone,base64:""},{state:!1,name:"固定调",type:t.fixedTone,base64:""}]});o((()=>{window.appName="colexiu",n.xmlUrl=s.xmlUrl,c.isLoading=!1}));const m=async()=>{console.log("渲染完成")};return()=>i("div",{class:d},[i("div",{id:"scrollContainer",class:[l,"hideCursor"]},[!c.isLoading&&i(r,{onRendered:m},null)])])}});export{c as default};
+>>>>>>>> feature-patch:dist/js/index-daba13d5.js

文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-e87d8318.js


+ 4 - 0
dist/js/index-legacy-023a296c.js

@@ -1 +1,5 @@
+<<<<<<<< HEAD:dist/js/index-legacy-023a296c.js
 System.register(["./instrument-legacy-7f5032c6.js","./node_modules-legacy-cc3cd557.js","./src-legacy-53d6b23f.js"],(function(e,t){"use strict";var n,i,a,o,s,r,l,d,c=document.createElement("style");return c.textContent="._skeleton_vtlsh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_vtlsh_12{width:100vw;height:100vh;overflow:hidden;overflow-y:auto;--header-height: 1.65333rem;background:var(--container-background)}._detail_vtlsh_12 ._container_vtlsh_20{margin:0 .26667rem;border-radius:.26667rem}._detail_vtlsh_12 #musicAndSelection{overflow:initial!important;height:initial!important;max-height:initial!important}\n",document.head.appendChild(c),{setters:[e=>{n=e.d,i=e.g,a=e.r,o=e.E,s=e.o,r=e.s,l=e.c,d=e.M},null,null],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",n({name:"music-list",setup(){const e=i(),n=a({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});s((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,n.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!n.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));
+========
+System.register(["./instrument-legacy-827ff9a8.js","./node_modules-legacy-cc3cd557.js","./src-legacy-53d6b23f.js"],(function(e,t){"use strict";var n,i,a,o,s,r,l,d,c=document.createElement("style");return c.textContent="._skeleton_vtlsh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_vtlsh_12{width:100vw;height:100vh;overflow:hidden;overflow-y:auto;--header-height: 1.65333rem;background:var(--container-background)}._detail_vtlsh_12 ._container_vtlsh_20{margin:0 .26667rem;border-radius:.26667rem}._detail_vtlsh_12 #musicAndSelection{overflow:initial!important;height:initial!important;max-height:initial!important}\n",document.head.appendChild(c),{setters:[e=>{n=e.d,i=e.g,a=e.r,o=e.E,s=e.o,r=e.s,l=e.c,d=e.M},null,null],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",n({name:"music-list",setup(){const e=i(),n=a({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});s((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,n.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!n.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));
+>>>>>>>> feature-patch:dist/js/index-legacy-41d4f9ac.js

文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-legacy-0353711d.js


+ 5 - 0
dist/js/index-legacy-41d4f9ac.js

@@ -0,0 +1,5 @@
+<<<<<<<< HEAD:dist/js/index-legacy-023a296c.js
+System.register(["./instrument-legacy-7f5032c6.js","./node_modules-legacy-cc3cd557.js","./src-legacy-53d6b23f.js"],(function(e,t){"use strict";var n,i,a,o,s,r,l,d,c=document.createElement("style");return c.textContent="._skeleton_vtlsh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_vtlsh_12{width:100vw;height:100vh;overflow:hidden;overflow-y:auto;--header-height: 1.65333rem;background:var(--container-background)}._detail_vtlsh_12 ._container_vtlsh_20{margin:0 .26667rem;border-radius:.26667rem}._detail_vtlsh_12 #musicAndSelection{overflow:initial!important;height:initial!important;max-height:initial!important}\n",document.head.appendChild(c),{setters:[e=>{n=e.d,i=e.g,a=e.r,o=e.E,s=e.o,r=e.s,l=e.c,d=e.M},null,null],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",n({name:"music-list",setup(){const e=i(),n=a({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});s((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,n.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!n.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));
+========
+System.register(["./instrument-legacy-827ff9a8.js","./node_modules-legacy-cc3cd557.js","./src-legacy-53d6b23f.js"],(function(e,t){"use strict";var n,i,a,o,s,r,l,d,c=document.createElement("style");return c.textContent="._skeleton_vtlsh_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_vtlsh_12{width:100vw;height:100vh;overflow:hidden;overflow-y:auto;--header-height: 1.65333rem;background:var(--container-background)}._detail_vtlsh_12 ._container_vtlsh_20{margin:0 .26667rem;border-radius:.26667rem}._detail_vtlsh_12 #musicAndSelection{overflow:initial!important;height:initial!important;max-height:initial!important}\n",document.head.appendChild(c),{setters:[e=>{n=e.d,i=e.g,a=e.r,o=e.E,s=e.o,r=e.s,l=e.c,d=e.M},null,null],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",n({name:"music-list",setup(){const e=i(),n=a({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});s((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,n.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!n.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));
+>>>>>>>> feature-patch:dist/js/index-legacy-41d4f9ac.js

文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-legacy-4e95c75f.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-legacy-83487080.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-legacy-c050f84b.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-legacy-f5e7a56a.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/index-legacy-f799c2b1.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/instrument-19994ef7.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/instrument-legacy-7f5032c6.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/instrument-legacy-827ff9a8.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/modeView-7c955b2d.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/modeView-dff47995.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/modeView-legacy-0be66d6f.js


文件差異過大導致無法顯示
+ 1 - 0
dist/js/modeView-legacy-4c8792f3.js


+ 1 - 1
src/constant/instruments.ts

@@ -506,7 +506,7 @@ export const sortMusical = (name: string, index: number) => {
 	return sortId
   }
 
-  export const fixInstrumentNameCode = (trackId: string | number) => {
+export const fixInstrumentNameCode = (trackId: string | number) => {
 	let code: any;
 	const trackName = instruments[trackId] || ''
 	if (trackName.includes('长笛')) {

+ 6 - 2
src/helpers/formateMusic.ts

@@ -900,8 +900,12 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 	let differFrom = 0;
 	// let testIdx = 0;
 	let repeatIdx = 0; // 循环的次数
-	// 当多选声部的时候 ,取选择的第一个声部
-	const firstTrackName = state.combinePartIndexs.length>1 ? state.partListNames[state.combinePartIndexs[0]] : state.canSelectTracks[0] || "";
+	/**
+	 * 当多选声部的时候 ,取选择的第一个声部
+	 * 总谱渲染时,需要取第一个渲染的声轨名字,canSelectTracks返回的声轨名字可能不是第一个,顺序有问题,需要用state.osmd.Sheet.Instruments
+	 */
+	// const firstTrackName = state.combinePartIndexs.length>1 ? state.partListNames[state.combinePartIndexs[0]] : state.canSelectTracks[0] || "";
+	const firstTrackName = state.combinePartIndexs.length>1 ? state.partListNames[state.combinePartIndexs[0]] : (state.osmd.Sheet.Instruments[0].Name || state.osmd.Sheet.Instruments[0].NameLabel.text || "");
 	const currentTrackIndex = state.isCombineRender && state.combinePartIndexs.length > 1 ? state.combinePartIndexs[0] : 0;
 	while (!iterator.EndReached) {
 		// console.log({ ...iterator });

+ 18 - 1
src/state.ts

@@ -26,6 +26,7 @@ import { HANDLE_WORK_ADD } from "/src/page-instrument/custom-plugins/work-index"
 import { speedBeatTo, unitImgs } from "/src/helpers/beatConfig"
 import IndexedDBService from "/src/utils/indexedDB";
 import { musicalInstrumentCodeInfo, instruments, fixInstrumentNameCode } from "/src/constant/instruments";
+import { match } from "assert";
 
 const query: any = getQuery();
 
@@ -1347,9 +1348,11 @@ const getMusicInfo = async (res: any) => {
   const { track, index, musicalInstrumentId } = state.isSimplePage ? { track:tracks[0], index: state.partIndex, musicalInstrumentId: '' } : initMusicSource(res.data, tracks, partIndex, workRecordInstrumentId)
   // 这里返回的track可能和实际的对不上,所以重新筛选一下
   const realTrack = musicalInstrumentId && res.data?.musicalInstruments?.length ? res.data?.musicalInstruments.find((item: any) => item?.id == musicalInstrumentId)?.code?.split(',')?.[0] : '';
+  const instrumentCodes = musicalInstrumentId && res.data?.musicalInstruments?.length ? res.data?.musicalInstruments.find((item: any) => item?.id == musicalInstrumentId)?.code : '';
   const musicInfo = {
     ...res.data,
-    track: res.data.musicSheetType === 'CONCERT' ? track : realTrack
+    track: res.data.musicSheetType === 'CONCERT' ? track : realTrack,
+    instrumentCodes,
   };
   console.log("🚀 ~ musicInfo:", musicInfo);
   setState(musicInfo, index);
@@ -1712,6 +1715,20 @@ const setState = (data: any, index: number) => {
   }
 
   let code = matchVoicePart(state.trackId, "CONCERT")
+  /**
+   * 曲子:中音萨克斯教程2-4,返回的乐器code是"Alto Sax,Alto Saxophone",使用第一个Alto Sax去找,找不到对应的指法,这种情况下需要使用多个code去匹配指法
+   * 如果当前的第一code找不到,用instrumentCodes去找,
+   * 
+   * */ 
+  if (data.instrumentCodes && code == 1 || !code) {
+    for (let name of data.instrumentCodes.split(',')) {
+      let matchCode = matchVoicePart(name, "CONCERT")
+      if (matchCode && matchCode !== 1) {
+        code = matchCode
+        break;
+      }
+    }
+  }
   if (code == 1 || !code) {
     code = fixInstrumentNameCode(state.trackId)
   }

+ 10 - 5
src/view/audio-list/index.tsx

@@ -374,6 +374,8 @@ export async function changeCombineAudio (combineIndex: number){
 		audioData.combineIndex = -1
 		state.playSource = "background"
 		state.music = ""
+		// 当开启节拍器的时候,切为伴奏的时候合成节拍器1
+		await handleLoadBeatMusic()
 		// 当没有背景音文件的时候
 		if(!state.accompany) {
 			state.noMusicSource = true
@@ -398,15 +400,18 @@ export async function changeCombineAudio (combineIndex: number){
 		const music = await createAudio(musicUrl)
 		const beatMusic = await mergeBeatAudio(musicUrl)
 		// 当没有背景音的时候 需要绑定事件
-		if(!state.accompany){
+		if(!audioData.songCollection.backgroundEle){
 			if(music){
 				music.addEventListener("play", onPlay);
 				music.addEventListener("ended", onEnded);
 			}			
-			if(beatMusic){
-				beatMusic.addEventListener("play", onPlay);
-				beatMusic.addEventListener("ended", onEnded);
-			}
+		}
+		// 取消掉背景音绑定的时候,然后给当前原音节拍音频绑定事件,这样防止没有背景节拍的时候,能给
+		if(beatMusic){
+			audioData.songCollection.beatBackgroundEle?.removeEventListener("play", onPlay)
+			audioData.songCollection.beatBackgroundEle?.removeEventListener("ended", onEnded)
+			beatMusic.addEventListener("play", onPlay);
+			beatMusic.addEventListener("ended", onEnded);
 		}
 		audioData.combineMusicEles.push({
 			key: combineIndex,

文件差異過大導致無法顯示
+ 1 - 0
stats.html


+ 1 - 1
vite.config.ts

@@ -81,7 +81,7 @@ export default defineConfig({
     // https: true,
     proxy: {
       "^/instrument/.*": {
-        target: "https://dev.gym.lexiaoya.cn",
+        target: "https://test.gym.lexiaoya.cn",
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/instrument/, ""),
       },

部分文件因文件數量過多而無法顯示