Pārlūkot izejas kodu

Merge branch 'feature-tianyong' of http://git.dayaedu.com/tianyong/gym-music-score into hqyDev

黄琪勇 5 mēneši atpakaļ
vecāks
revīzija
5e838db731

+ 4 - 4
dist/instrument.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-06752dc7.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-3291dfd6.js"></script>
 
   <meta charset="UTF-8" />
   <meta name="viewport"
@@ -41,7 +41,7 @@
       })
     }
   </script>
-  <script type="module" crossorigin src="./js/instrument-e5854c2f.js"></script>
+  <script type="module" crossorigin src="./js/instrument-e10b8181.js"></script>
   <link rel="stylesheet" href="./css/instrument-b327992e.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
   <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
@@ -65,8 +65,8 @@
     var vConsole = new window.VConsole();
   </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-a1e80cd8.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-d58f7d67.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-b653339e.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-b493ffbb.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 1 - 1
dist/js/index-455632ed.js → dist/js/index-98612534.js

@@ -1 +1 @@
-import{d as i,g as l,r as d,E as e,o as r,s as c,b as s,M as u}from"./instrument-e5854c2f.js";const f="_skeleton_vtlsh_1",m="_detail_vtlsh_12",p="_container_vtlsh_20",a={skeleton:f,detail:m,container:p},y=i({name:"music-list",setup(){const n=l(),t=d({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:e.staff,base64:""},{state:!1,name:"首调",type:e.firstTone,base64:""},{state:!1,name:"固定调",type:e.fixedTone,base64:""}]});r(()=>{window.appName="colexiu",c.xmlUrl=n.xmlUrl,t.isLoading=!1});const o=async()=>{console.log("渲染完成")};return()=>s("div",{class:a.detail},[s("div",{id:"scrollContainer",class:[a.container,"hideCursor"]},[!t.isLoading&&s(u,{onRendered:o},null)])])}});export{y as default};
+import{d as i,g as l,r as d,E as e,o as r,s as c,b as s,M as u}from"./instrument-e10b8181.js";const f="_skeleton_vtlsh_1",m="_detail_vtlsh_12",p="_container_vtlsh_20",a={skeleton:f,detail:m,container:p},y=i({name:"music-list",setup(){const n=l(),t=d({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:e.staff,base64:""},{state:!1,name:"首调",type:e.firstTone,base64:""},{state:!1,name:"固定调",type:e.fixedTone,base64:""}]});r(()=>{window.appName="colexiu",c.xmlUrl=n.xmlUrl,t.isLoading=!1});const o=async()=>{console.log("渲染完成")};return()=>s("div",{class:a.detail},[s("div",{id:"scrollContainer",class:[a.container,"hideCursor"]},[!t.isLoading&&s(u,{onRendered:o},null)])])}});export{y as default};

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/index-acb8a89e.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/index-b18c1417.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/index-c46b557b.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/index-legacy-06a5aa41.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/index-legacy-2eb3d340.js


+ 1 - 1
dist/js/index-legacy-711f86a7.js → dist/js/index-legacy-5816d614.js

@@ -1 +1 @@
-System.register(["./instrument-legacy-d58f7d67.js"],(function(e,t){"use strict";var i,n,a,o,r,s,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=>{i=e.d,n=e.g,a=e.r,o=e.E,r=e.o,s=e.s,l=e.b,d=e.M}],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",i({name:"music-list",setup(){const e=n(),i=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:""}]});r((()=>{window.appName="colexiu",s.xmlUrl=e.xmlUrl,i.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!i.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));
+System.register(["./instrument-legacy-b493ffbb.js"],(function(e,t){"use strict";var i,n,a,o,r,s,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=>{i=e.d,n=e.g,a=e.r,o=e.E,r=e.o,s=e.s,l=e.b,d=e.M}],execute:function(){const t="_detail_vtlsh_12",c="_container_vtlsh_20";e("default",i({name:"music-list",setup(){const e=n(),i=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:""}]});r((()=>{window.appName="colexiu",s.xmlUrl=e.xmlUrl,i.isLoading=!1}));const h=async()=>{console.log("渲染完成")};return()=>l("div",{class:t},[l("div",{id:"scrollContainer",class:[c,"hideCursor"]},[!i.isLoading&&l(d,{onRendered:h},null)])])}}))}}}));

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/index-legacy-955740ec.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/instrument-e10b8181.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/instrument-legacy-b493ffbb.js


