index-legacy-58a16751.js 2.6 KB

1
  1. System.register(["./index-legacy-c016c16b.js","./instrument-legacy-2482d01b.js","./vue3-lottie.es-legacy-36a8680f.js","./index-legacy-a9baf59b.js","./index-legacy-ecffa109.js","./index-legacy-460f3060.js"],(function(e,t){"use strict";var i,n,s,o,a,r,d,l,c,u,p,g;return{setters:[e=>{i=e.d,n=e.E,s=e.U,o=e.bz,a=e.K,r=e.S,d=e.an,l=e.k,c=e.aI,u=e.A,p=e.ap},e=>{g=e.s},null,null,null,null],execute:function(){var t=document.createElement("style");t.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(t);const h="_detail_vtlsh_12",m="_container_vtlsh_20";e("default",i({name:"music-list",setup(){const e=n(),t="productRenderType",i=s({isLoading:!0,isProductLoading:!1,step:0,product:[{state:!1,name:"五线谱",type:o.staff,base64:""},{state:!1,name:"首调",type:o.firstTone,base64:""},{state:!1,name:"固定调",type:o.fixedTone,base64:""}]});a((()=>{window.appName="colexiu",r.xmlUrl=e.xmlUrl,sessionStorage.setItem(t,i.product[i.step].type),d({message:"生成中",duration:0}),setTimeout((()=>{i.isLoading=!1}),500)}));const v=async()=>{var e;i.product[i.step].state=!0,i.product[i.step].base64=await y();try{console.log(JSON.parse(JSON.stringify(i.product)),i.step)}catch(n){}if(i.step+=1,i.step!==i.product.length)return sessionStorage.setItem(t,i.product[i.step].type),void u((()=>{i.isLoading=!0,setTimeout((()=>{i.isLoading=!1}),500)}));p(),console.log(i.product),null===(e=window.parent)||void 0===e||e.postMessage({api:"webApi_renderSvg",product:JSON.stringify(i.product)},"*")},y=()=>new Promise((e=>{setTimeout((async()=>{try{var t;const i=null===(t=document.getElementById("osmdSvgPage1"))||void 0===t?void 0:t.cloneNode(!0);if(!i)return void e("");const n=i.width.animVal.value,s=i.height.animVal.value,o=document.createElementNS("http://www.w3.org/2000/svg","rect");o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("width",""+2*n),o.setAttribute("height",""+2*s),o.setAttribute("fill","#fff"),i.prepend(o);const a=g(i.outerHTML).toDataURL("image/png",1);e(a)}catch(i){e("")}}),500)}));return()=>l("div",{class:h},[l("div",{id:"scrollContainer",class:[m,"hideCursor"]},[!i.isLoading&&l(c,{renderTypeKey:t,showSelection:!1,onRendered:v},null)])])}}))}}}));