1 |
- import{f as z,b as P,n as h,d as q,t as Q,c as e,B as j,a5 as U,G as D,q as i,v as a,a4 as K,F as B,P as $,N as H,a3 as J,w as Z,x as ee,y as _,M as te,z as T,o as ae,p as W,r as M,A as G,C as se,D as le,E as oe,H as ne,I as ue,J as re,K as ce,L as ie,k as de,l as pe,m as Ae}from"./use-app.4bb1cc2b.js";import"./lib-flexible.08f197e6.js";/* empty css */import{s as w,E as me}from"./index.8a0a7bdb.js";import{h as ve,N as A,c as S}from"./index.f083c37e.js";import{P as fe}from"./index.67c8b21b.js";import{s as he}from"./state.c5b2dac7.js";import{S as ge}from"./index.d561e8e6.js";import"./index.0c958b36.js";import"./index.40188b28.js";import"./music.b35eb5be.js";import"./index.1876c5d7.js";function Xe(){import("data:text/javascript,")}const Fe="_musicSheet_1x0kx_1",ye="_btn_1x0kx_8",Ce="_btnCont_1x0kx_15",Ee="_popup_1x0kx_21";var xe={musicSheet:Fe,btn:ye,btnCont:Ce,popup:Ee};const Se="_header_18vsl_1",_e="_center_18vsl_4",Ne="_info_18vsl_20",Ie="_demos_18vsl_29",be="_maininfo_18vsl_51",we="_line_18vsl_102",Be="_back_18vsl_116",De="_btns_18vsl_123",Te="_pop_18vsl_132",ke="_close_18vsl_168",Le="_trybtn_18vsl_189";var m={header:Se,center:_e,info:Ne,demos:Ie,maininfo:be,line:we,back:Be,btns:De,pop:Te,close:ke,try:"_try_18vsl_183",trybtn:Le},Oe="/orchestra-music-score/assets/again.78a8b607.svg",Re="/orchestra-music-score/assets/explain.9e197a0a.svg",He="/orchestra-music-score/assets/replay.402515a7.svg",Me="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAAHeq0ewAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAC6ADAAQAAAABAAAACwAAAACBvloGAAABH0lEQVQYGW1Ru0oDURA9s27EQrETEbv8g3+RSgub7IoELASF7CYGbbYQFHLjB4gI2WAT8LPEWjCd7Hjm3t1VwWnmdeacmXsFo3SMSi9iqF4CuodgRRGLj7K+YqvbAbLkru4hYrAD69CY6Ckgz1gu1wR5ck+qK1/wDUJmC4ngyonBA9o8J/410vg2qd4wne9DRDFKrqFYl0aVxQfqDIl8FAYmXHk6wSvc4ijC+GTa8isODRShqjJ4RGlHgOd/whZvkXVgfO8c2Q05d3XzQdgkdZ7FGoIVDnrb9QLp089xNU3jTHKze4yi+ArPao08mdUnNDD6X0qWIe/f8PDbFmFMKh9/lOwtXJnFxHcguuLACz/t3OT8oOqAlzoOnTHfsNo35fxqh9SRnu4AAAAASUVORK5CYII=";const Ge=z(),I=P(),f=h("pitch"),N=h(!1);var Pe=q({name:"ColexiuReportHeader",props:{detail:{type:Object},record:{type:Object},className:{type:String}},emits:["activeChange"],setup(p,{emit:o,expose:E}){const d=()=>{H({api:"back"})},g=()=>{localStorage.getItem("explain-view")!="1"&&(N.value=!0,setTimeout(()=>{N.value=!1,localStorage.setItem("explain-view","1")},5e3))},y=()=>{if(I.source==="evaluation")d();else{const C=sessionStorage.getItem("behaviorId")||""+new Date().valueOf(),t=J.stringifyUrl({url:location.origin+"/orchestra-music-score",query:{id:I.id,behaviorId:C,client:Ge.isTeacher?"teacher":"student"}});H({api:"openAccompanyWebView",content:{url:t,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}};return E({autoShow:g}),()=>{var F;const{detail:C,record:t}=Q(p);return e("header",{class:[m.header,m.className]},[e("div",{class:m.info},[I.source!=="web"?e(j,{onClick:d,class:m.back},{default:()=>[e("img",{src:U,alt:"back"},null)]}):null,e("div",{class:[m.maininfo,"van-ellipsis"]},null),t.value&&((F=t.value)==null?void 0:F.heardLevel)?e(D,{class:m.center,columnNum:5},{default:()=>[e(i,{class:"van-hairline--right"},{text:()=>e("span",null,[a("\u96BE\u5EA6")]),icon:()=>{var n;return e("span",null,[ve[(n=t.value)==null?void 0:n.heardLevel]])}}),e(i,{class:"van-hairline--right"},{text:()=>e("span",null,[a("\u8BC4\u6D4B\u5206\u6570")]),icon:()=>{var n;return e("span",null,[(n=t.value)==null?void 0:n.score,a("\u5206")])}}),e(i,{class:"van-hairline--right",onClick:()=>{f.value="pitch",o("activeChange","pitch")}},{text:()=>e("span",{class:["switch",{active:f.value==="pitch"}]},[a("\u97F3\u51C6")]),icon:()=>{var n;return e("span",{style:{color:"#2DC7AA"}},[(n=t.value)==null?void 0:n.intonation,a("\u5206")])}}),e(i,{class:"van-hairline--right",onClick:()=>{f.value="rhythm",o("activeChange","rhythm")}},{text:()=>e("span",{class:["switch",{active:f.value==="rhythm"}]},[a("\u8282\u594F")]),icon:()=>{var n;return e("span",{style:{color:"#FF4E19"}},[(n=t.value)==null?void 0:n.cadence,a("\u5206")])}}),e(i,{onClick:()=>{f.value="completion",o("activeChange","completion")}},{text:()=>e("span",{class:["switch",{active:f.value==="completion"}]},[a("\u65F6\u503C")]),icon:()=>{var n;return e("span",{style:{color:"#FFC459"}},[(n=t.value)==null?void 0:n.integrity,a("\u5206")])}})]}):null,e(D,{columnNum:3,class:m.btns},{default:()=>{var n,b;return[((n=t.value)==null?void 0:n.videoFilePath)&&((b=t.value)==null?void 0:b.expire)===0&&I.source!=="web"?e(fe,K(t.value,{btnClass:m.btn,popupClass:m.popup}),{default:()=>[e(i,null,{text:()=>e("span",null,[a("\u56DE\u653E")]),icon:()=>e("img",{src:He},null)})]}):null,e(i,{onClick:()=>N.value=!0},{text:()=>e("span",null,[a("\u91CA\u4E49")]),icon:()=>e("img",{src:Re},null)}),I.source!=="web"?e(i,{onClick:y},{text:()=>e("span",null,[a("\u518D\u6765\u4E00\u904D")]),icon:()=>e("img",{src:Oe},null)}):null]}})]),t.value?e("div",{class:m.demos},[f.value==="pitch"&&e(B,null,[e("div",null,[e(A,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null),e("span",null,[a("\u97F3\u9AD8\u4E86")])]),e("div",null,[e(A,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null),e("span",null,[a("\u97F3\u4F4E\u4E86")])])]),he.isPercussion?null:e(B,null,[f.value==="rhythm"&&e(B,null,[e("div",null,[e(A,{fill:"#FF4444",shadow:!0,x:0},null),e("span",null,[a("\u8282\u594F\u5FEB\u4E86")])]),e("div",null,[e(A,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null),e("span",null,[a("\u8282\u594F\u6162\u4E86")])])]),f.value==="completion"&&e("div",null,[e(A,{fill:"#CC75FF"},null),e("span",null,[a("\u65F6\u503C\u4E0D\u8DB3")])])])]):null,e($,{teleport:"body",show:N.value,class:m.pop,style:{width:"60vw"},onClickOverlay:()=>N.value=!1},{default:()=>[e("div",{class:m.close,onClick:()=>N.value=!1},[e("img",{src:Me},null)]),e("h2",null,[a("\u56FE\u6807\u91CA\u4E49")]),e(D,{columnNum:2,class:m.btns,border:!1},{default:()=>[e(i,null,{text:()=>e("span",null,[a("\u7EFF\u8272\u97F3\u7B26\uFF1A\u6F14\u594F\u6B63\u786E")]),icon:()=>e(A,{fill:"#01C1B5"},null)}),e(i,null,{text:()=>e("span",null,[a("\u7EA2\u8272\u97F3\u7B26\uFF1A\u9519\u97F3")]),icon:()=>e(A,{fill:"#FF4444"},null)}),e(i,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u7EA2\u8272\u5728\u524D)\uFF1A\u8282\u594F\u8FC7\u5FEB")]),icon:()=>e(A,{fill:"#FF4444",shadow:!0,x:0},null)}),e(i,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u7EA2\u8272\u5728\u540E)\uFF1A\u8282\u594F\u6162\u4E86")]),icon:()=>e(A,{fill:"#FF4444",shadow:!0,x:-3,y:-2},null)}),e(i,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u9EC4\u8272\u5728\u4E0A)\uFF1A\u97F3\u9AD8\u4E86")]),icon:()=>e(A,{fill:"#FFAB25",shadow:!0,x:-3,y:0},null)}),e(i,null,{text:()=>e("span",null,[a("\u97F3\u7B26\u91CD\u5F71(\u9EC4\u8272\u5728\u4E0B)\uFF1A\u97F3\u4F4E\u4E86")]),icon:()=>e(A,{fill:"#FFAB25",shadow:!0,x:-1,y:-2},null)}),e(i,null,{text:()=>e("span",null,[a("\u7D2B\u8272\u97F3\u7B26\uFF1A\u5B8C\u6574\u5EA6\u4E0D\u8DB3")]),icon:()=>e(A,{fill:"#CC75FF"},null)}),e(i,null,{text:()=>e("span",null,[a("\u7070\u8272\u97F3\u7B26\uFF1A\u672A\u6F14\u594F")]),icon:()=>e(A,{fill:"#AEAEAE"},null)})]})]})])}}});const k=P(),qe=async(p,o)=>{const E=await oe(p);let d=h("");const g=ne(E);d.value=ue(g.parsedXML,{title:o.musicSheetName});const y=Number(k["part-index"])||0;return d.value=re(d.value,y),d},We=p=>{const o=h("loading"),E=h({}),d=h({});return ae(async()=>{var y,C;const g=sessionStorage.getItem("Authorization");if(console.log("\u7B2C\u4E00\u6B21\u8BF7\u6C42",g),!g){const t=await W({api:"getToken"});(y=t==null?void 0:t.content)!=null&&y.accessToken&&sessionStorage.setItem("Authorization",t.content.tokenType+" "+t.content.accessToken)}o.value="loading";try{const t=await M.get("/musicPracticeRecord/getLastEvaluationMusicalNotesPlayStats",{params:{recordId:k.id}});if(!t.data){o.value="error";return}d.value=t.data;const F=await M.get(`/musicSheet/detail/${(C=d.value)==null?void 0:C.musicalNotesPlayStats.examSongId}`);E.value=F.data,_.partIndex=t.data.partIndex||0,o.value="success"}catch(t){o.value="error",console.log(t)}}),[o,E,d]};var Ye=q({name:"Colexiu",setup(){const p=h(),o=h(!0),E=h(!1),d=h(""),g=h([]),y=h([]),[C,t,F]=We(k.id);Z(C,async()=>{if(C.value==="success"&&t.value.xmlFileUrl){const s=await qe(t.value.xmlFileUrl,t.value);d.value=s.value}}),ee();const n=s=>{switch(s){case"CADENCE_FAST":return"translateX(2px)";case"CADENCE_SLOW":return"translateX(-2px)";case"INTONATION_HIGH":return"translateY(-2px)";case"INTONATION_LOW":return"translateY(2px)";default:return""}},b=()=>{const s=["RIGHT","WRONG","CADENCE_WRONG"];return f.value==="pitch"?s.push("CADENCE_FAST","CADENCE_SLOW"):f.value==="rhythm"?s.push("INTONATION_HIGH","INTONATION_LOW"):f.value==="completion"&&s.push("INTEGRITY_WRONG"),F.value.musicalNotesPlayStats.notesData.filter(r=>s.includes(r.musicalErrorType))},L=()=>{Y(),o.value=!1;for(const s of b()){const r=y.value[s.musicalNotesIndex];setTimeout(()=>{if(g.value.includes(r.id))return;g.value.push(r.id);const l=document.getElementById("vf-"+r.id),u=document.getElementById("vf-"+r.id+"-stem"),c=s.musicalErrorType,x=["INTONATION_HIGH","INTONATION_LOW","CADENCE_FAST","CADENCE_SLOW"].includes(c);if(u==null||u.classList.add(S[c]),l==null||l.classList.add(S[c]),l&&x){u==null||u.classList.remove(S[c]),u==null||u.classList.add(S.RIGHT),l==null||l.classList.remove(S[c]),l==null||l.classList.add(S.RIGHT);const v=l.querySelector(".vf-notehead").cloneNode(!0);v.style.transform=n(c),l.style.opacity=".7",u&&(u.style.opacity=".7"),v.id="vf-"+r.id+"-copy",v==null||v.classList.add(S[c]),osmd==null||osmd.container.querySelector("svg").insertAdjacentElement("afterbegin",v)}},300)}},O=s=>{if(!s)return;const r=s.classList.values();for(const l of r)(l==null?void 0:l.indexOf("vf-"))!==0&&s.classList.remove(l)},Y=()=>{for(const s of g.value){O(document.getElementById("vf-"+s)),O(document.getElementById("vf-"+s+"-stem"));const r="vf-"+s+"-copy",l=document.getElementById(r);l&&l.remove()}g.value=[]},X=s=>{var l;o.value=!1,(l=p.value)==null||l.autoShow(),setTimeout(()=>{var u;for(const c of Array.from(document.querySelectorAll(".vf-beam")))(u=c.querySelector("path"))==null||u.setAttribute("fill","#aeaeae")}),G.osmd=s,y.value=se(G.osmd),L();const r=(u,c,x=!0)=>{const v=ce(u);_.evaluatings={..._.evaluatings,[v.measureIndex]:{...v,...ie(c.score),score:c.score,dontTransition:x}}};if(F.value.userMeasureScore){for(const u in F.value.userMeasureScore)if(Object.prototype.hasOwnProperty.call(F.value.userMeasureScore,u)){const c=F.value.userMeasureScore[u];for(const x of y.value)if(c.measureRenderIndex==x.noteElement.sourceMeasure.MeasureNumberXML-1)if(!x.noteElement.tie)r(x,c);else for(const v of x.noteElement.tie.notes){const R=le(v);!R||r(R,c,v!==x.noteElement.tie.StartNote)}}}},V=()=>{E.value=!0,o.value=!1};return()=>{const s=o.value||C.value==="loading",r=E.value||C.value==="error";return e("div",{class:[w.container,T.sett.eyeProtection&&"eyeProtection",T.sett.camera&&"openCamera"]},[e(Pe,{className:w.header,detail:t.value,record:F,ref:p,style:{paddingLeft:_.isSpecialShapedScreen?_.notchHeight/2+"px":"auto"},onActiveChange:()=>L()},null),e("div",{id:"colexiu-detail-music-sheet",class:[w.musicSheet,xe.musicSheet],style:{paddingLeft:_.isSpecialShapedScreen?_.notchHeight/2+"px":"auto"}},[s&&!r&&e(ge,{class:w.skeleton,rowWidth:"80%",title:!0,row:3},null),r&&e(me,null,null),d.value&&e(B,null,[e("h3",{style:{fontSize:"24px",fontWeight:"normal",textAlign:"center",padding:"0 10px",marginTop:"36px",marginBottom:"0px",marginLeft:"auto"},class:"van-ellipsis"},[t.value.musicSheetName]),e(te,{score:d.value,showSection:!0,opotions:{drawTitle:!1,drawComposer:!1,drawLyricist:!1,drawMetronomeMarks:!0,drawMeasureNumbers:!0,autoResize:!1},EngravingRules:{DefaultColorNotehead:"#aeaeae",DefaultColorRest:"#aeaeae",DefaultColorMusic:"#aeaeae",DefaultColorStem:"#aeaeae",DefaultColorChordSymbol:"#aeaeae",DefaultColorLabel:"#aeaeae",DYMusicScoreType:T.sett.type},onRerender:X,onRenderError:V},null)])])])}}});W({api:"getToken"}).then(p=>{var o;console.log("\u83B7\u53D6token",p.content),(o=p==null?void 0:p.content)!=null&&o.accessToken&&sessionStorage.setItem("Authorization",p.content.tokenType+" "+p.content.accessToken)});document.body.style.setProperty("--osdm-zoom",""+de());pe();Ae(Ye).mount("#app");export{Xe as __vite_legacy_guard};
|