+ 1 - 1
dist/js/modeView-2d50e81c.js → dist/js/modeView-31f847f2.js

@@ -1 +1 @@
-import{d as c,K as r,a1 as i,q as m,b as o,a2 as u,a3 as a,s as e,a4 as t,a5 as s,a6 as g,a7 as h,a8 as p}from"./instrument-e5854c2f.js";const v=c({name:"modeView",setup(){var l;r(()=>i.socketErrorStatus,()=>{i.socketErrorStatus===2&&setTimeout(()=>{i.socketErrorPop=!1},1e3)});const n=m(),d=((l=navigator==null?void 0:navigator.userAgent)==null?void 0:l.includes("UAWEIVRD-W09"))||(n==null?void 0:n.iPad)||n.isTablet;return()=>o("div",{class:[a.modeView,d&&a.isiPad,s.modeType!=="init"&&a.hidden]},[o("img",{src:u,class:a.back,onClick:()=>{e.isSingleLine&&(t.isShow.value=e.melodyLine),s.oldModeType!=="practise"&&(i.needCheckErjiStatus=!1,s.handleChangeModeType(s.oldModeType)),s.modeType="show"}},null),o("div",{class:[a.modeBox,(!e.isPercussion&&!e.enableEvaluation||e.isPercussion&&e.enableEvaluation||e.isPercussion&&!e.enableEvaluation)&&a.twoModeBox]},[o("img",{class:a.modeImg,src:g,onClick:()=>{e.isSingleLine&&(t.isShow.value=e.melodyLine),s.handleChangeModeType("practise")}},null),!e.isPercussion&&o("img",{class:a.modeImg,src:h,onClick:()=>s.handleChangeModeType("follow")},null),e.enableEvaluation&&o("img",{class:a.modeImg,src:p,onClick:()=>{i.needCheckErjiStatus=!0,s.handleChangeModeType("evaluating")}},null)])])}});export{v as default};
+import{d as c,K as r,a1 as i,q as m,b as o,a2 as u,a3 as a,s as e,a4 as t,a5 as s,a6 as g,a7 as h,a8 as p}from"./instrument-e10b8181.js";const v=c({name:"modeView",setup(){var l;r(()=>i.socketErrorStatus,()=>{i.socketErrorStatus===2&&setTimeout(()=>{i.socketErrorPop=!1},1e3)});const n=m(),d=((l=navigator==null?void 0:navigator.userAgent)==null?void 0:l.includes("UAWEIVRD-W09"))||(n==null?void 0:n.iPad)||n.isTablet;return()=>o("div",{class:[a.modeView,d&&a.isiPad,s.modeType!=="init"&&a.hidden]},[o("img",{src:u,class:a.back,onClick:()=>{e.isSingleLine&&(t.isShow.value=e.melodyLine),s.oldModeType!=="practise"&&(i.needCheckErjiStatus=!1,s.handleChangeModeType(s.oldModeType)),s.modeType="show"}},null),o("div",{class:[a.modeBox,(!e.isPercussion&&!e.enableEvaluation||e.isPercussion&&e.enableEvaluation||e.isPercussion&&!e.enableEvaluation)&&a.twoModeBox]},[o("img",{class:a.modeImg,src:g,onClick:()=>{e.isSingleLine&&(t.isShow.value=e.melodyLine),s.handleChangeModeType("practise")}},null),!e.isPercussion&&o("img",{class:a.modeImg,src:h,onClick:()=>s.handleChangeModeType("follow")},null),e.enableEvaluation&&o("img",{class:a.modeImg,src:p,onClick:()=>{i.needCheckErjiStatus=!0,s.handleChangeModeType("evaluating")}},null)])])}});export{v as default};

+ 1 - 1
dist/js/modeView-legacy-0762ae84.js → dist/js/modeView-legacy-129fa188.js

