evaluationRecords-4f6e3d93-1720699367816.js 9.1 KB

1
  1. import{s as a}from"./index.module-c328a753-1720699367816.js";import{u as S}from"./useECharts-08a6985a-1720699367816.js";import{c as K,d as $}from"./api-ae9134d7-1720699367816.js";import{s as j}from"./api-8195f6bd-1720699367816.js";import{g as T,a as b,c as o,N as D,d as m,b as F}from"./dateFormat-e2371de5-1720699367816.js";import{C as N}from"./index-d625d9c9-1720699367816.js";import{T as B}from"./index-a2dc20f3-1720699367816.js";import{i as M,s as w}from"./use-async-6da85328-1720699367816.js";import{d as V,r as c,e as k,q as G,f as t,N as Y,g as L,x as P,j as y,k as n,aG as U,F as v,c as z,l as W,m as O,G as q,aL as A}from"./index-b48b51d2-1720699367816.js";import{P as H}from"./index-3d012fb0-1720699367816.js";import{v as J}from"./urlUtils-72ef455d-1720699367816.js";const rt=V({name:"student-practiceData",props:{studentId:{type:String,default:""},classGroupId:{type:String,default:""}},setup(u){const f=c(null),{setOptions:I}=S(f),p=c(!0),i=k({height:"360px",width:"100%",practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[]}),s=k({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),l=c([T(new Date().getTime()),b(new Date().getTime())]),E=()=>[{title:"日期",key:"date"},{title:"学练时长",key:"practiceDuration",render(e){return t(v,null,[" ",t(v,null,[e.practiceDuration?o(e.practiceDuration)>0?o(e.practiceDuration)+"分"+m(e.practiceDuration)+"秒":m(e.practiceDuration)+"秒":"0分钟"])])}}],d=async()=>{try{const e=await j({page:1,rows:999,studentId:u.studentId,classGroupId:u.classGroupId,...F(l.value,["startTime","endTime"],"YYYY-MM-DD")});s.tableList=e.data.rows}catch(e){console.log(e)}},x=()=>{I({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{show:!1,selected:{"学练时长(分钟)":p.value}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{show:!0},data:i.dateList},yAxis:[{type:"value",axisLabel:{formatter:e=>o(e)+"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:e=>Array.isArray(e)?[e[0].axisValueLabel,...e.map(r=>{let R;return o(r.value)>0?R=o(r.value)+"分"+m(r.value)+"秒":R=m(r.value)+"秒","<br/>".concat(r.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(R," </span>")})].join(""):e})},g=async()=>{try{const e=await K({studentId:u.studentId,classGroupId:u.classGroupId,...F(l.value,["startTime","endTime"],"YYYY-MM-DD")});i.practiceDays=e.data.practiceDays,i.practiceDurationAvg=e.data.practiceDurationAvg,i.practiceDurationTotal=e.data.practiceDurationTotal,i.dateList=e.data.trainingStatDetailList.map(r=>r.date),i.timeList=e.data.trainingStatDetailList.map(r=>r.practiceDuration),x()}catch(e){console.log(e)}},h=()=>{s.pagination.page=1,g(),d(),w({current:{timer:l.value},saveKey:"classStudentRecordPracticeData"})},C=()=>{l.value=[T(new Date().getTime()),b(new Date().getTime())],h(),d(),w({current:{timer:l.value},saveKey:"classStudentRecordPracticeData"})};return M({current:{timer:l.value},saveKey:"classStudentRecordPracticeData",callBack:e=>{l.value=e.timer}}),G(()=>{console.log(u.studentId),g(),d()}),()=>t(v,null,[t(Y,{"label-placement":"left",inline:!0},{default:()=>[t(L,null,{default:()=>[t(N,{value:l.value,"onUpdate:value":e=>l.value=e,separator:"至",type:"daterange",timerValue:l.value},null)]}),t(L,null,{default:()=>[t(P,{justify:"end"},{default:()=>[t(y,{type:"primary",class:"searchBtn",onClick:h},{default:()=>[n("搜索")]}),t(y,{type:"primary",ghost:!0,class:"resetBtn",onClick:C},{default:()=>[n("重置")]})]})]})]}),t("div",{class:a.homeTrainData},[t("div",{class:a.TrainDataTop},[t("div",{class:a.TrainDataTopLeft},[t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[o(i.practiceDurationTotal)>0?t("div",null,[t("span",null,[t(D,{from:0,to:o(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(D,{from:0,to:m(i.practiceDurationTotal)},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("秒")])]),t("p",{class:a.TrainDataItemsubTitle},[n("累计练习时长")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[o(i.practiceDurationAvg)>0?t("div",null,[t("span",null,[t(D,{from:0,to:o(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(D,{from:0,to:m(i.practiceDurationAvg)},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("秒")])]),t("p",{class:a.TrainDataItemsubTitle},[n("平均每天练习时长")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("div",null,[t("span",null,[t(D,{from:0,to:i.practiceDays},null)]),t("i",{style:{width:"4px",display:"inline-block"}},null),n("天")])]),t("p",{class:a.TrainDataItemsubTitle},[n("练习天数")])])]),t("div",{class:a.TrainDataTopRight},[t("div",{class:[a.DataTopRightItem,p.value?"":a.DataTopRightItemDis]},[t("div",{class:[a.DataTopRightDot,a.DataTopRightDotBlue]},null),t("p",null,[n("学练时长(分钟)")])])])]),t("div",{class:a.chatrs},[t("div",{ref:f,style:{height:i.height,width:i.width}},null)]),t("div",{class:[a.tableWrap,a.tableWrapEcharts]},[t(U,{class:a.classTable,loading:s.loading,columns:E(),data:s.tableList},{empty:()=>t(B,null,null)})])])])}}),ut=V({name:"student-practiceData",props:{studentId:{type:String,default:""},classGroupId:{type:String,default:""}},setup(u){const f=z(),I=c(null);S(I),c(!0);const p=k({height:"360px",width:"100%",practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[],detailVisiable:!1}),i=c(""),s=k({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),l=c([T(new Date().getTime()),b(new Date().getTime())]),E=()=>[{title:"时间",key:"createTime"},{title:"评测曲目",key:"musicSheetName",render(e){return t("span",null,[e.musicSheetName])}},{title:"评测难度",key:"heardLevel",render(e){return t(v,null,[e.heardLevel==null?t("span",null,[n("--")]):null,e.heardLevel=="BEGINNER"?t(A,{type:"info"},{default:()=>[n("入门级")]}):null,e.heardLevel=="ADVANCED"?t(A,{type:"warning"},{default:()=>[n("进阶级")]}):null,e.heardLevel=="PERFORMER"?t(A,{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(y,{text:!0,type:"primary",onClick:()=>{x(e)}},{default:()=>[n("评测报告")]})}}],d=async()=>{const e=await $({userId:u.studentId,...s.pagination,classGroupId:u.classGroupId,feature:"EVALUATION",...F(l.value,["startTime","endTime"],"YYYY-MM-DD")});s.tableList=e.data.rows,s.pagination.pageTotal=e.data.total},x=e=>{console.log(e.id,"gotoRecode");const r=f.getToken;i.value=J()+"/instrument/?v=".concat(+new Date,"#/evaluat-report?v=").concat(+new Date,"&id=").concat(e.id,"&platform=webTeacher&Authorization=").concat(r),p.detailVisiable=!0},g=()=>{s.pagination.page=1,d(),w({current:{timer:l.value},saveKey:"classStudentRecordEvaluationRecords"})},h=()=>{l.value=[T(new Date().getTime()),b(new Date().getTime())],g(),w({current:{timer:l.value},saveKey:"classStudentRecordEvaluationRecords"})};M({current:{timer:l.value},saveKey:"classStudentRecordEvaluationRecords",callBack:e=>{l.value=e.timer}});const C=c();return G(()=>{d(),console.log(u.studentId)}),()=>t(v,null,[t(Y,{"label-placement":"left",inline:!0},{default:()=>[t(L,null,{default:()=>[t(N,{value:l.value,"onUpdate:value":e=>l.value=e,separator:"至",type:"daterange",timerValue:l.value},null)]}),t(L,null,{default:()=>[t(P,{justify:"end"},{default:()=>[t(y,{type:"primary",class:"searchBtn",onClick:g},{default:()=>[n("搜索")]}),t(y,{type:"primary",ghost:!0,class:"resetBtn",onClick:h},{default:()=>[n("重置")]})]})]})]}),t("div",{class:a.tableWrap},[t(U,{class:a.classTable,loading:s.loading,columns:E(),data:s.tableList},{empty:()=>t(B,null,null)}),t(H,{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:d,sync:!0},null)]),t(W,{maskClosable:O,show:p.detailVisiable,"onUpdate:show":e=>p.detailVisiable=e,preset:"card",class:["modalTitle background",a.reportModel],title:"评测报告"},{default:()=>[t("div",{class:a.reportContainer,style:{lineHeight:0}},[t("iframe",{width:"100%",height:"450px",ref:C,frameborder:"0",onLoad:e=>{q(e.target)},src:i.value},null)])]})])}});export{ut as E,rt as P};