1 |
- import{d as g,F as w,V as y,bn as i,M as h,U as r,ao as v,j as c,aJ as b,aq as _}from"./index-e6ea47ec.js";import{s as T}from"./instrument-5d933ed6.js";import"./index-3c93e7c3.js";import"./vue3-lottie.es-060b3f7f.js";import"./index-ec49d0fc.js";import"./index-5c386838.js";const L="_skeleton_vtlsh_1",x="_detail_vtlsh_12",R="_container_vtlsh_20",l={skeleton:L,detail:x,container:R},k=g({name:"music-list",setup(){const u=w(),e=y({isLoading:!0,isProductLoading:!1,product:[{state:!1,name:"五线谱",type:i.staff,base64:""},{state:!1,name:"首调",type:i.firstTone,base64:""},{state:!1,name:"固定调",type:i.fixedTone,base64:""}]});h(()=>{window.appName="colexiu",r.xmlUrl=u.xmlUrl,r.musicRenderType=i.staff,e.isLoading=!1,v({message:"生成中",duration:0})});const m=async()=>{var o;const s=e.product.find(n=>n.type===r.musicRenderType);if(!s)return;s.state=!0,s.base64=await p();const t=e.product.find(n=>!n.state);if(t){r.musicRenderType=t.type,e.isLoading=!0,setTimeout(()=>e.isLoading=!1,500);return}_(),console.log(e.product),(o=window.parent)==null||o.postMessage({api:"webApi_renderSvg",product:JSON.stringify(e.product)},"*")},p=()=>new Promise(s=>{setTimeout(async()=>{var d;const t=(d=document.getElementById("osmdSvgPage1"))==null?void 0:d.cloneNode(!0);if(!t){s("");return}const o=t.width.animVal.value,n=t.height.animVal.value,a=document.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("width",`${o*2}`),a.setAttribute("height",`${n*2}`),a.setAttribute("fill","#fff"),t.prepend(a);const f=T(t.outerHTML).toDataURL("image/png",1);s(f)},500)});return()=>c("div",{class:l.detail},[c("div",{id:"scrollContainer",class:[l.container,"hideCursor"]},[!e.isLoading&&c(b,{showSelection:!1,onRendered:m},null)])])}});export{k as default};
|