index-daadbd06.js 17 KB

1
  1. import{B as z,d as k,r as D,u as Q,a as _,e as b,L as Y,n as I,f as t,k as l,c9 as U,F as y,j as O,w as V,R as f,M,O as X,S as Z,U as tt,p as et,q as N,x as at,E as st}from"./index-e7035897.js";import{g as it,s as lt}from"./use-async-1a5dd313.js";import{N as A,C as nt}from"./index-554b9640.js";import{s as a}from"./index.module-55a6825b.js";import{u as j}from"./useECharts-99709c5a.js";import{P as K}from"./index-76d4ecc3.js";import{b as B,c as L,d as E,g as q,a as W}from"./dateFormat-959146e7.js";import{j as rt,t as ot,l as ut}from"./api-f6cfeba9.js";import{T as G}from"./index-9e5d3d42.js";import{g as P,s as S,a as ct,b as $}from"./api-3ce0637e.js";import"./index-94975ec6.js";const pt="_listWrap_17ock_1",dt="_customTabs_17ock_7",gt="_searchBtn_17ock_28",mt="_resetBtn_17ock_37",R={listWrap:pt,customTabs:dt,searchBtn:gt,resetBtn:mt},ft=h=>z.post("/edu-app/lessonTraining/trainingStat",{data:h}),yt=h=>z.post("/edu-app/musicPracticeRecordStat/trainingStat",{data:h}),ht=k({name:"home-trainData",props:{timer:{type:Array,defaut:()=>[]}},setup(h,{expose:w}){const i=D(null),{setOptions:o}=j(i),u=D(!0),c=D(!0),g=Q(),m=_(),p=b({height:"360px",width:"100%",studentNum:0,paymentAmount:0,dateList:["2022-10-10","2022-10-11","2022-10-12","2022-10-13","2022-10-14","2022-10-15","2022-10-16"],studentList:[],payInfoList:[]}),d=D({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}),n=Y(()=>h.timer),e=()=>[{title:"布置老师",key:"teacherName"},{title:"布置时间",key:"createTime",render(s){return t(y,null,[s.createTime])}},{title:"截止时间",key:"expireDate",render(s){return t(y,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(y,null,[s.trainingRate,l("%")])}},{title:"合格率",key:"qualifiedRate",render(s){return t(y,null,[s.qualifiedRate,l("%")])}},{title:"操作",key:"id",render(s){return t(V,null,{default:()=>[t(O,{text:!0,type:"primary",onClick:()=>T(s)},{default:()=>[l("详情")]})]})}}],T=s=>{console.log(s),g.push({path:"/afterWorkDetail",query:{...m.query,teacherName:s.teacherName,trainingId:s.id,id:s.classGroupId,name:s.classGroupName}})},x=async()=>{try{const s=await ft({...B(n.value,["startTime","endTime"],"YYYY-MM-DD")});d.value={...s.data},p.dateList=s.data.trainingStatDetails.map(v=>v.date),p.payInfoList=s.data.trainingStatDetails.map(v=>v.qualifiedStudentCount),p.studentList=s.data.trainingStatDetails.map(v=>v.unqualifiedStudentCount),C()}catch(s){console.log(s)}try{const s=await rt({...r.pagination,...B(n.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:x});const C=()=>{o({tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:2,color:"#A9C7FF"}}},legend:{show:!1,selected:{合格人数:u.value,不合格人数:c.value}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{show:!0,interval:0},data:p.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:p.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:p.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(v=>"<br/>".concat(v.marker,'<span style="margin-top:10px;margin-left:5px;font-size: 13px;font-weight: 500;\n color: #333333;\n line-height: 18px;">').concat(v.seriesName,": ").concat(v.value,"人 </span>"))].join(""):s})};return I(()=>{x()}),()=>t(y,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("span",null,[t(A,{from:0,to:d.value.trainingCount},null)]),l("次")]),t("p",{class:a.TrainDataItemsubTitle},[l("作业次数")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("span",null,[t(A,{from:0,to:d.value.totalStudentCount},null)]),l("人次")]),t("p",{class:a.TrainDataItemsubTitle},[l("应交总人次")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("span",null,[t(A,{from:0,to:d.value.submitStudentCount},null)]),l("人次")]),t("p",{class:a.TrainDataItemsubTitle},[l("提交总人次")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("span",null,[" ",t(A,{from:0,to:d.value.qualifiedStudentCount},null)]),l("人次")]),t("p",{class:a.TrainDataItemsubTitle},[l("合格总人次")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("span",null,[t(A,{from:0,to:d.value.trainingRate},null),l("%")])]),t("p",{class:a.TrainDataItemsubTitle},[l("作业提交率")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[t("span",null,[t(A,{from:0,to:d.value.qualifiedRate},null),l("%")])]),t("p",{class:a.TrainDataItemsubTitle},[l("作业合格率")])])]),t("div",{class:a.TrainDataTopRight},[t("div",{onClick:()=>{u.value=!u.value,C()},class:[a.DataTopRightItem,u.value?"":a.DataTopRightItemDis]},[t("div",{class:a.DataTopRightDot},null),t("p",null,[l("合格人数")])]),t("div",{onClick:()=>{c.value=!c.value,C()},class:[a.DataTopRightItem,c.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:p.height,width:p.width}},null)]),t("div",{class:a.tableWrap},[t(U,{class:a.classTable,loading:r.loading,columns:e(),data:r.tableList},{empty:()=>t(G,null,null)}),t(K,{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:x,sync:!0},null)])])])}}),vt=k({name:"home-practiceData",props:{timer:{type:Array,defaut:()=>[]}},setup(h,{expose:w}){const i=D(null),{setOptions:o}=j(i),u=D(!0),c=b({height:"360px",width:"100%",practiceUserCount:0,paymentAmount:0,practiceDurationAvg:0,practiceDays:0,practiceDurationTotal:0,dateList:[],timeList:[]}),g=b({loading:!1,pagination:{page:1,rows:10,pageTotal:4},tableList:[],goCourseVisiable:!1}),m=Y(()=>h.timer),p=()=>[{title:"日期",key:"date"},{title:"练习人数",key:"practiceUserCount",render(n){return t(y,null,[n.practiceUserCount,l("人")])}},{title:"平均练习时长(分钟)",key:"practiceDuration",render(n){return t(y,null,[" ",t(y,null,[n.practiceDuration?L(n.practiceDuration)>0?L(n.practiceDuration)+"分"+E(n.practiceDuration)+"秒":E(n.practiceDuration)+"秒":"0分钟"])])}}],d=async()=>{try{const n=await ot({page:1,rows:999,...B(m.value,["startTime","endTime"],"YYYY-MM-DD")}),e=await yt({page:1,rows:999,...B(m.value,["startTime","endTime"],"YYYY-MM-DD")});g.tableList=n.data.rows,c.practiceDurationAvg=e.data.practiceDurationAvg,c.practiceUserCount=e.data.practiceUserCount,c.dateList=e.data.trainingStatDetailList.map(T=>T.date),c.timeList=e.data.trainingStatDetailList.map(T=>T.practiceUserCount),console.log("trainingStatDetailList",c.timeList),r()}catch(n){console.log(n)}};w({getList:d});const r=()=>{o({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{show:!1,selected:{练习人数:u.value}},xAxis:{type:"category",boundaryGap:!0,axisLabel:{show:!0,interval:0},data:c.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:c.timeList,type:"bar",barWidth:"48px",itemStyle:{normal:{barBorderRadius:[8,8,0,0],color:"#D5E9FF"},emphasis:{color:"#3583FA"}}}],formatter:n=>Array.isArray(n)?[n[0].axisValueLabel,...n.map(e=>"<br/>".concat(e.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.value,"人 </span>"))].join(""):n})};return I(()=>{d()}),()=>t(y,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("span",null,[t(A,{from:0,to:c.practiceUserCount},null)]),l("人")]),t("p",{class:a.TrainDataItemsubTitle},[l("练习人数")])]),t("div",{class:a.TrainDataItem},[t("p",{class:a.TrainDataItemTitle},[L(c.practiceDurationAvg)>0?t("div",null,[t("span",null,[t(A,{from:0,to:L(c.practiceDurationAvg)},null)])," ",l("分")]):null,t("div",null,[t("span",null,[t(A,{from:0,to:E(c.practiceDurationAvg)},null)])," ",l("秒")])]),t("p",{class:a.TrainDataItemsubTitle},[l("平均练习时长")])])]),t("div",{class:a.TrainDataTopRight},[t("div",{class:[a.DataTopRightItem,u.value?"":a.DataTopRightItemDis]},[t("div",{class:[a.DataTopRightDot,a.DataTopRightDotBlue]},null),t("p",null,[l("练习人数")])])])]),t("div",{class:a.chatrs},[t("div",{ref:i,style:{height:c.height,width:c.width}},null)]),t("div",{class:a.tableWrap},[t(U,{class:a.classTable,loading:g.loading,columns:p(),data:g.tableList},{empty:()=>t(G,null,null)})])])])}}),Dt=k({name:"student-studentList",props:{timer:{type:Array,defaut:()=>[]}},setup(h,{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}),c=Y(()=>(console.log("ranking===>"),h.timer)),g=async()=>{o.loading=!0;try{const e=await ut({...o.pagination,...u,...B(c.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:g}),I(()=>{g()});const m=e=>{if(!e)u.ase=0,u.sortType=1,p.sortOrder=!1,d.sortOrder=!1,r.sortOrder=!1;else{const T={practiceDuration:1,practiceDays:2,practiceDurationAvg:3};u.sortType=T[e.columnKey],e.columnKey=="practiceDuration"&&(d.sortOrder=e.order,p.sortOrder=!1,r.sortOrder=!1),e.columnKey=="practiceDays"&&(p.sortOrder=e.order,d.sortOrder=!1,r.sortOrder=!1),e.columnKey=="practiceDurationAvg"&&(r.sortOrder=e.order,p.sortOrder=!1,d.sortOrder=!1),u.ase=e.order=="ascend"?1:0}g()},p=b({title:"练习天数",key:"practiceDays",sorter:!0,sortOrder:!1,render(e){return t(y,null,[e.practiceDays?e.practiceDays:0,l("天")])}}),d=b({title:"练习总时长",key:"practiceDuration",sorter:!0,sortOrder:!1,render(e){return t(y,null,[e.practiceDuration?L(e.practiceDuration)>0?L(e.practiceDuration)+"分"+E(e.practiceDuration)+"秒":E(e.practiceDuration)+"秒":0])}}),r=b({title:"平均练习时长",key:"practiceDurationAvg",sorter:!0,sortOrder:!1,render(e){return t(y,null,[e.practiceDurationAvg?L(e.practiceDurationAvg)>0?L(e.practiceDurationAvg)+"分"+E(e.practiceDurationAvg)+"秒":E(e.practiceDurationAvg)+"秒":0])}}),n=()=>[{title:"姓名",key:"studentName"},{title:"手机号",key:"studentPhone"},p,d,r];return()=>t("div",{class:a.listWrap},[t("div",{class:a.tableWrap},[t(U,{class:a.classTable,loading:o.loading,columns:n(),data:o.tableList,"onUpdate:sorter":m},{empty:()=>t(G,null,null)}),t(K,{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:g,sync:!0},null)])])}}),Tt=k({name:"data-guide",emits:["close"],setup(h,{emit:w}){const i=b({box:{height:"0px"},show:!1,steps:[{ele:"",eleRect:{},img:P("data1.png"),handStyle:{top:"0.91rem"},imgStyle:{top:f(-4),left:f(-100),width:f(472),height:f(256)},btnsStyle:{bottom:f(30),left:f(-110)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:14,top:14,width:28,height:28}},{ele:"",img:P("data2.png"),imgStyle:{top:f(-4),left:f(-100),width:f(509),height:f(230)},btnsStyle:{bottom:f(30),left:f(-110)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:14,top:14,width:28,height:28}},{ele:"",img:P("data3.png"),imgStyle:{top:"100%",left:f(-105),width:f(438),height:f(230)},btnsStyle:{bottom:f(30),left:f(-115)},boxStyle:{borderRadius:"25px"},eleRectPadding:{left:14,top:14,width:28,height:28}}],step:0}),o=D(!1),u=D({});(async()=>{var n;try{const e=await ct({guideTag:"teacher-guideInfo"});e.data?u.value=JSON.parse((n=e.data)==null?void 0:n.guideValue)||null:u.value={},u.value&&u.value.dataGuide?o.value=!1:o.value=!0}catch(e){console.log(e)}})();const g=()=>{var e,T,x,C;const n=document.getElementById("data-".concat(i.step));if(n){const s=n.getBoundingClientRect(),v=((e=i.steps[i.step].eleRectPadding)==null?void 0:e.left)||0,F=((T=i.steps[i.step].eleRectPadding)==null?void 0:T.top)||0,J=((x=i.steps[i.step].eleRectPadding)==null?void 0:x.width)||0,H=((C=i.steps[i.step].eleRectPadding)==null?void 0:C.height)||0;i.box={left:s.x-v+"px",top:s.y-F+"px",width:s.width+J+"px",height:s.height+H+"px"}}else d()},m=async n=>{try{if(n!=="data-module")return;u.value?u.value.dataGuide=!1:u.value={dataGuide:!1};try{await $({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(u.value)})}catch(e){console.log(e)}i.step=0,g(),o.value=!0}catch(e){}};I(()=>{g(),window.addEventListener("resize",p),M.on("teacher-guideInfo",n=>m(n))});const p=()=>{g()};X(()=>{window.removeEventListener("resize",p),M.off("teacher-guideInfo",m)});const d=()=>{if(i.step>=4){r();return}i.step=i.step+1,g()},r=async()=>{u.value?u.value.dataGuide=!0:u.value={dataGuide:!0};try{const n=await $({guideTag:"teacher-guideInfo",guideValue:JSON.stringify(u.value)})}catch(n){console.log(n)}o.value=!1};return()=>{var n;return t(y,null,[o.value?Z(t("div",{"onUpdate:show":e=>o.value=e,class:["n-modal-mask","n-modal-mask-guide"]},[t("div",{class:S.content,onClick:()=>d()},[t("div",{class:S.backBtn,onClick:e=>{e.stopPropagation(),r()}},[l("跳过")]),t("div",{class:S.box,style:{...i.box,...(n=i.steps[i.step])==null?void 0:n.boxStyle},id:"modeType-".concat(i.step)},[i.steps.map((e,T)=>{var x,C,s,v;return t("div",{onClick:F=>F.stopPropagation(),class:S.item,style:e.type=="bottom"?{display:T===i.step?"":"none",left:"".concat((x=e.eleRect)==null?void 0:x.left,"px"),top:"-".concat((C=e.imgStyle)==null?void 0:C.height)}:{display:T===i.step?"":"none",left:"".concat((s=e.eleRect)==null?void 0:s.left,"px"),top:"".concat((v=i.box)==null?void 0:v.height)}},[t("img",{class:S.img,style:e.imgStyle,src:e.img},null),t("div",{class:S.btns,style:e.btnsStyle},[i.step+1==i.steps.length?t(y,null,[t("div",{class:[S.endBtn],onClick:()=>r()},[l("完成")]),t("div",{class:S.nextBtn,onClick:()=>{i.step=0,g()}},[l("再看一遍")])]):t("div",{class:S.btn,onClick:()=>d()},[l("下一步 ("),i.step+1,l("/"),i.steps.length,l(")")])])])})])])]),[[tt,o.value,"show"]]):null])}}}),It=k({name:"data-module",setup(){const h=D("training"),w=_();it(r=>{r.form.tabName&&(h.value=r.form.tabName)});const i=D(),o=D(),u=D(),c=r=>{lt(r,"tabName",w)},g=D(!1),m=D([q(new Date().getTime()),W(new Date().getTime())]),p=()=>{console.log(m.value),i.value&&i.value.getList(),o.value&&o.value.getList(),u.value&&u.value.getList()},d=()=>{console.log("点击重置"),m.value=[q(new Date().getTime()),W(new Date().getTime())],st(()=>{p()})};return I(()=>{setTimeout(()=>{g.value=!0},800)}),()=>t("div",null,[t("div",{class:R.listWrap},[t(et,{"onUpdate:value":[r=>c(r),r=>h.value=r],class:R.customTabs,value:h.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(ht,{ref:i,timer:m.value},null)],tab:()=>t("span",{id:"data-0"},[l("作业统计")])}),t(N,{name:"practice",tab:"学练数据"},{default:()=>[t(vt,{ref:o,timer:m.value},null)],tab:()=>t("span",{id:"data-1"},[l("学练数据")])}),t(N,{name:"ranking",tab:"学练排行"},{default:()=>[t(Dt,{ref:u,timer:m.value},null)],tab:()=>t("span",{id:"data-2"},[l("学练排行")])})],suffix:()=>t(y,null,[t("div",{class:R.homeStudyInfoDate},[t(V,null,{default:()=>[t(nt,at({clearable:!1},{value:m.value,"onUpdate:value":r=>m.value=r,separator:"-",type:"daterange",timerValue:m.value}),null),t(O,{type:"primary",class:R.searchBtn,onClick:()=>p()},{default:()=>[l("搜索")]}),t(O,{type:"primary",onClick:()=>d(),ghost:!0,class:R.resetBtn},{default:()=>[l("重置")]})]})])])}),g.value?t(Tt,null,null):null])])}});export{It as default};