index.625a5122.js 7.7 KB

1
  1. import{d as M,c as e,q as _,F as R,ag as W,r as T,ai as s,aJ as C,R as i,Z as x,$ as H,ak as I,al as P,m as N,o as O,ah as B,X as U,aj as q,a5 as A}from"./index.332c7f08.js";import{O as G}from"./index.d7c1b6ac.js";import{O as V}from"./index.626c48f9.js";import{s as L}from"./student-icon.30fb072d.js";import{I as S}from"./index.96a8db5e.js";import{L as F}from"./index.b186dfda.js";import{i as J}from"./isBetween.edbfdc90.js";import{T as X,a as j}from"./index.7c580591.js";import{C as Z}from"./index.97c682f1.js";import"./use-tab-status.9d769af8.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";import"./utils.4b86e8c9.js";import"./Picker.e56f94bd.js";const z="_itemWrap_1xvws_1",K="_wrapLeft_1xvws_9",Q="_numWrap_1xvws_14",ee="_headerWrap_1xvws_28",ae="_studentName_1xvws_39",te="_tag_1xvws_46",ne="_wrapRight_1xvws_57",se="_itemRankWrap_1xvws_69",le="_myTag_1xvws_109",oe="_wall_1xvws_133";var r={itemWrap:z,wrapLeft:K,numWrap:Q,headerWrap:ee,studentName:ae,tag:te,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(a){return()=>e(R,null,[e("div",null,[e("div",{class:r.itemWrap},[e("div",{class:r.wrapLeft},[e("div",{class:r.numWrap},[a.index==1?e("img",{src:ie,alt:""},null):null,a.index==2?e("img",{src:re,alt:""},null):null,a.index==3?e("img",{src:ue,alt:""},null):null,a.index>3?e("p",null,[a.index]):null]),e("div",{class:r.headerWrap},[e(S,{width:"100%",height:"100%",src:a.item.avatar?a.item.avatar:L,alt:"",fit:"cover"},null)]),e("div",null,[e("p",{class:r.studentName},[a.item.nickname]),e("div",{class:r.tag},[a.item.subjectNames?a.item.subjectNames:"\u6682\u65E0\u58F0\u90E8"])])]),e("div",{class:r.wrapRight},[a.type=="day"?e("p",null,[e("span",null,[a.item.practiceDays?a.item.practiceDays:0]),_(" \u5929")]):e("p",null,[e("span",null,[a.item.practiceTimes?a.item.practiceTimes:0]),_(" \u5206\u949F")])])])])])}}),E=M({props:["item","type","index"],name:"rank-item",setup(a){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:a.item.avatar?a.item.avatar:L,alt:"",fit:"cover"},null)]),e("div",null,[e("p",{class:r.studentName},[a.item.nickname]),e("div",{class:r.myTag},[a.item.subjectNames?a.item.subjectNames:"\u6682\u65E0\u58F0\u90E8"])])]),e("div",{class:r.wrapRight},[a.item.ranking<=50?e("p",null,[e("span",null,[_("\u6211\u7684\u6392\u540D")]),a.item.ranking<=50?a.item.ranking:0]):e("p",null,[" ",e("span",null,[_("\u6682\u65E0\u6392\u540D")])])])]),e("div",{class:r.wall},null)])])}});function ce(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!P(a)}var me=M({name:"timer-bang",props:["toHeight"],emits:["setTime"],setup(a,{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(a.toHeight),d=i({});x(()=>a.toHeight,t=>{h.value=t,console.log(h.value)}),x(()=>g.practiceMonth,t=>{n.practiceMonth=t,o.value=!0,p()});const p=async()=>{w.value=!0;try{o.value&&(n.page=1,m.value=[],o.value=!1);const t=await N.post("/api-student/student/page",{data:{...n}});if(m.value.length>0&&t.data.pages===1)return;n.page=t.data.current+1,m.value=t.data.rows,c.value=m.value.length>0,console.log(c.value," showContact.value "),w.value=!1,v.value=!0,d.value=t.data.extra}catch(t){const f=t.message;O(f),c.value=!1,v.value=!0}};H(()=>{p()});const D=()=>{v.value=!1,w.value=!0,p()};return()=>{var f;let t;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(t=m.value.map((y,b)=>e($,{item:y,type:"time",index:b+1},null)))?t:{default:()=>[t]})]}),d.value&&((f=d.value)==null?void 0:f.ranking)?e(E,{item:d.value},null):null]):e(I,null,null)])}}});function ve(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!P(a)}var de=M({props:["toHeight"],emits:["setTime"],name:"day-bang",setup(a,{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(a.toHeight),d=i({});console.log(a.toHeight),x(()=>a.toHeight,t=>{h.value=t}),x(()=>g.practiceMonth,t=>{n.practiceMonth=t,o.value=!0,p()});const p=async()=>{w.value=!0;try{o.value&&(n.page=1,m.value=[],o.value=!1);const t=await N.post("/api-student/student/page",{data:{...n}});if(m.value.length>0&&t.data.pages===1)return;n.page=t.data.current+1,m.value=t.data.rows,c.value=m.value.length>0,console.log(c.value," showContact.value "),w.value=!1,v.value=!0,d.value=t.data.extra}catch(t){const f=t.message;O(f),c.value=!1,v.value=!0}};H(()=>{p()});const D=()=>{v.value=!1,w.value=!0,p()};return()=>{var f;let t;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(t=m.value.map((y,b)=>e($,{item:y,type:"day",index:b+1},null)))?t:{default:()=>[t]})]}),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(J);var Ce=M({name:"ranking-list",setup(){W();const a=B(),u=T({heightV:0,showPopoverTime:!1}),Y=i(a.query.type||"day"),l=T({practiceMonth:s().day(1).format("YYYYMMDD"),endTime:s().day(7).format("YYYY-MM-DD")});U("parentData",l);const g=n=>{u.heightV=n,console.log(u.heightV,"\u83B7\u53D6\u9AD8\u5EA6")};return()=>e(R,null,[e(G,{position:"top",background:"#F8F8F8",onGetHeight:g},{default:()=>[e("div",{class:k.topWrap},[e(q,{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(A,{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{Ce as default};