index.dda875c7.js 7.8 KB

1
  1. import{O as B}from"./index.3794d343.js";import{O as U}from"./index.659a5930.js";import{d as M,c as e,q as _,F as R,ag as W,r as T,ai as s,aK as C,R as i,Z as x,$ as H,aj as I,ak as O,m as P,o as N,ah as q,X as A,a5 as G}from"./index.298b5cc7.js";import{O as V}from"./index.304a5a60.js";import{s as L}from"./student-icon.30fb072d.js";import{I as S}from"./index.6c7fe5d3.js";import{L as F}from"./index.e933d862.js";import{i as K}from"./isBetween.f451cf00.js";import{T as X,a as j}from"./index.5cefb096.js";import{C as Z}from"./index.1a8301c6.js";import"./index.6a614e4d.js";import"./use-tab-status.99b1afc1.js";import"./index.d31910fb.js";import"./index.0b33121c.js";import"./utils.16a50ed6.js";import"./Picker.fe47e1d4.js";const z="_itemWrap_1xvws_1",J="_wrapLeft_1xvws_9",Q="_numWrap_1xvws_14",ee="_headerWrap_1xvws_28",te="_studentName_1xvws_39",ae="_tag_1xvws_46",ne="_wrapRight_1xvws_57",se="_itemRankWrap_1xvws_69",le="_myTag_1xvws_109",oe="_wall_1xvws_133";var r={itemWrap:z,wrapLeft:J,numWrap:Q,headerWrap:ee,studentName:te,tag:ae,wrapRight:ne,itemRankWrap:se,myTag:le,wall:oe},ie="./assets/first.9696dc0f.png",re="./assets/second.e9b7016e.png",ue="./assets/third.6edc909a.png",$=M({props:["item","type","index"],name:"rank-item",setup(t){return()=>e(R,null,[e("div",null,[e("div",{class:r.itemWrap},[e("div",{class:r.wrapLeft},[e("div",{class:r.numWrap},[t.index==1?e("img",{src:ie,alt:""},null):null,t.index==2?e("img",{src:re,alt:""},null):null,t.index==3?e("img",{src:ue,alt:""},null):null,t.index>3?e("p",null,[t.index]):null]),e("div",{class:r.headerWrap},[e(S,{width:"100%",height:"100%",src:t.item.avatar?t.item.avatar:L,alt:"",fit:"cover"},null)]),e("div",null,[e("p",{class:r.studentName},[t.item.nickname]),e("div",{class:r.tag},[t.item.subjectNames?t.item.subjectNames:"\u6682\u65E0\u58F0\u90E8"])])]),e("div",{class:r.wrapRight},[t.type=="day"?e("p",null,[e("span",null,[t.item.practiceDays?t.item.practiceDays:0]),_(" \u5929")]):e("p",null,[e("span",null,[t.item.practiceTimes?t.item.practiceTimes:0]),_(" \u5206\u949F")])])])])])}}),E=M({props:["item","type","index"],name:"rank-item",setup(t){return()=>e(R,null,[e("div",null,[e("div",{class:r.itemRankWrap},[e("div",{class:r.wrapLeft},[e("div",{class:r.headerWrap},[e(S,{width:"100%",height:"100%",src:t.item.avatar?t.item.avatar:L,alt:"",fit:"cover"},null)]),e("div",null,[e("p",{class:r.studentName},[t.item.nickname]),e("div",{class:r.myTag},[t.item.subjectNames?t.item.subjectNames:"\u6682\u65E0\u58F0\u90E8"])])]),e("div",{class:r.wrapRight},[t.item.ranking<=50?e("p",null,[e("span",null,[_("\u6211\u7684\u6392\u540D")]),t.item.ranking<=50?t.item.ranking:0]):e("p",null,[" ",e("span",null,[_("\u6682\u65E0\u6392\u540D")])])])]),e("div",{class:r.wall},null)])])}});function ce(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!O(t)}var me=M({name:"timer-bang",props:["toHeight"],emits:["setTime"],setup(t,{slots:u,attrs:Y,emit:l}){W(),T({showPopoverTime:!1,showPopoverOrchestra:!1,showPopoverSubject:!1,actions:[],subjects:[],currentDate:[s().format("YYYY"),s().format("MM")]});const g=C("parentData",{practiceMonth:""}),n=T({practiceMonth:g.practiceMonth,page:1,rows:50,sortType:"PRACTICE_TIMES"}),o=i(!1),w=i(!1),v=i(!1),c=i(!0),m=i([]),h=i(t.toHeight),d=i({});x(()=>t.toHeight,a=>{h.value=a,console.log(h.value)}),x(()=>g.practiceMonth,a=>{n.practiceMonth=a,o.value=!0,p()});const p=async()=>{w.value=!0;try{o.value&&(n.page=1,m.value=[],o.value=!1);const a=await P.post("/api-student/student/page",{data:{...n}});if(m.value.length>0&&a.data.pages===1)return;n.page=a.data.current+1,m.value=a.data.rows,c.value=m.value.length>0,console.log(c.value," showContact.value "),w.value=!1,v.value=!0,d.value=a.data.extra}catch(a){const f=a.message;N(f),c.value=!1,v.value=!0}};H(()=>{p()});const D=()=>{v.value=!1,w.value=!0,p()};return()=>{var f;let a;return e("div",{class:!c.value&&"emptyRootContainer",style:{minHeight:`calc(100vh - ${h.value}px)`}},[c.value?e("div",null,[e(V,{modelValue:o.value,"onUpdate:modelValue":y=>o.value=y,onRefresh:D,style:{minHeight:`calc(100vh - ${h.value}px - 1.17333rem)`}},{default:()=>[e(F,{finished:v.value,"finished-text":" ",onLoad:p,"loading-text":" "},ce(a=m.value.map((y,b)=>e($,{item:y,type:"time",index:b+1},null)))?a:{default:()=>[a]})]}),d.value&&((f=d.value)==null?void 0:f.ranking)?e(E,{item:d.value},null):null]):e(I,null,null)])}}});function ve(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!O(t)}var de=M({props:["toHeight"],emits:["setTime"],name:"day-bang",setup(t,{slots:u,attrs:Y,emit:l}){W(),T({showPopoverTime:!1,showPopoverOrchestra:!1,showPopoverSubject:!1,actions:[],subjects:[],currentDate:[s().format("YYYY"),s().format("MM")]});const g=C("parentData",{practiceMonth:""}),n=T({practiceMonth:g.practiceMonth,page:1,rows:50,sortType:"PRACTICE_DAY"}),o=i(!1),w=i(!1),v=i(!1),c=i(!0),m=i([]),h=i(t.toHeight),d=i({});console.log(t.toHeight),x(()=>t.toHeight,a=>{h.value=a}),x(()=>g.practiceMonth,a=>{n.practiceMonth=a,o.value=!0,p()});const p=async()=>{w.value=!0;try{o.value&&(n.page=1,m.value=[],o.value=!1);const a=await P.post("/api-student/student/page",{data:{...n}});if(m.value.length>0&&a.data.pages===1)return;n.page=a.data.current+1,m.value=a.data.rows,c.value=m.value.length>0,console.log(c.value," showContact.value "),w.value=!1,v.value=!0,d.value=a.data.extra}catch(a){const f=a.message;N(f),c.value=!1,v.value=!0}};H(()=>{p()});const D=()=>{v.value=!1,w.value=!0,p()};return()=>{var f;let a;return e("div",{class:!c.value&&"emptyRootContainer",style:{minHeight:`calc(100vh - ${h.value}px)`}},[c.value?e("div",null,[e(V,{modelValue:o.value,"onUpdate:modelValue":y=>o.value=y,onRefresh:D,style:{minHeight:`calc(100vh - ${h.value}px - 1.17333rem)`}},{default:()=>[e(F,{"loading-text":" ",finished:v.value,"finished-text":" ",onLoad:p},ve(a=m.value.map((y,b)=>e($,{item:y,type:"day",index:b+1},null)))?a:{default:()=>[a]})]}),d.value&&((f=d.value)==null?void 0:f.ranking)?e(E,{item:d.value},null):null]):e(I,null,null)])}}});const pe="_topWrap_xa4v4_1",fe="_topTime_xa4v4_6",he="_rankTabs_xa4v4_16";var k={topWrap:pe,topTime:fe,rankTabs:he};s.extend(K);var Ie=M({name:"ranking-list",setup(){W();const t=q(),u=T({heightV:0,showPopoverTime:!1}),Y=i(t.query.type||"day"),l=T({practiceMonth:s().day(1).format("YYYYMMDD"),endTime:s().day(7).format("YYYY-MM-DD")});A("parentData",l);const g=n=>{u.heightV=n,console.log(u.heightV,"\u83B7\u53D6\u9AD8\u5EA6")};return()=>e(R,null,[e(U,{position:"top",background:"#F8F8F8",onGetHeight:g},{default:()=>[e("div",{class:k.topWrap},[e(B,{color:"#ffffff",backIconColor:"white",background:"transparent",border:!1},null),e("span",{class:k.topTime,onClick:()=>u.showPopoverTime=!0},[s(l.practiceMonth).format("YYYY-MM-DD"),_("~"),l.endTime," ",e(G,{name:u.showPopoverTime?"arrow-up":"arrow-down"},null)])]),e(X,{active:Y.value,"onUpdate:active":n=>Y.value=n,class:k.rankTabs,background:"rgba(224, 69, 21,.71)","title-active-color":"#fff","title-inactive-color":"#fff",color:"#fff"},{default:()=>[e(j,{name:"day",title:"\u5929\u6570\u699C"},null),e(j,{name:"time",title:"\u65F6\u957F\u699C"},null)]})]}),Y.value=="time"?e(me,{toHeight:u.heightV},null):e(de,{toHeight:u.heightV},null),e(Z,{show:u.showPopoverTime,"onUpdate:show":n=>u.showPopoverTime=n,firstDayOfWeek:1,showConfirm:!1,type:"range",maxRange:7,minDate:new Date("2023-02-27"),defaultDate:[s(l.practiceMonth).toDate(),s(l.endTime).toDate()],style:{height:"70%"},onSelect:n=>{if(l.practiceMonth="",l.endTime="",!s(n[0]).isBetween(s(l.practiceMonth),s(l.endTime))){const o=s(n[0]).day();o===0?(l.practiceMonth=s(n[0]).subtract(6,"day").format("YYYYMMDD"),l.endTime=s(n[0]).format("YYYY-MM-DD")):o===1?(l.practiceMonth=s(n[0]).format("YYYYMMDD"),l.endTime=s(n[0]).add(6,"day").format("YYYY-MM-DD")):(l.practiceMonth=s(n[0]).subtract(o-1,"day").format("YYYYMMDD"),l.endTime=s(n[0]).add(7-o,"day").format("YYYY-MM-DD"))}u.showPopoverTime=!1}},null)])}});export{Ie as default};