colexiu-report.a13e19de.js 12 KB

1
  1. import{h as j,i as F,d as P,t as V,c as e,j as t,J as Q,F as B,N as M,U,w as z,k as D,o as K,p as $,f as J,e as Z,g as ee}from"./native-message.ed3d4308.js";import"./lib-flexible.08f197e6.js";/* empty css */import{u as q,B as te,G as T,a as d,P as ae,b as se,s as N,M as le,r as H,c as G,g as oe,d as ne,e as ue,f as re,h as ie,o as ce,i as de,j as pe}from"./index.1a3f6844.js";import{s as w,E as Ae}from"./index.cb8a7869.js";import{h as me,N as m,c as _}from"./index.97d44157.js";import{P as ve}from"./index.607cccdf.js";import{s as fe}from"./state.e2c9bb19.js";import{B as he}from"./index.810c4ab2.js";import{S as Fe}from"./index.2ae16974.js";import"./index.8bd5b010.js";import"./index.df56ee9c.js";import"./music.b35eb5be.js";import"./index.149a667b.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",Ne="_center_18vsl_4",Se="_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",Oe="_close_18vsl_168",Le="_trybtn_18vsl_189";var v={header:_e,center:Ne,info:Se,demos:be,maininfo:Ie,line:we,back:Be,btns:De,pop:Te,close:Oe,try:"_try_18vsl_183",trybtn:Le},ke="/orchestra-music-score/assets/again.78a8b607.svg",Re="/orchestra-music-score/assets/explain.9e197a0a.svg",Me="/orchestra-music-score/assets/replay.402515a7.svg",He="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAAHeq0ewAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAC6ADAAQAAAABAAAACwAAAACBvloGAAABH0lEQVQYGW1Ru0oDURA9s27EQrETEbv8g3+RSgub7IoELASF7CYGbbYQFHLjB4gI2WAT8LPEWjCd7Hjm3t1VwWnmdeacmXsFo3SMSi9iqF4CuodgRRGLj7K+YqvbAbLkru4hYrAD69CY6Ckgz1gu1wR5ck+qK1/wDUJmC4ngyonBA9o8J/410vg2qd4wne9DRDFKrqFYl0aVxQfqDIl8FAYmXHk6wSvc4ijC+GTa8isODRShqjJ4RGlHgOd/whZvkXVgfO8c2Q05d3XzQdgkdZ7FGoIVDnrb9QLp089xNU3jTHKze4yi+ArPao08mdUnNDD6X0qWIe/f8PDbFmFMKh9/lOwtXJnFxHcguuLACz/t3OT8oOqAlzoOnTHfsNo35fxqh9SRnu4AAAAASUVORK5CYII=";const Ge=j(),b=q(),h=F("pitch"),S=F(!1);var Pe=P({name:"ColexiuReportHeader",props:{detail:{type:Object},record:{type:Object},className:{type:String}},emits:["activeChange"],setup(p,{emit:l,expose:y}){const i=()=>{M({api:"back"})},g=()=>{localStorage.getItem("explain-view")!="1"&&(S.value=!0,setTimeout(()=>{S.value=!1,localStorage.setItem("explain-view","1")},5e3))},A=()=>{if(b.source==="evaluation")i();else{const C=sessionStorage.getItem("behaviorId")||""+new Date().valueOf(),o=U.stringifyUrl({url:location.origin+"/orchestra-music-score",query:{id:b.id,behaviorId:C,client:Ge.isTeacher?"teacher":"student"}});M({api:"openAccompanyWebView",content:{url:o,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}};return y({autoShow:g}),()=>{var E;const{detail:C,record:o}=V(p);return e("header",{class:[v.header,v.className]},[e("div",{class:v.info},[b.source!=="web"?e(he,{onClick:i,class:v.back},{default:()=>[e("img",{src:te,alt:"back"},null)]}):null,e("div",{class:[v.maininfo,"van-ellipsis"]},null),o.value&&((E=o.value)==null?void 0:E.heardLevel)?e(T,{class:v.center,columnNum:5},{default:()=>[e(d,{class:"van-hairline--right"},{text:()=>e("span",null,[t("\u96BE\u5EA6")]),icon:()=>{var n;return e("span",null,[me[(n=o.value)==null?void 0:n.heardLevel]])}}),e(d,{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(d,{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(d,{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(d,{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(T,{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(ve,Q(o.value,{btnClass:v.btn,popupClass:v.popup}),{default:()=>[e(d,null,{text:()=>e("span",null,[t("\u56DE\u653E")]),icon:()=>e("img",{src:Me},null)})]}):null,e(d,{onClick:()=>S.value=!0},{text:()=>e("span",null,[t("\u91CA\u4E49")]),icon:()=>e("img",{src:Re},null)}),b.source!=="web"?e(d,{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")])])]),fe.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(ae,{teleport:"body",show:S.value,class:v.pop,style:{width:"60vw"},onClickOverlay:()=>S.value=!1},{default:()=>[e("div",{class:v.close,onClick:()=>S.value=!1},[e("img",{src:He},null)]),e("h2",null,[t("\u56FE\u6807\u91CA\u4E49")]),e(T,{columnNum:2,class:v.btns,border:!1},{default:()=>[e(d,null,{text:()=>e("span",null,[t("\u7EFF\u8272\u97F3\u7B26\uFF1A\u6F14\u594F\u6B63\u786E")]),icon:()=>e(m,{fill:"#01C1B5"},null)}),e(d,null,{text:()=>e("span",null,[t("\u7EA2\u8272\u97F3\u7B26\uFF1A\u9519\u97F3")]),icon:()=>e(m,{fill:"#FF4444"},null)}),e(d,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(d,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(d,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(d,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(d,null,{text:()=>e("span",null,[t("\u7D2B\u8272\u97F3\u7B26\uFF1A\u5B8C\u6574\u5EA6\u4E0D\u8DB3")]),icon:()=>e(m,{fill:"#CC75FF"},null)}),e(d,null,{text:()=>e("span",null,[t("\u7070\u8272\u97F3\u7B26\uFF1A\u672A\u6F14\u594F")]),icon:()=>e(m,{fill:"#AEAEAE"},null)})]})]})])}}});const O=q(),qe=async(p,l)=>{const y=await ue(p);let i=F("");const g=re(y);i.value=ie(g.parsedXML,{title:l.musicSheetName});const A=Number(O["part-index"])||0;return i.value=ce(i.value,A),i},We=p=>{const l=F("loading"),y=F({}),i=F({});return K(async()=>{var g;l.value="loading";try{const A=await H.get("/sysMusicRecord/getLastEvaluationMusicalNotesPlayStats",{params:{recordId:O.id}});if(!A.data){l.value="error";return}i.value=A.data,console.log(i.value);const C=await H.get(`/music/sheet/detail/${(g=i.value)==null?void 0:g.musicalNotesPlayStats.examSongId}`);y.value=C.data,N.partIndex=A.data.partIndex||0,l.value="success"}catch(A){l.value="error",console.log(A)}}),[l,y,i]};var Ye=P({name:"Colexiu",setup(){const p=F(),l=F(!0),y=F(!1),i=F(""),g=F([]),A=F([]),[C,o,E]=We(O.id);z(C,async()=>{if(C.value==="success"&&o.value.xmlFileUrl){const a=await qe(o.value.xmlFileUrl,o.value);i.value=a.value}}),se();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))},L=()=>{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=oe(G.osmd),L();const r=(u,c,x=!0)=>{const f=de(u);N.evaluatings={...N.evaluatings,[f.measureIndex]:{...f,...pe(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=ne(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,D.sett.eyeProtection&&"eyeProtection",D.sett.camera&&"openCamera"]},[e(Pe,{className:w.header,detail:o.value,record:E,ref:p,style:{paddingLeft:N.isSpecialShapedScreen?N.notchHeight/2+"px":"auto"},onActiveChange:()=>L()},null),e("div",{id:"colexiu-detail-music-sheet",class:[w.musicSheet,xe.musicSheet],style:{paddingLeft:N.isSpecialShapedScreen?N.notchHeight/2+"px":"auto"}},[a&&!r&&e(Fe,{class:w.skeleton,rowWidth:"80%",title:!0,row:3},null),r&&e(Ae,null,null),i.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(le,{score:i.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:D.sett.type},onRerender:Y,onRenderError:X},null)])])])}}});$({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",""+J());Z();ee(Ye).mount("#app");export{Xe as __vite_legacy_guard};