import{H as K,d as I,r as T,u as at,a as J,e as b,U as $,q as R,f as t,k as l,aG as q,F as v,j as G,x as H,S as Q,V as O,$ as h,C as W,T as st,a0 as lt,a1 as it,t as nt,v as N,y as rt}from"./index-1ec0a32d-1726219372904.js";import{g as ot,a as ut}from"./use-async-9f56226e-1726219372904.js";import{C as ct}from"./index-6fc10175-1726219372904.js";import{s as a}from"./index2.module-18b3684a-1726219372904.js";import{u as X}from"./useECharts-c319041a-1726219372904.js";import{P as Z}from"./index-be61723a-1726219372904.js";import{N as S,b as L,c as A,d as E,g as _,a as V}from"./dateFormat-0341fa65-1726219372904.js";import{j as dt,s as pt,l as gt}from"./api-0e5ba9bf-1726219372904.js";import{T as M}from"./index-2727764b-1726219372904.js";import{i as P,a as Y,b as U}from"./icon-sort-asc-1f640ab4-1726219372904.js";import{g as z,s as C}from"./index-db345329-1726219372904.js";import{s as j}from"./api-f5057ed1-1726219372904.js";import"./index-ff9a89ac-1726219372904.js";const mt="_listWrap_x49zf_1",ft="_customTabs_x49zf_7",yt="_searchBtn_x49zf_28",ht="_resetBtn_x49zf_33",B={listWrap:mt,customTabs:ft,searchBtn:yt,resetBtn:ht},vt=D=>K.post("/edu-app/lessonTraining/trainingStat",{data:D}),Dt=D=>K.post("/edu-app/musicPracticeRecordStat/trainingStat",{data:D}),Tt=I({name:"home-trainData",props:{timer:{type:Array,defaut:()=>[]}},setup(D,{expose:w}){const i=T(null),{setOptions:o}=X(i),u=T(!0),g=T(!0),m=at();J();const d=b({height:"360px",width:"100%",studentNum:0,paymentAmount:0,dateList:[],studentList:[],payInfoList:[]}),p=T({qualifiedRate:0,qualifiedStudentCount:0,submitStudentCount:0,totalStudentCount:0,trainingCount:0,trainingRate:0}),r=b({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),c=$(()=>D.timer),n=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(s){return t(v,null,[s.createTime])}},{title:"截止时间",key:"expireDate",render(s){return t(v,null,[s.expireDate])}},{title:"训练状态",key:"status",render(s){return s.status==0?t("div",{class:a.indDot},[" ",t("span",null,null),l(" 进行中")]):t("div",{class:a.endDot},[t("span",null,null),l("已结束")])}},{title:"布置人数",key:"expectNum"},{title:"提交人数",key:"trainingNum"},{title:"合格人数",key:"standardNum"},{title:"提交率",key:"trainingRate",render(s){return t(v,null,[s.trainingRate,l("%")])}},{title:"合格率",key:"qualifiedRate",render(s){return t(v,null,[s.qualifiedRate,l("%")])}},{title:"操作",key:"id",render(s){return t(H,null,{default:()=>[t(G,{text:!0,type:"primary",onClick:()=>e(s)},{default:()=>[l("详情")]})]})}}],e=s=>{console.log(s),m.push({path:"/homework-record-detail",query:{id:s.id,name:s.name}})},f=async()=>{try{const s=await vt({...L(c.value,["startTime","endTime"],"YYYY-MM-DD")});p.value={...s.data},d.dateList=s.data.trainingStatDetails.map(y=>y.date),d.payInfoList=s.data.trainingStatDetails.map(y=>y.qualifiedStudentCount),d.studentList=s.data.trainingStatDetails.map(y=>y.unqualifiedStudentCount),x()}catch(s){console.log(s)}try{const s=await dt({...r.pagination,...L(c.value,["startTime","endTime"],"YYYY-MM-DD")});r.tableList=s.data.rows,r.pagination.pageTotal=s.data.total,r.loading=!1}catch(s){r.loading=!1,console.log(s)}};w({getList:f});const x=()=>{o({tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:2,color:"#A9C7FF"}}},legend:{show:!1,selected:{合格人数:u.value,不合格人数:g.value}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{show:!0},data:d.dateList},yAxis:[{type:"value",axisLabel:{formatter:"{value}人"},axisTick:{show:!1},splitArea:{show:!1,areaStyle:{color:["rgba(255,255,255,0.2)"]}},minInterval:1,splitNumber:5}],grid:{left:"1%",right:"1%",top:"2 %",bottom:0,containLabel:!0},series:[{data:d.studentList,symbolSize:10,type:"line",name:"不合格人数",symbol:"circle",smooth:!0,itemStyle:{color:"#FF7AA7",borderColor:"#fff",borderWidth:3},lineStyle:{width:3},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(255, 243, 246, 1)"},{offset:1,color:"rgba(255, 246, 248, 0)"}]}},emphasis:{disabled:!0}},{data:d.payInfoList,type:"line",name:"合格人数",symbolSize:10,symbol:"circle",smooth:!0,itemStyle:{color:"#198CFE",borderColor:"#fff",borderWidth:3},lineStyle:{width:2},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(212, 231, 255, 1)"},{offset:1,color:"rgba(221, 235, 254, 0)"}]}},emphasis:{disabled:!0}}],formatter:s=>Array.isArray(s)?[s[0].axisValueLabel,...s.map(y=>"
".concat(y.marker,'').concat(y.seriesName,": ").concat(y.value,"人 "))].join(""):s})};return R(()=>{f()}),()=>t(v,null,[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},[t("div",null,[t("span",null,[t(S,{from:0,to:p.value.trainingCount},null)]),l("次")])]),t("p",{class:a.TrainDataItemsubTitle},[l("作业次数")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("div",null,[t("span",null,[t(S,{from:0,to:p.value.totalStudentCount},null)]),l("人次")])]),t("p",{class:a.TrainDataItemsubTitle},[l("应交总人次")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("div",null,[t("span",null,[t(S,{from:0,to:p.value.submitStudentCount},null)]),l("人次")])]),t("p",{class:a.TrainDataItemsubTitle},[l("提交总人次")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("div",null,[t("span",null,[t(S,{from:0,to:p.value.qualifiedStudentCount},null)]),l("人次")])]),t("p",{class:a.TrainDataItemsubTitle},[l("合格总人次")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("div",null,[t("span",null,[t(S,{from:0,to:p.value.trainingRate},null)]),l("%")])]),t("p",{class:a.TrainDataItemsubTitle},[l("作业提交率")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("div",null,[t("span",null,[t(S,{from:0,to:p.value.qualifiedRate},null)]),l("%")])]),t("p",{class:a.TrainDataItemsubTitle},[l("作业合格率")])])]),t("div",{class:a.TrainDataTopRight},[t("div",{onClick:()=>{u.value=!u.value,x()},class:[a.DataTopRightItem,u.value?"":a.DataTopRightItemDis]},[t("div",{class:a.DataTopRightDot},null),t("p",null,[l("合格人数")])]),t("div",{onClick:()=>{g.value=!g.value,x()},class:[a.DataTopRightItem,g.value?"":a.DataTopRightItemDis]},[t("div",{class:[a.DataTopRightDot,a.red]},null),t("p",null,[l("不合格人数")])])])]),t("div",{class:a.chatrs},[t("div",{ref:i,style:{height:d.height,width:d.width}},null)]),t("div",{class:a.tableWrap},[t(q,{class:a.classTable,loading:r.loading,columns:n(),data:r.tableList},{empty:()=>t(M,null,null)}),t(Z,{page:r.pagination.page,"onUpdate:page":s=>r.pagination.page=s,pageSize:r.pagination.rows,"onUpdate:pageSize":s=>r.pagination.rows=s,pageTotal:r.pagination.pageTotal,"onUpdate:pageTotal":s=>r.pagination.pageTotal=s,onList:f,sync:!0},null)])])])}}),bt=I({name:"home-practiceData",props:{timer:{type:Array,defaut:()=>[]}},setup(D,{expose:w}){const i=T(null),{setOptions:o}=X(i),u=T(!0),g=b({height:"360px",width:"100%",practiceUserCount:0,paymentAmount:0,practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[]}),m=b({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),d=$(()=>D.timer),p=()=>[{title:"日期",key:"date"},{title:"练习人数",key:"practiceUserCount",render(n){return t(v,null,[n.practiceUserCount,l("人")])}},{title:"平均每天练习时长",key:"practiceDuration",render(n){return t(v,null,[" ",t(v,null,[n.practiceDuration?A(n.practiceDuration)>0?A(n.practiceDuration)+"分"+E(n.practiceDuration)+"秒":E(n.practiceDuration)+"秒":"0分钟"])])}}],r=async()=>{try{const n=await pt({page:1,rows:999,...L(d.value,["startTime","endTime"],"YYYY-MM-DD")}),e=await Dt({page:1,rows:999,...L(d.value,["startTime","endTime"],"YYYY-MM-DD")});m.tableList=n.data.rows,g.practiceDurationAvg=e.data.practiceDurationAvg,g.practiceUserCount=e.data.practiceUserCount,g.dateList=e.data.trainingStatDetailList.map(f=>f.date),g.timeList=e.data.trainingStatDetailList.map(f=>f.practiceUserCount),c()}catch(n){console.log(n)}};w({getList:r});const c=()=>{o({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{show:!1,selected:{练习人数:u.value}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{show:!0},data:g.dateList},yAxis:[{type:"value",axisLabel:{formatter:"{value}人"},axisTick:{show:!1},splitArea:{show:!1,areaStyle:{color:["rgba(255,255,255,0.2)"]}},minInterval:1,splitNumber:5}],grid:{left:"1%",right:"1%",top:"2%",bottom:0,containLabel:!0},series:[{data:g.timeList,symbolSize:10,type:"line",symbol:"circle",smooth:!0,itemStyle:{normal:{barBorderRadius:[8,8,0,0],color:"#3583FA"},emphasis:{color:"#3583FA"}}}],formatter:n=>Array.isArray(n)?[n[0].axisValueLabel,...n.map(e=>"
".concat(e.marker,'练习人数: ').concat(e.value,"人 "))].join(""):n})};return R(()=>{r()}),()=>t(v,null,[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},[t("div",null,[t("span",null,[t(S,{from:0,to:g.practiceUserCount},null)]),l("人")])]),t("p",{class:a.TrainDataItemsubTitle},[l("练习人数")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[A(g.practiceDurationAvg)>0?t("div",null,[t("span",null,[t(S,{from:0,to:A(g.practiceDurationAvg)},null)]),l("分")]):null,t("div",null,[t("span",null,[t(S,{from:0,to:E(g.practiceDurationAvg)},null)]),l("秒")])]),t("p",{class:a.TrainDataItemsubTitle},[l("平均每天练习时长")])])]),t("div",{class:a.TrainDataTopRight},null)]),t("div",{class:a.chatrs},[t("div",{ref:i,style:{height:g.height,width:g.width}},null)]),t("div",{class:a.tableWrap},[t(q,{class:a.classTable,loading:m.loading,columns:p(),data:m.tableList},{empty:()=>t(M,null,null)})])])])}}),xt=I({name:"student-studentList",props:{timer:{type:Array,defaut:()=>[]}},setup(D,{emit:w,expose:i}){const o=b({searchWord:"",orchestraType:null,courseTypeCode:null,subjectId:null,classId:null,studentType:null,loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[]}),u=b({ase:0,sortType:1}),g=$(()=>(console.log("ranking===>"),D.timer)),m=async()=>{o.loading=!0;try{const e=await gt({...o.pagination,...u,...L(g.value,["startTime","endTime"],"YYYY-MM-DD")});o.tableList=e.data.rows,o.pagination.pageTotal=e.data.total,o.loading=!1}catch(e){o.loading=!1,console.log(e)}};i({getList:m}),R(async()=>{await m(),Q(()=>{document.querySelectorAll(".n-data-table-sorter").forEach(f=>{f.style.display="none"})})});const d=e=>{if(!e)u.ase=0,u.sortType=1,p.sortOrder=!1,r.sortOrder=!1,c.sortOrder=!1;else{const f={practiceDuration:1,practiceDays:2,practiceDurationAvg:3};u.sortType=f[e.columnKey],e.columnKey=="practiceDuration"&&(r.sortOrder=e.order,p.sortOrder=!1,c.sortOrder=!1),e.columnKey=="practiceDays"&&(p.sortOrder=e.order,r.sortOrder=!1,c.sortOrder=!1),e.columnKey=="practiceDurationAvg"&&(c.sortOrder=e.order,p.sortOrder=!1,r.sortOrder=!1),u.ase=e.order=="ascend"?1:0}m()},p=b({title(){return t(O,{showArrow:!1,placement:"top-start"},{trigger:()=>t("div",{class:a.cell},[l("练习天数"),t("img",{class:a.sortIcon,src:p.sortOrder==="descend"?P:p.sortOrder==="ascend"?Y:U},null)]),default:p.sortOrder==="descend"?"点击升序":p.sortOrder==="ascend"?"取消排序":"点击降序"})},key:"practiceDays",sorter:!0,sortOrder:!1,render(e){return t(v,null,[e.practiceDays?e.practiceDays:0,l("天")])}}),r=b({title(){return t(O,{showArrow:!1,placement:"top-start"},{trigger:()=>t("div",{class:a.cell},[l("练习总时长"),t("img",{class:a.sortIcon,src:r.sortOrder==="descend"?P:r.sortOrder==="ascend"?Y:U},null)]),default:r.sortOrder==="descend"?"点击升序":r.sortOrder==="ascend"?"取消排序":"点击降序"})},key:"practiceDuration",sorter:!0,sortOrder:!1,render(e){return t(v,null,[e.practiceDuration?A(e.practiceDuration)>0?A(e.practiceDuration)+"分"+E(e.practiceDuration)+"秒":E(e.practiceDuration)+"秒":0])}}),c=b({title(){return t(O,{showArrow:!1,placement:"top-start"},{trigger:()=>t("div",{class:a.cell},[l("平均每天练习时长"),t("img",{class:a.sortIcon,src:c.sortOrder==="descend"?P:c.sortOrder==="ascend"?Y:U},null)]),default:c.sortOrder==="descend"?"点击升序":c.sortOrder==="ascend"?"取消排序":"点击降序"})},key:"practiceDurationAvg",sorter:!0,sortOrder:!1,render(e){return t(v,null,[e.practiceDurationAvg?A(e.practiceDurationAvg)>0?A(e.practiceDurationAvg)+"分"+E(e.practiceDurationAvg)+"秒":E(e.practiceDurationAvg)+"秒":0])}}),n=()=>[{title:"姓名",key:"studentName"},{title:"手机号",key:"studentPhone"},p,r,c];return()=>t("div",{class:a.listWrap},[t("div",{class:a.tableWrap},[t(q,{class:a.classTable,loading:o.loading,columns:n(),data:o.tableList,"onUpdate:sorter":d},{empty:()=>t(M,null,null)}),t(Z,{page:o.pagination.page,"onUpdate:page":e=>o.pagination.page=e,pageSize:o.pagination.rows,"onUpdate:pageSize":e=>o.pagination.rows=e,pageTotal:o.pagination.pageTotal,"onUpdate:pageTotal":e=>o.pagination.pageTotal=e,onList:m,sync:!0},null)])])}}),Ct=I({name:"data-guide",emits:["close"],setup(D,{emit:w}){const i=b({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:z("data1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:h(-4),left:h(-100),width:h(472),height:h(256)},btnsStyle:{bottom:h(30),left:h(-110)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:14,top:14,width:28,height:28}},{ele:"",img:z("data2.png"),imgStyle:{top:h(-4),left:h(-100),width:h(509),height:h(230)},btnsStyle:{bottom:h(30),left:h(-110)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:14,top:14,width:28,height:28}},{ele:"",img:z("data3.png"),imgStyle:{top:"100%",left:h(-105),width:h(438),height:h(230)},btnsStyle:{bottom:h(30),left:h(-115)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:14,top:14,width:28,height:28}}],step:0}),o=T(!1),u=T({});(async()=>{try{const n=localStorage.getItem("teacher-guideInfo");n?u.value=JSON.parse(n)||null:u.value={},u.value&&u.value.dataGuide?o.value=!1:o.value=!0}catch(n){console.log(n)}})();const m=()=>{var e,f,x,s;const n=document.getElementById("data-".concat(i.step));if(n){const y=n.getBoundingClientRect(),k=((e=i.steps[i.step].eleRectPadding)==null?void 0:e.left)||0,F=((f=i.steps[i.step].eleRectPadding)==null?void 0:f.top)||0,tt=((x=i.steps[i.step].eleRectPadding)==null?void 0:x.width)||0,et=((s=i.steps[i.step].eleRectPadding)==null?void 0:s.height)||0;i.box={left:y.x-k+"px",top:y.y-F+"px",width:y.width+tt+"px",height:y.height+et+"px"}}else r()},d=async n=>{try{if(n!=="data-module")return;u.value?u.value.dataGuide=!1:u.value={dataGuide:!1};try{j({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(u.value)})}catch(e){console.log(e)}i.step=0,m(),o.value=!0}catch(e){}};R(()=>{m(),window.addEventListener("resize",p),W.on("teacher-guideInfo",d)});const p=()=>{m()};st(()=>{window.removeEventListener("resize",p),W.off("teacher-guideInfo",d)});const r=()=>{if(i.step>=4){c();return}i.step=i.step+1,m()},c=async()=>{u.value?u.value.dataGuide=!0:u.value={dataGuide:!0};try{j({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(u.value)})}catch(n){console.log(n)}o.value=!1};return()=>{var n;return t(v,null,[o.value?lt(t("div",{"onUpdate:show":e=>o.value=e,class:["n-modal-mask","n-modal-mask-guide"]},[t("div",{class:C.content,onClick:()=>r()},[t("div",{class:C.backBtn,onClick:e=>{e.stopPropagation(),c()}},[l("跳过")]),t("div",{class:C.box,style:{...i.box,...(n=i.steps[i.step])==null?void 0:n.boxStyle},id:"modeType-".concat(i.step)},[i.steps.map((e,f)=>{var x,s,y,k;return t("div",{onClick:F=>F.stopPropagation(),class:C.item,style:e.type=="bottom"?{display:f===i.step?"":"none",left:"".concat((x=e.eleRect)==null?void 0:x.left,"px"),top:"-".concat((s=e.imgStyle)==null?void 0:s.height)}:{display:f===i.step?"":"none",left:"".concat((y=e.eleRect)==null?void 0:y.left,"px"),top:"".concat((k=i.box)==null?void 0:k.height)}},[t("img",{class:C.img,style:e.imgStyle,src:e.img},null),t("div",{class:C.btns,style:e.btnsStyle},[i.step+1==i.steps.length?t(v,null,[t("div",{class:[C.endBtn],onClick:()=>c()},[l("完成")]),t("div",{class:C.nextBtn,onClick:()=>{i.step=0,m()}},[l("再看一遍")])]):t("div",{class:C.btn,onClick:()=>r()},[l("下一步 ("),i.step+1,l("/"),i.steps.length,l(")")])])])})])])]),[[it,o.value,"show"]]):null])}}}),Yt=I({name:"data-module",setup(){const D=T("training"),w=J();ot(c=>{c.form.tabName&&(D.value=c.form.tabName)});const i=T(),o=T(),u=T(),g=c=>{ut(c,"tabName",w)},m=T(!1),d=T([_(new Date().getTime()),V(new Date().getTime())]),p=()=>{console.log(d.value),i.value&&i.value.getList(),o.value&&o.value.getList(),u.value&&u.value.getList()},r=()=>{console.log("点击重置"),d.value=[_(new Date().getTime()),V(new Date().getTime())],Q(()=>{p()})};return R(()=>{setTimeout(()=>{m.value=!0},800)}),()=>t("div",null,[t("div",{class:B.listWrap},[t(nt,{"onUpdate:value":[c=>g(c),c=>D.value=c],class:B.customTabs,value:D.value,size:"large",animated:!1,"pane-wrapper-style":"margin: 0 -4px","pane-style":"padding-left: 4px; padding-right: 4px; box-sizing: border-box;"},{default:()=>[t(N,{name:"training",tab:"作业统计"},{default:()=>[t(Tt,{ref:i,timer:d.value},null)],tab:()=>t("span",{id:"data-0"},[l("作业统计")])}),t(N,{name:"practice",tab:"学练数据"},{default:()=>[t(bt,{ref:o,timer:d.value},null)],tab:()=>t("span",{id:"data-1"},[l("学练数据")])}),t(N,{name:"ranking",tab:"学练排行"},{default:()=>[t(xt,{ref:u,timer:d.value},null)],tab:()=>t("span",{id:"data-2"},[l("学练排行")])})],suffix:()=>t(v,null,[t("div",{class:B.homeStudyInfoDate},[t(H,null,{default:()=>[t(ct,rt({clearable:!1},{value:d.value,"onUpdate:value":c=>d.value=c,separator:"-",type:"daterange",timerValue:d.value}),null),t(G,{type:"primary",class:B.searchBtn,onClick:()=>p()},{default:()=>[l("搜索")]}),t(G,{type:"primary",onClick:()=>r(),ghost:!0,class:B.resetBtn},{default:()=>[l("重置")]})]})])])}),m.value?t(Ct,null,null):null])])}});export{Yt as default};