month-report.cfda894d.js 6.5 KB

1
  1. import{d as S,ag as f,ah as w,r as u,$ as B,c as e,aj as U,_ as y,an as L,q as c,a5 as m,P as I,m as H,bj as E,e as F,o as k,bp as P,p as b,bC as M,bD as W}from"./index.1c621181.js";import{s as a,O as _,T as x,i as G,a as Q,S as q,b as K,c as V,d as Y,p as j,e as z,f as J}from"./week-report.810c428a.js";import{i as A}from"./icon-or.620acfd8.js";import{O as X}from"./index.c41121f0.js";import{h as T}from"./html2canvas.esm.3d083717.js";import{I as i}from"./index.4c221cbe.js";import{G as $,a as g}from"./index.5a8ac45d.js";import"./universalTransition.c11f6f6b.js";import"./index.433fb09b.js";var C="./assets/icon-train-month.8ecb8a4c.png",R="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMBAMAAACkW0HUAAAAElBMVEUAAABAFf87GP46Fv06GP86F/1KQQonAAAABXRSTlMADMN/YYlGpecAAAAvSURBVAjXY2BgYHRgAAGhYBDJqBpqAOKEhgaDOaFALpAD5EIpqCBECVQDTDvUMADDuwrdRd1HGQAAAABJRU5ErkJggg==",Z="./assets/popup-week-banner.72a73dd1.png";const ee={PERCUSSION:"\u6253\u51FB\u4E50",FLUTE:"\u957F\u7B1B",SAX:"\u8428\u514B\u65AF",CLARINET:"\u5355\u7C27\u7BA1",TRUMPET:"\u5C0F\u53F7",TROMBONE:"\u957F\u53F7",HORN:"\u5706\u53F7",BARITONE_TUBA:"\u4E0A\u4F4E\u97F3\u53F7-\u5927\u53F7",EUPHONIUM:"\u4E0A\u4F4E\u97F3\u53F7",TUBA:"\u5927\u53F7",MUSIC_THEORY:"\u4E50\u7406",INSTRUMENTAL_ENSEMBLE:"\u5408\u594F"};var ue=S({name:"train-report",setup(){const O=f(),h=w(),n=u({id:h.query.id,share:h.query.share,showQrcode:!1,url:window.location.href+"&share=1",width:0,height:0}),t=u({orchestraName:null,monthlyTime:null,startTime:null,endTime:null,COURSEWARE:{},coursewareList:[],COURSE_SCHEDULE:{},KNOWLEDGE:{},ORCHESTRA:{},PHOTO:{},STUDENT_ATTENDANCE:{},TEACHER_ATTENDANCE:{}}),v=async()=>{try{const{data:s}=await H.get("/api-school/open/orchestraReport/detail/"+n.id);t.COURSEWARE=s.reportItem.COURSEWARE||{},t.COURSE_SCHEDULE=s.reportItem.COURSE_SCHEDULE||{},t.KNOWLEDGE=s.reportItem.KNOWLEDGE||{},t.ORCHESTRA=s.reportItem.ORCHESTRA||{},t.PHOTO=s.reportItem.PHOTO||{},t.STUDENT_ATTENDANCE=s.reportItem.STUDENT_ATTENDANCE||{},t.TEACHER_ATTENDANCE=s.reportItem.TEACHER_ATTENDANCE||{},t.orchestraName=s.orchestraName||"",t.monthlyTime=s.monthlyTime||"",t.startTime=s.startTime||"",t.endTime=s.endTime||"";const o=t.COURSEWARE;for(const l in o)l!="TOTAL"&&t.coursewareList.push(ee[l])}catch{}},r=u({saveLoading:!1,image:null,shareLoading:!1}),N=async()=>{if(!r.saveLoading)if(r.saveLoading=!0,r.image)p();else{const s=document.getElementById("preview-container");T(s,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async o=>{const l=o.toDataURL("image/png");r.image=l,p()}).catch(()=>{E(),r.saveLoading=!1})}},D=()=>{if(!r.shareLoading)if(r.shareLoading=!0,r.image)d();else{const s=document.getElementById("preview-container");T(s,{allowTaint:!0,useCORS:!0,backgroundColor:null}).then(async o=>{const l=o.toDataURL("image/png");r.image=l,d()}).catch(()=>{E(),r.shareLoading=!1})}},d=()=>{const s=r.image;setTimeout(()=>{r.shareLoading=!1},100),s&&F({api:"shareTripartite",content:{title:"",desc:"",image:s,video:"",type:"image",shareType:"wechat"}},o=>{o&&o.content&&k(o.content.message||(o.content.status?"\u5206\u4EAB\u6210\u529F":"\u5206\u4EAB\u5931\u8D25"))})},p=async()=>{var o;P({message:"\u56FE\u7247\u751F\u6210\u4E2D...",forbidClick:!0}),setTimeout(()=>{r.saveLoading=!1},100);const s=await b({api:"savePicture",content:{base64:r.image}});((o=s==null?void 0:s.content)==null?void 0:o.status)==="success"?M("\u4FDD\u5B58\u6210\u529F"):W("\u4FDD\u5B58\u5931\u8D25")};return B(()=>{v()}),()=>e("div",{class:[a.trainWeek,a.trainMonth,n.share==1?a.trasinMonthShare:""]},[e("div",{class:a.trainContainer},null),e(U,{background:"transparent",border:!1,title:" ",color:"white",isBack:n.share!=1},{right:()=>n.share!=1&&e("i",{class:a.iconShare,onClick:()=>{n.showQrcode=!0,y(()=>{const s=document.querySelector("#preview-container"),o=L(s);n.width=o.width,n.height=o.height,o.width>0&&o.height>0&&(s.style.width=Math.round(o.width)+"px",s.style.height=Math.round(o.height)+"px")})}},null)}),e("div",{class:[a.headerContant,a.teacherHeaderContant]},[e("div",{class:a.orchestra},[e(i,{src:A,class:a.iconOrchestra},null),e("span",null,[t.orchestraName])]),e("div",null,[e(i,{src:C,class:a.iconTrainWeek},null)]),e("div",{class:a.trainTimer},[t.monthlyTime])]),e(_,{type:"month",reportData:t.ORCHESTRA},null),e(x,{type:"month",reportData:t.COURSE_SCHEDULE},null),e("div",{class:[a.trainPhoto,a.teacherTrainPhoto]},[e(i,{src:G,class:a.iconPhoto},null),e("p",{onClick:()=>{n.share!=1&&O.push({path:"/school-photo"})},style:{display:"flex",alignItems:"center"}},[c("\u672C\u6708\u4E0A\u4F20"),e("span",null,[t.PHOTO.TOTAL||0]),c("\u5F20\u8BAD\u7EC3\u7167\u7247"),n.share!=1&&e(m,{name:Q,size:"10",style:{marginLeft:"10px"}},null)])]),e(q,{type:"month",reportData:t.STUDENT_ATTENDANCE},null),e(K,{type:"month",reportData:t.TEACHER_ATTENDANCE},null),e("div",{class:[a.trainClass,a.teacherTrainClass]},[e(i,{src:V,class:a.iconPhoto},null),e("div",null,[e("p",{class:a.subjectTips},[c("\u8BFE\u4EF6\u4F7F\u7528\u672A\u8FBE\u6807\u73ED\u7EA7")]),e("p",{class:a.subjectNames,style:"color: #FF99A2"},[t.coursewareList.map(s=>s+" ")])])]),e(Y,{type:"month",reportData:t.KNOWLEDGE},null),e(I,{show:n.showQrcode,"onUpdate:show":s=>n.showQrcode=s,position:"bottom",style:{background:"transparent"}},{default:()=>[e("div",{class:a.codeContainer},[e("div",{class:[a.codeImg,a.teacherCodeImg],id:"preview-container"},[e(i,{src:Z,class:a.popupWeekBanner},null),e("div",{class:a.codeContent},[e("div",{class:[a.headerContant,a.teacherHeaderContant,a.headerContantPopup]},[e("div",{class:a.orchestra},[e(i,{src:A,class:a.iconOrchestra},null),e("span",null,[t.orchestraName])]),e("div",null,[e(i,{src:C,class:a.iconTrainWeek},null)]),e("div",{class:a.trainTimer},[e(i,{class:a.point,src:R},null),t.monthlyTime,e(i,{class:a.point,src:R},null)])]),e("div",{class:a.codeQr},[e(i,{src:j,class:a.popupQrcodeBg},null),e(X,{text:n.url,size:"100%",logoSize:"small"},null)]),e("div",{style:{textAlign:"center"}},[e("span",{class:a.codeBtnText},[c("\u626B\u63CF\u4E0A\u65B9\u4E8C\u7EF4\u7801"),e("span",null,[c("\u67E5\u770B\u8BAD\u7EC3\u6708\u62A5")])])])])]),e("div",{class:a.codeBottom},[e(m,{name:"cross",size:22,class:a.close,color:"#666",onClick:()=>n.showQrcode=!1},null),e("h3",{class:a.title},[e("i",null,null),c("\u5206\u4EAB\u65B9\u5F0F")]),e($,{columnNum:2,border:!1},{default:()=>[e(g,{onClick:N},{icon:()=>e(i,{class:a.shareImg,src:z},null),text:()=>e("div",{class:a.shareText},[c("\u4FDD\u5B58\u56FE\u7247")])}),e(g,{onClick:D},{icon:()=>e(i,{class:a.shareImg,src:J},null),text:()=>e("div",{class:a.shareText},[c("\u5FAE\u4FE1")])})]})])])]})])}});export{ue as default,ee as reportCourseType};