colexiu-report.4a64bf4c.js 12 KB

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