@@ -1 +1 @@
-System.register(["./instrument-legacy-d58f7d67.js"],(function(e,i){"use strict";var s,a,n,o,l,t,d,r,u,c,m,g,v;return{setters:[e=>{s=e.d,a=e.K,n=e.a1,o=e.q,l=e.b,t=e.a2,d=e.a3,r=e.s,u=e.a4,c=e.a5,m=e.a6,g=e.a7,v=e.a8}],execute:function(){e("default",s({name:"modeView",setup(){var e,i;a((()=>n.socketErrorStatus),(()=>{2===n.socketErrorStatus&&setTimeout((()=>{n.socketErrorPop=!1}),1e3)}));const s=o(),h=(null===(e=navigator)||void 0===e||null===(i=e.userAgent)||void 0===i?void 0:i.includes("UAWEIVRD-W09"))||(null==s?void 0:s.iPad)||s.isTablet;return()=>l("div",{class:[d.modeView,h&&d.isiPad,"init"!==c.modeType&&d.hidden]},[l("img",{src:t,class:d.back,onClick:()=>{r.isSingleLine&&(u.isShow.value=r.melodyLine),"practise"!==c.oldModeType&&(n.needCheckErjiStatus=!1,c.handleChangeModeType(c.oldModeType)),c.modeType="show"}},null),l("div",{class:[d.modeBox,(!r.isPercussion&&!r.enableEvaluation||r.isPercussion&&r.enableEvaluation||r.isPercussion&&!r.enableEvaluation)&&d.twoModeBox]},[l("img",{class:d.modeImg,src:m,onClick:()=>{r.isSingleLine&&(u.isShow.value=r.melodyLine),c.handleChangeModeType("practise")}},null),!r.isPercussion&&l("img",{class:d.modeImg,src:g,onClick:()=>c.handleChangeModeType("follow")},null),r.enableEvaluation&&l("img",{class:d.modeImg,src:v,onClick:()=>{n.needCheckErjiStatus=!0,c.handleChangeModeType("evaluating")}},null)])])}}))}}}));
+System.register(["./instrument-legacy-b493ffbb.js"],(function(e,i){"use strict";var s,a,n,o,l,t,d,r,u,c,m,g,v;return{setters:[e=>{s=e.d,a=e.K,n=e.a1,o=e.q,l=e.b,t=e.a2,d=e.a3,r=e.s,u=e.a4,c=e.a5,m=e.a6,g=e.a7,v=e.a8}],execute:function(){e("default",s({name:"modeView",setup(){var e,i;a((()=>n.socketErrorStatus),(()=>{2===n.socketErrorStatus&&setTimeout((()=>{n.socketErrorPop=!1}),1e3)}));const s=o(),h=(null===(e=navigator)||void 0===e||null===(i=e.userAgent)||void 0===i?void 0:i.includes("UAWEIVRD-W09"))||(null==s?void 0:s.iPad)||s.isTablet;return()=>l("div",{class:[d.modeView,h&&d.isiPad,"init"!==c.modeType&&d.hidden]},[l("img",{src:t,class:d.back,onClick:()=>{r.isSingleLine&&(u.isShow.value=r.melodyLine),"practise"!==c.oldModeType&&(n.needCheckErjiStatus=!1,c.handleChangeModeType(c.oldModeType)),c.modeType="show"}},null),l("div",{class:[d.modeBox,(!r.isPercussion&&!r.enableEvaluation||r.isPercussion&&r.enableEvaluation||r.isPercussion&&!r.enableEvaluation)&&d.twoModeBox]},[l("img",{class:d.modeImg,src:m,onClick:()=>{r.isSingleLine&&(u.isShow.value=r.melodyLine),c.handleChangeModeType("practise")}},null),!r.isPercussion&&l("img",{class:d.modeImg,src:g,onClick:()=>c.handleChangeModeType("follow")},null),r.enableEvaluation&&l("img",{class:d.modeImg,src:v,onClick:()=>{n.needCheckErjiStatus=!0,c.handleChangeModeType("evaluating")}},null)])])}}))}}}));

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/polyfills-06752dc7.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/polyfills-3291dfd6.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/polyfills-legacy-a1e80cd8.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/js/polyfills-legacy-b653339e.js


