colexiu-report.a3ac8bdc.js 12 KB

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