import{s as a}from"./index.module-fd323afa-1715840129614.js";import{u as S}from"./useECharts-fd805f98-1715840129614.js";import{c as K,d as $}from"./api-0aa82bae-1715840129614.js";import{s as j}from"./api-ada3b0f5-1715840129614.js";import{g as T,a as b,c as o,d as m,b as F}from"./dateFormat-df60ec62-1715840129614.js";import{C as N}from"./index-12ac1d8a-1715840129614.js";import{T as B}from"./index-f592738f-1715840129614.js";import{i as M,s as w}from"./use-async-17a4bade-1715840129614.js";import{d as V,r as c,e as L,p as Y,f as t,N as P,g as k,w as G,j as y,k as n,aE as U,F as v,c as z,l as W,D as O,aJ as C}from"./index-27f38392-1715840129614.js";import{N as D}from"./NumberAnimation-31da0c47-1715840129614.js";import{P as H}from"./index-2abd505e-1715840129614.js";import{v as J}from"./urlUtils-a03c114e-1715840129614.js";const st=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=L({height:"360px",width:"100%",practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[]}),r=L({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")});r.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(s=>{let A;return o(s.value)>0?A=o(s.value)+"分"+m(s.value)+"秒":A=m(s.value)+"秒","
".concat(s.marker,'学练时长: ').concat(A," ")})].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(s=>s.date),i.timeList=e.data.trainingStatDetailList.map(s=>s.practiceDuration),x()}catch(e){console.log(e)}},h=()=>{r.pagination.page=1,g(),d(),w({current:{timer:l.value},saveKey:"classStudentRecordPracticeData"})},R=()=>{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}}),Y(()=>{console.log(u.studentId),g(),d()}),()=>t(v,null,[t(P,{"label-placement":"left",inline:!0},{default:()=>[t(k,null,{default:()=>[t(N,{value:l.value,"onUpdate:value":e=>l.value=e,separator:"至",type:"daterange",timerValue:l.value},null)]}),t(k,null,{default:()=>[t(G,{justify:"end"},{default:()=>[t(y,{type:"primary",class:"searchBtn",onClick:h},{default:()=>[n("搜索")]}),t(y,{type:"primary",ghost:!0,class:"resetBtn",onClick:R},{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:r.loading,columns:E(),data:r.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=L({height:"360px",width:"100%",practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[],detailVisiable:!1}),i=c(""),r=L({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(C,{type:"info"},{default:()=>[n("入门级")]}):null,e.heardLevel=="ADVANCED"?t(C,{type:"warning"},{default:()=>[n("进阶级")]}):null,e.heardLevel=="PERFORMER"?t(C,{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,...r.pagination,classGroupId:u.classGroupId,feature:"EVALUATION",...F(l.value,["startTime","endTime"],"YYYY-MM-DD")});r.tableList=e.data.rows,r.pagination.pageTotal=e.data.total},x=e=>{console.log(e.id,"gotoRecode");const s=f.getToken;i.value=J()+"/instrument/?v=".concat(+new Date,"#/evaluat-report?v=").concat(+new Date,"&id=").concat(e.id,"&platform=webTeacher&Authorization=").concat(s),p.detailVisiable=!0},g=()=>{r.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 R=c();return Y(()=>{d(),console.log(u.studentId)}),()=>t(v,null,[t(P,{"label-placement":"left",inline:!0},{default:()=>[t(k,null,{default:()=>[t(N,{value:l.value,"onUpdate:value":e=>l.value=e,separator:"至",type:"daterange",timerValue:l.value},null)]}),t(k,null,{default:()=>[t(G,{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:r.loading,columns:E(),data:r.tableList},{empty:()=>t(B,null,null)}),t(H,{page:r.pagination.page,"onUpdate:page":e=>r.pagination.page=e,pageSize:r.pagination.rows,"onUpdate:pageSize":e=>r.pagination.rows=e,pageTotal:r.pagination.pageTotal,"onUpdate:pageTotal":e=>r.pagination.pageTotal=e,onList:d,sync:!0},null)]),t(W,{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:R,frameborder:"0",onLoad:e=>{O(e.target)},src:i.value},null)])]})])}});export{ut as E,st as P};