+ 1 - 1
osmd-extended

@@ -1 +1 @@
-Subproject commit 46bdba03a3654e74d0ad2bd61e993a2467d0f80e
+Subproject commit 2692703cac7823ace1b04e8923c5eb4648d2b72e

+ 4 - 3
src/helpers/formateMusic.ts

@@ -802,7 +802,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 	const customNoteCurrentTime = customData.customNoteCurrentTime;
 	const detailId = state.examSongId + "";
 	const partIndex = state.partIndex + "";
-	let fixtime = browserInfo.huawei ? 0.08 : 0; //getFixTime()
+	//let fixtime = browserInfo.huawei ? 0.08 : 0; //getFixTime()
+	let fixtime = 0;
 	const allNotes: any[] = [];
 	const allNoteId: string[] = [];
 	const allMeasures: any[] = [];
@@ -882,7 +883,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 		if (state.isCombineRender) {
 			iterator.currentVoiceEntries = iterator.currentVoiceEntries.filter((item: any) => {
 				const trackName = state.isEvxml && state.evxmlAddPartName ? item.parentVoice.parent.IdString || '' : item.parentVoice.parent.Name || '';
-				return trackName === firstTrackName
+				return trackName?.trim() === firstTrackName
 			});
 		}
 		let minIndex = 0, elRealValue = 0
@@ -1059,7 +1060,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			
 			// 合并展示某些分轨,需要把展示的分轨筛选出来
 			if (state.isCombineRender && note.sourceMeasure.verticalMeasureList.length) {
-				note.sourceMeasure.verticalMeasureList = note.sourceMeasure?.verticalMeasureList.filter((item: any) => state.canSelectTracks.includes(item?.parentStaff?.parentInstrument.Name))
+				note.sourceMeasure.verticalMeasureList = note.sourceMeasure?.verticalMeasureList.filter((item: any) => state.canSelectTracks.includes(item?.parentStaff?.parentInstrument.Name?.trim()))
 			}
 
 			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[currentTrackIndex]] || [];

+ 29 - 0
src/helpers/svgToPng.ts

@@ -0,0 +1,29 @@
+// 将svg转成png
+export const getSvgPngToSize = (osmd: any) => {
+    if (osmd) {
+      if (osmd.Drawer.Backends.length > 0) {
+        var imgList = []
+        
+        for (var idx = 0, len = osmd.Drawer.Backends.length; idx < len; idx++) {
+          var backend = osmd.Drawer.Backends[idx]
+          var state = backend.ctx.state;
+          var width = backend.ctx.width / state.scale.x;
+          var height = backend.ctx.height / state.scale.y;
+          const textX = width - 90,textY = height - 90;
+          const textDom = `<g><text x="${textX}" y="${textY}" stroke-width="3" fill="#000000" stroke="none" stroke-dasharray="none" font-family="Times New Roman" font-size="36px" font-weight="bold" font-style="none">${idx+1}/${len}</text></g>`
+          backend.ctx.svg.innerHTML = backend.ctx.svg.innerHTML + textDom;
+          var cont = new XMLSerializer().serializeToString(
+            backend.ctx.svg
+          )
+          imgList.push({
+            img: cont,
+            width: width,
+            height: height,
+          })
+        }
+        return imgList
+      }
+    } else {
+      console.log('没有OSMD')
+    }
+}

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

