1 |
- import{s as l,c as U,d as P}from"./api-7fe2aa0e-1694675857467.js";import{u as N}from"./useECharts-911824da-1694675857467.js";import{t as j}from"./api-787d8c4c-1694675857467.js";import{g as b,a as w,c,d as m,b as C}from"./dateFormat-6c612223-1694675857467.js";import{C as S,N as y}from"./index-50786adc-1694675857467.js";import{T as R}from"./index-f159c5ee-1694675857467.js";import{d as V,r as d,e as L,n as B,f as t,N as M,g as I,w as Y,j as T,k as n,c9 as G,F as f,c as z,v as $,cd as F}from"./index-54f41458-1694675857467.js";import{P as O}from"./index-e25911a4-1694675857467.js";import{v as W}from"./urlUtils-b7caaee8-1694675857467.js";const et=V({name:"student-practiceData",props:{studentId:{type:String,default:""},classGroupId:{type:String,default:""}},setup(o){const h=d(null),{setOptions:k}=N(h),g=d(!0),i=L({height:"360px",width:"100%",practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[]}),s=L({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),r=d([b(new Date().getTime()),w(new Date().getTime())]),x=()=>[{title:"日期",key:"date"},{title:"练习时长(分钟)",key:"practiceDuration",render(a){return t(f,null,[" ",t(f,null,[a.practiceDuration?c(a.practiceDuration)>0?c(a.practiceDuration)+"分"+m(a.practiceDuration)+"秒":m(a.practiceDuration)+"秒":"0分钟"])])}}],p=async()=>{try{const a=await j({page:1,rows:999,studentId:o.studentId,classGroupId:o.classGroupId,...C(r.value,["startTime","endTime"],"YYYY-MM-DD")});s.tableList=a.data.rows}catch(a){console.log(a)}},A=()=>{k({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{show:!1,selected:{"练习时长(分钟)":g.value}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{show:!0,interval:0},data:i.dateList},yAxis:[{type:"value",axisLabel:{formatter:a=>c(a)+"min"},axisTick:{show:!1},splitArea:{show:!1,areaStyle:{color:["rgba(255,255,255,0.2)"]}}}],grid:{left:"1%",right:"1%",top:"2%",bottom:0,containLabel:!0},series:[{data:i.timeList,type:"bar",barWidth:"48px",stack:"total",itemStyle:{normal:{barBorderRadius:[8,8,0,0],color:"#D5E9FF"},emphasis:{focus:"series",color:"#3583FA"}}}],formatter:a=>Array.isArray(a)?[a[0].axisValueLabel,...a.map(u=>{let E;return c(u.value)>0?E=c(u.value)+"分"+m(u.value)+"秒":E=m(u.value)+"秒","<br/>".concat(u.marker,'<span style="margin-top:10px;margin-left:5px;font-size: 13px;font-weight: 500;\n color: #131415;font-weight: 600;\n margin-top:12px\n line-height: 18px;">练习时长: ').concat(E," </span>")})].join(""):a})},D=async()=>{try{const a=await U({studentId:o.studentId,classGroupId:o.classGroupId,...C(r.value,["startTime","endTime"],"YYYY-MM-DD")});i.practiceDays=a.data.practiceDays,i.practiceDurationAvg=a.data.practiceDurationAvg,i.practiceDurationTotal=a.data.practiceDurationTotal,i.dateList=a.data.trainingStatDetailList.map(u=>u.date),i.timeList=a.data.trainingStatDetailList.map(u=>u.practiceDuration),A(),console.log(i)}catch(a){console.log(a)}},v=()=>{s.pagination.page=1,D(),p(),console.log("search")},e=()=>{r.value=[b(new Date().getTime()),w(new Date().getTime())],v(),p(),console.log("onReset")};return B(()=>{console.log(o.studentId),D(),p()}),()=>t(f,null,[t(M,{"label-placement":"left",inline:!0},{default:()=>[t(I,null,{default:()=>[t(S,{value:r.value,"onUpdate:value":a=>r.value=a,separator:"至",type:"daterange",timerValue:r.value},null)]}),t(I,null,{default:()=>[t(Y,{justify:"end"},{default:()=>[t(T,{type:"primary",class:"searchBtn",onClick:v},{default:()=>[n("搜索")]}),t(T,{type:"primary",ghost:!0,class:"resetBtn",onClick:e},{default:()=>[n("重置")]})]})]})]}),t("div",{class:l.homeTrainData},[t("div",{class:l.TrainDataTop},[t("div",{class:l.TrainDataTopLeft},[t("div",{class:l.TrainDataItem},[t("p",{class:l.TrainDataItemTitle},[c(i.practiceDurationTotal)>0?t("div",null,[t("span",null,[t(y,{from:0,to:c(i.practiceDurationTotal)},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("分"),t("i",{style:{width:"4px",display:"inline-block"}},null)]):null,t("div",null,[t("span",null,[t(y,{from:0,to:m(i.practiceDurationTotal)},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("秒")])]),t("p",{class:l.TrainDataItemsubTitle},[n("累计练习时长")])]),t("div",{class:l.TrainDataItem},[t("p",{class:l.TrainDataItemTitle},[c(i.practiceDurationAvg)>0?t("div",null,[t("span",null,[t(y,{from:0,to:c(i.practiceDurationAvg)},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("分"),t("i",{style:{width:"4px",display:"inline-block"}},null)]):null,t("div",null,[t("span",null,[t(y,{from:0,to:m(i.practiceDurationAvg)},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("秒")])]),t("p",{class:l.TrainDataItemsubTitle},[n("平均练习时长")])]),t("div",{class:l.TrainDataItem},[t("p",{class:l.TrainDataItemTitle},[t("div",null,[t("span",null,[t(y,{from:0,to:i.practiceDays},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("天")])]),t("p",{class:l.TrainDataItemsubTitle},[n("练习天数")])])]),t("div",{class:l.TrainDataTopRight},[t("div",{class:[l.DataTopRightItem,g.value?"":l.DataTopRightItemDis]},[t("div",{class:[l.DataTopRightDot,l.DataTopRightDotBlue]},null),t("p",null,[n("练习时长(分钟)")])])])]),t("div",{class:l.chatrs},[t("div",{ref:h,style:{height:i.height,width:i.width}},null)]),t("div",{class:l.tableWrap},[t(G,{class:l.classTable,loading:s.loading,columns:x(),data:s.tableList},{empty:()=>t(R,null,null)})])])])}}),at=V({name:"student-practiceData",props:{studentId:{type:String,default:""},classGroupId:{type:String,default:""}},setup(o){const h=z(),k=d(null);N(k),d(!0);const g=L({height:"360px",width:"100%",practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[],detailVisiable:!1}),i=d(""),s=L({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),r=d([b(new Date().getTime()),w(new Date().getTime())]),x=()=>[{title:"时间",key:"createTime"},{title:"评测曲目",key:"musicSheetName",render(e){return t("span",null,[e.musicSheetName])}},{title:"评测难度",key:"heardLevel",render(e){return t(f,null,[e.heardLevel==null?t("span",null,[n("--")]):null,e.heardLevel=="BEGINNER"?t(F,{type:"info"},{default:()=>[n("入门级")]}):null,e.heardLevel=="ADVANCED"?t(F,{type:"warning"},{default:()=>[n("进阶级")]}):null,e.heardLevel=="PERFORMER"?t(F,{type:"error"},{default:()=>[n("大师级")]}):null])}},{title:"评测分数",key:"score",render(e){return t("span",null,[e.score])}},{title:"音准",key:"intonation",render(e){return t("span",null,[e.intonation])}},{title:"节奏",key:"cadence",render(e){return t("span",null,[e.cadence])}},{title:"完整度",key:"integrity",render(e){return t("span",null,[e.integrity])}},{title:"操作",key:"id",render(e){return t(T,{text:!0,type:"primary",onClick:()=>{A(e)}},{default:()=>[n("评测报告")]})}}],p=async()=>{const e=await P({userId:o.studentId,...s.pagination,classGroupId:o.classGroupId,feature:"EVALUATION",...C(r.value,["startTime","endTime"],"YYYY-MM-DD")});s.tableList=e.data.rows,console.log(s.tableList,"state.tableList "),s.pagination.pageTotal=e.data.total},A=e=>{console.log(e.id,"gotoRecode");const a=h.getToken;i.value=W()+"/instrument/#/evaluat-report?id=".concat(e.id,"&Authorization=").concat(a),g.detailVisiable=!0},D=()=>{p()},v=()=>{r.value=[b(new Date().getTime()),w(new Date().getTime())],D()};return B(()=>{p(),console.log(o.studentId)}),()=>t(f,null,[t(M,{"label-placement":"left",inline:!0},{default:()=>[t(I,null,{default:()=>[t(S,{value:r.value,"onUpdate:value":e=>r.value=e,separator:"至",type:"daterange",timerValue:r.value},null)]}),t(I,null,{default:()=>[t(Y,{justify:"end"},{default:()=>[t(T,{type:"primary",class:"searchBtn",onClick:D},{default:()=>[n("搜索")]}),t(T,{type:"primary",ghost:!0,class:"resetBtn",onClick:v},{default:()=>[n("重置")]})]})]})]}),t("div",{class:l.tableWrap},[t(G,{class:l.classTable,loading:s.loading,columns:x(),data:s.tableList},{empty:()=>t(R,null,null)}),t(O,{page:s.pagination.page,"onUpdate:page":e=>s.pagination.page=e,pageSize:s.pagination.rows,"onUpdate:pageSize":e=>s.pagination.rows=e,pageTotal:s.pagination.pageTotal,"onUpdate:pageTotal":e=>s.pagination.pageTotal=e,onList:p,sync:!0},null)]),t($,{show:g.detailVisiable,"onUpdate:show":e=>g.detailVisiable=e,preset:"card",class:["modalTitle background",l.reportModel],title:"评测报告"},{default:()=>[t("iframe",{width:"100%",height:"450px",frameborder:"0",src:i.value},null)]})])}});export{at as E,et as P};
|