|
|
-import{d as f,E as y,U as h,bx as r,K as w,S as v,an as T,j as i,aI as b,A as _,ap as S}from"./index-c06dff24.js";import{s as x}from"./instrument-e09f1d21.js";import"./vue3-lottie.es-68f6c1c8.js";import"./index-8e339af1.js";import"./index-00399da9.js";import"./index-ed9fc7aa.js";const L="_skeleton_vtlsh_1",A="_detail_vtlsh_12",N="_container_vtlsh_20",c={skeleton:L,detail:A,container:N},C=f({name:"music-list",setup(){const d=y(),o="productRenderType",e=h({isLoading:!0,isProductLoading:!1,step:0,product:[{state:!1,name:"五线谱",type:r.staff,base64:""},{state:!1,name:"首调",type:r.firstTone,base64:""},{state:!1,name:"固定调",type:r.fixedTone,base64:""}]});w(()=>{window.appName="colexiu",v.xmlUrl=d.xmlUrl,sessionStorage.setItem(o,e.product[e.step].type),T({message:"生成中",duration:0}),setTimeout(()=>{e.isLoading=!1},500)});const p=async()=>{var t;e.product[e.step].state=!0,e.product[e.step].base64=await l();try{console.log(JSON.parse(JSON.stringify(e.product)),e.step)}catch(n){}if(e.step+=1,e.step!==e.product.length){sessionStorage.setItem(o,e.product[e.step].type),_(()=>{e.isLoading=!0,setTimeout(()=>{e.isLoading=!1},500)});return}S(),console.log(e.product),(t=window.parent)==null||t.postMessage({api:"webApi_renderSvg",product:JSON.stringify(e.product)},"*")},l=()=>new Promise(t=>{setTimeout(async()=>{var n;try{const s=(n=document.getElementById("osmdSvgPage1"))==null?void 0:n.cloneNode(!0);if(!s){t("");return}const u=s.width.animVal.value,m=s.height.animVal.value,a=document.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("width",`${u*2}`),a.setAttribute("height",`${m*2}`),a.setAttribute("fill","#fff"),s.prepend(a);const g=x(s.outerHTML).toDataURL("image/png",1);t(g)}catch(s){t("")}},500)});return()=>i("div",{class:c.detail},[i("div",{id:"scrollContainer",class:[c.container,"hideCursor"]},[!e.isLoading&&i(b,{renderTypeKey:o,showSelection:!1,onRendered:p},null)])])}});export{C as default};
|
|
|
+import{d as f,E as y,U as h,by as r,K as w,S as v,an as T,j as i,aI as b,A as _,ap as S}from"./index-6199309f.js";import{s as L}from"./instrument-7657205f.js";import"./vue3-lottie.es-40cc32b9.js";import"./index-ecb0d945.js";import"./index-2f8d5658.js";import"./index-f6dbcd56.js";const x="_skeleton_vtlsh_1",A="_detail_vtlsh_12",N="_container_vtlsh_20",c={skeleton:x,detail:A,container:N},C=f({name:"music-list",setup(){const d=y(),o="productRenderType",e=h({isLoading:!0,isProductLoading:!1,step:0,product:[{state:!1,name:"五线谱",type:r.staff,base64:""},{state:!1,name:"首调",type:r.firstTone,base64:""},{state:!1,name:"固定调",type:r.fixedTone,base64:""}]});w(()=>{window.appName="colexiu",v.xmlUrl=d.xmlUrl,sessionStorage.setItem(o,e.product[e.step].type),T({message:"生成中",duration:0}),setTimeout(()=>{e.isLoading=!1},500)});const p=async()=>{var t;e.product[e.step].state=!0,e.product[e.step].base64=await l();try{console.log(JSON.parse(JSON.stringify(e.product)),e.step)}catch(n){}if(e.step+=1,e.step!==e.product.length){sessionStorage.setItem(o,e.product[e.step].type),_(()=>{e.isLoading=!0,setTimeout(()=>{e.isLoading=!1},500)});return}S(),console.log(e.product),(t=window.parent)==null||t.postMessage({api:"webApi_renderSvg",product:JSON.stringify(e.product)},"*")},l=()=>new Promise(t=>{setTimeout(async()=>{var n;try{const s=(n=document.getElementById("osmdSvgPage1"))==null?void 0:n.cloneNode(!0);if(!s){t("");return}const u=s.width.animVal.value,m=s.height.animVal.value,a=document.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("width",`${u*2}`),a.setAttribute("height",`${m*2}`),a.setAttribute("fill","#fff"),s.prepend(a);const g=L(s.outerHTML).toDataURL("image/png",1);t(g)}catch(s){t("")}},500)});return()=>i("div",{class:c.detail},[i("div",{id:"scrollContainer",class:[c.container,"hideCursor"]},[!e.isLoading&&i(b,{renderTypeKey:o,showSelection:!1,onRendered:p},null)])])}});export{C as default};
|