@@ -39,7 +39,8 @@ export default defineComponent({
 				state.speed = speed.value
 				// handleSetSpeed(speed.value);
 				if (state.playState === 'paused') {
-					const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.sectionFirst || state.section[0] : state.times[state.activeNoteIndex];
+					// const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.sectionFirst || state.section[0] : state.times[state.activeNoteIndex];
+					const currentItem: any = state.times[state.activeNoteIndex];
 					state.basePlayRate = currentItem?.measureSpeed ? state.speed / currentItem.measureSpeed : state.speed / state.originSpeed;
 				}
 			}

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

@@ -40,6 +40,7 @@ import Loading from "./loading"
 import ExerciseStatistics from "../custom-plugins/ExerciseStatistics"
 import { musicData } from "/src/view/music-score"
 import Vip from "/src/page-instrument/component/vip"
+import { getSvgPngToSize } from "/src/helpers/svgToPng"
 // import bgJson from "./images/index.json";
 
 // const DelayCheck = defineAsyncComponent(() =>
@@ -312,6 +313,20 @@ export default defineComponent({
       // } else {
       //   state.musicScoreBtnDirection = state.playBtnDirection;
       // }
+
+      // 管乐迷曲谱详情页,需要下载A4尺寸的图片
+      setTimeout(() => {
+        if (query.downPng === 'A4' && state.partIndex != 999) {
+          const imgList = getSvgPngToSize(state.osmd)
+          console.log('A4', imgList)
+          window.parent.postMessage({
+            api: 'musicStaffRender',
+            loading: false,
+            osmdImg: imgList
+          }, '*');
+        }
+      }, 100);
+
       state.musicScoreBtnDirection = state.playBtnDirection;
       state.musicRendered = true;
 

+ 8 - 2
src/state.ts

@@ -684,6 +684,7 @@ export const onEnded = () => {
 
 // 根据当前小节动态设置,右上角展示的速度
 const dynamicShowPlaySpeed = (index: number, isPlaying?: boolean) => {
+
   //if (!headerColumnHide.value) {
     const item: any = state.times[index];
     if (item && item.measureSpeed ) {
@@ -1184,7 +1185,8 @@ export const handleSetSpeed = (speed: number) => {
   // setStorageSpeed(state.examSongId, speed);
   state.speed = speed;
   // 当前的音符
-  const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.section[0] : state.times[state.activeNoteIndex];
+  // const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.section[0] : state.times[state.activeNoteIndex];
+  const currentItem: any = state.times[state.activeNoteIndex];
   state.basePlayRate = currentItem?.measureSpeed ? state.speed / currentItem.measureSpeed : state.speed / state.originSpeed;
   const actualRate = state.originAudioPlayRate * state.basePlayRate;
   console.log('速度设置',speed,'小节计算的倍率',state.basePlayRate,'实际播放倍率',actualRate)
@@ -1521,7 +1523,11 @@ function xmlToTracks(xmlString: string) {
 // 设置音源
 function initMusicSource(data: any, tracks: string[], partIndex: number, workRecordInstrumentId?: string) {
   let track:string,index:number, musicalInstrumentId: string
-  const instrumentId = workRecordInstrumentId || query.instrumentId || storeData.user?.instrumentId
+  let instrumentId = workRecordInstrumentId || query.instrumentId || storeData.user?.instrumentId
+  // 打击乐特殊处理  当曲目乐器为2266(打击乐(键盘))和2267(小军鼓)时候,从打击乐分类下 进入的时候
+  if(["2266", "2267"].includes(data.musicalInstrumentIds)){
+    instrumentId = data.musicalInstrumentIds
+  }
   state.instrumentId = instrumentId;
   let { musicSheetType, isAllSubject, musicSheetSoundList, musicSheetAccompanimentList } = data
   musicSheetSoundList || (musicSheetSoundList = [])

+ 8 - 2
src/view/music-score/index.tsx

@@ -169,10 +169,16 @@ export default defineComponent({
 				const canSelectTracks = state.combinePartIndexs.length > 1 ? state.combinePartIndexs.map(partIndex => { return state.partListNames[partIndex] }) : state.canSelectTracks
 				for (let i = 0; i < osmd.Sheet.Instruments.length; i++) {
 					const trackName = state.isEvxml && state.evxmlAddPartName ? osmd.Sheet.Instruments[i].idString || '' : osmd.Sheet.Instruments[i].Name || '';
-					osmd.Sheet.Instruments[i].Visible = canSelectTracks.includes(trackName)
+					osmd.Sheet.Instruments[i].Visible = canSelectTracks.includes(trackName.trim())
 				}
 			}
-			osmd.zoom = state.zoom;
+			if (query.downPng === 'A4') {
+				osmd.EngravingRules.PageTopMargin = 5
+				osmd.setPageFormat('794x1100')
+				osmd.zoom = 0.3;
+			} else {
+				osmd.zoom = state.zoom;
+			}
 			osmd.render();
 			console.log("🚀 ~ osmd:", osmd)
 			emit("rendered", osmd);

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

@@ -219,6 +219,12 @@ export const filterMoveData = async () => {
 				};
 				if (n.type === "vf-lineGroup") {
 					item.dx = n.dx;
+					// 需要获取当前渐强渐弱线所对应的小节的宽度,算出相对当前宽度的比例,用于不同设备回显用
+					const measureNum = document.getElementById(n.id)?.getAttribute('data-mnum');
+					const measureWidth = measureNum ? document.querySelector(`g[data-num='${measureNum}']`)?.getBoundingClientRect()?.width : 0;
+					if (measureWidth) {
+						item.dxRate = n.dx / measureWidth;
+					}
 				}
 				if (n.id.includes('text')) {
 					// let copyDom = document.querySelector("#" + n.id)!.cloneNode(true) as SVGSVGElement
@@ -405,6 +411,7 @@ const resetMoveNote = () => {
 		moveData.modelList[i].isMove = false;
 		moveData.modelList[i].isDelete = false;
 		moveData.modelList[i].dx = 0;
+		moveData.modelList[i].dxRate = 0;
 		renderSvgItem(moveData.modelList[i]);
 		if (moveData.modelList[i].type === "vf-lineGroup") {
 			renderLineGroup(moveData.modelList[i]);
@@ -476,10 +483,23 @@ function renderLineGroup(lineGroup: any) {
 				dx2 = dx2[0] && !isNaN(Number(dx2[0])) ? Number(dx2[0]) : 0;
 
 				if (dx1 && dx2) {
+					// 根据dxRate比例转换dx
+					let targetDx = lineGroup.dx;
+					if (lineGroup.dxRate) {
+						// 需要获取当前渐强渐弱线所对应的小节的宽度,算出相对当前宽度的比例,用于不同设备回显用
+						const measureNum = document.getElementById(lineGroup.id)?.getAttribute('data-mnum');
+						const measureWidth = measureNum ? document.querySelector(`g[data-num='${measureNum}']`)?.getBoundingClientRect()?.width : 0;
+						targetDx = measureWidth ? measureWidth * lineGroup.dxRate : lineGroup.dx;
+					}
+					// targetDx = targetDx * state.zoom;
+					// console.log('targetDx',targetDx)
+					if (storeData.isApp) {
+						targetDx = targetDx * state.zoom;
+					}
 					if (dx1 < dx2) {
-						d = d.replace(dx2, lineGroup.d2 + lineGroup.dx + "");
+						d = d.replace(dx2, lineGroup.d2 + targetDx + "");
 					} else {
-						d = d.replace(dx1, lineGroup.d2 + lineGroup.dx + "");
+						d = d.replace(dx1, lineGroup.d2 + targetDx + "");
 					}
 					path.setAttribute("d", d);
 				}
@@ -688,4 +708,4 @@ export default defineComponent({
 			</div>
 		);
 	},
-});
+});

BIN
src/view/plugins/toggleMusicSheet/choosePartName/imgs/resetBtn.png


+ 10 - 6
src/view/plugins/toggleMusicSheet/choosePartName/index.module.less

@@ -1,5 +1,6 @@
 .container {
-  width: 334px;
+  width: 573px;
+  height: 332px;
   .head{
       height: 42px;
       position: relative;
@@ -40,7 +41,7 @@
       .titCon{
         display: flex;
         align-items: center;
-        padding: 10px 0;
+        padding-top: 10px;
         &.stickyTit{
           position: sticky;
           top: -1px;
@@ -61,8 +62,12 @@
         }
       }
       .content{
+        display: flex;
+        flex-wrap: wrap;
+        .specialBtn {
+          width: 96px;
+        }
         .selBtn{
-          width: 100%;
           height: 34px;
           line-height: 34px;
           background: #F6F6F6;
@@ -74,9 +79,8 @@
           cursor: pointer;
           border:1px solid transparent;
           margin-top: 10px;
-          &:first-child{
-            margin-top: 0;
-          }
+          margin-right: 10px;
+          padding: 0 8px;
           &.active{
             background: #F2FFFC;
             border-color: #01C1B5;

+ 13 - 5
src/view/plugins/toggleMusicSheet/choosePartName/index.tsx

@@ -7,6 +7,7 @@ import { headImg } from "/src/page-instrument/header-top/image";
 import { toggleMusicSheet } from "../index"
 import okBtn from "./imgs/okBtn.png"
 import cancelBtn from "./imgs/cancelBtn.png"
+import resetBtn from "./imgs/resetBtn.png"
 
 export default defineComponent({
   name: 'choosePartName',
@@ -76,11 +77,11 @@ export default defineComponent({
             {
               state.isScoreRender &&
                 <>
-                  <div class={styles.titCon}>
+                  {/* <div class={styles.titCon}>
                     <div class={styles.tit}>选择总谱</div>
-                  </div>
+                  </div> */}
                   <div class={styles.content}>
-                    <div class={[styles.selBtn, selValues.value.includes(999) && styles.active]} onClick={()=>{ hanldeSelSheet(999, true) }}>总谱</div>
+                    <div class={[styles.selBtn, styles.specialBtn, selValues.value.includes(999) && styles.active]} onClick={()=>{ hanldeSelSheet(999, true) }}>总谱</div>
                   </div>
                 </>
             }
@@ -100,11 +101,18 @@ export default defineComponent({
             </div>
           </div>
           <div class={styles.btnCon}>
-              <img src={ cancelBtn } class={styles.btn} onClick={async () => {
-                  emit('close')
+              <img src={ resetBtn } class={styles.btn} onClick={async () => {
+                  selValues.value = []
                 }
               }></img>
               <img src={ okBtn } class={styles.btn} onClick={async () => {
+                  if (!selValues.value.length) {
+                    showToast({
+                      position: "top",
+                      message: "最少需要选择一个声部"
+                    });
+                    return
+                  }
                   await checkMoveNoSave();
                   nextTick(()=>{
                     emit('close', selValues.value)

+ 6 - 4
src/view/selection/index.module.less

@@ -392,7 +392,7 @@
     :global {
         .node-dot::before{
             height: 120PX;
-            width: 3PX;
+            width: 4PX;
         }
     }
 }
@@ -405,7 +405,7 @@
     :global {
         .node-dot::before{
             height: 140PX;
-            width: 3PX;
+            width: 4PX;
         }
     }
 }
@@ -413,12 +413,13 @@
 .smallZoom {
     .line {
         height: 45PX;
+        min-height: 45PX;
         width: 1PX;
     }
     :global {
         .node-dot::before{
             height: 45PX;
-            width: 1PX;
+            width: 2PX;
         }
     }
 }
@@ -426,12 +427,13 @@
 .litteZoom {
     .line {
         height: 35PX;
+        min-height: 35PX;
         width: 1PX;
     }
     :global {
         .node-dot::before{
             height: 35PX;
-            width: 1PX;
+            width: 2PX;
         }
     }
 }

+ 3 - 3
src/view/tick/index.tsx

@@ -130,10 +130,10 @@ export const handleStartTick = async () => {
 export default defineComponent({
 	name: "metronome",
 	setup() {
-		const posObj = {
+		const posObj = reactive({
 			top: "0px",
 			left: "0px"
-		}
+		})
 		function initPos() {
 			const musicAndSelectionDom = document.querySelector("#musicAndSelection")
 			const osmdSvgPage1Dom = musicAndSelectionDom?.querySelector("#osmdSvgPage1")
@@ -142,7 +142,7 @@ export default defineComponent({
 			const osmdSvgPage1DomPos = osmdSvgPage1Dom?.getBoundingClientRect()
 			const stafflineDomPos = stafflineDom?.getBoundingClientRect()
 			Object.assign(posObj,{
-				top: (osmdSvgPage1DomPos?.top||0)-(musicAndSelectionDomPos?.top||0)-18+"px",
+				top: (osmdSvgPage1DomPos?.top||0)-(musicAndSelectionDomPos?.top||0)+13+"px",
 				left: (stafflineDomPos?.left||0)-(osmdSvgPage1DomPos?.left||0)+"px"
 			})
 		}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
stats.html


+ 1 - 1
vite.config.ts

@@ -52,7 +52,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/, ""),
       },

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels