index.5df9394b.js 10 KB

1
  1. import{O as J}from"./index.00e2f453.js";import{O as K}from"./index.4f243ca1.js";import{d as _,k as e,l as L,F as k,aQ as R,R as j,ac as v,S as n,X as B,a2 as w,be as A,P as $,ad as E,g as b,j as y,s as q}from"./index.879f7421.js";import{d as Z,P as z,D as H}from"./default-icon.0f7747b4.js";import{L as Q}from"./index.9f8069d8.js";import{A as D}from"./index.5e1e8fd9.js";import{T as ee,a as M}from"./index.58ad42d7.js";import"./index.ea988859.js";import"./use-tab-status.fe36a003.js";import"./index.3c962eae.js";import"./index.e17cc929.js";const ae="_chioseWrap_18qtz_1";var f={chioseWrap:ae};const te="_itemWrap_17grm_1",se="_wrapLeft_17grm_9",oe="_numWrap_17grm_14",re="_headerWrap_17grm_28",ne="_studentName_17grm_39",le="_tag_17grm_45",ce="_wrapRight_17grm_55";var g={itemWrap:te,wrapLeft:se,numWrap:oe,headerWrap:re,studentName:ne,tag:le,wrapRight:ce},ue="./assets/first.9696dc0f.png",ie="./assets/second.e9b7016e.png",me="./assets/third.6edc909a.png",X=_({props:["item","type","index"],name:"rank-item",setup(r){return()=>e(k,null,[e("div",null,[e("div",{class:g.itemWrap},[e("div",{class:g.wrapLeft},[e("div",{class:g.numWrap},[r.index==1?e("img",{src:ue,alt:""},null):null,r.index==2?e("img",{src:ie,alt:""},null):null,r.index==3?e("img",{src:me,alt:""},null):null,r.index>3?e("p",null,[r.index]):null]),e("div",{class:g.headerWrap},[e("img",{src:r.item.avatar?r.item.avatar:Z,alt:""},null)]),e("div",null,[e("p",{class:g.studentName},[r.item.nickname]),e("div",{class:g.tag},[r.item.subjectNames])])]),e("div",{class:g.wrapRight},[r.type=="day"?e("p",null,[e("span",null,[r.item.practiceDays?r.item.practiceDays:0]),L("\u5929")]):e("p",null,[e("span",null,[r.item.practiceTimes?r.item.practiceTimes:0]),L("\u5C0F\u65F6")])])])])])}});function de(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!E(r)}var pe=_({name:"timer-bang",emits:["setTime"],setup(r,{slots:d,attrs:G,emit:T}){R();const a=j({showPopoverTime:!1,showPopoverOrchestra:!1,showPopoverSubject:!1,actions:[],subjects:[],currentDate:[v().format("YYYY"),v().format("MM")]}),o=j({time:a.currentDate[0]+""+a.currentDate[1],timeName:a.currentDate[0]+"\u5E74"+a.currentDate[1]+"\u6708",orchestraId:"",orchestraName:"\u5168\u90E8\u4E50\u56E2",subjectId:"",subjectName:"\u5168\u90E8\u58F0\u90E8",page:1,rows:50,sortType:"PRACTICE_DAY"}),N=n(new Date(v().subtract(5,"year").format("YYYY-MM-DD"))),S=n(new Date(v().add(5,"year").format("YYYY-MM-DD"))),Y=n(["year","month"]),l=n(!1),i=n(!1),p=n(!1),h=n(!1),m=n([]),c=async()=>{console.log("getList"),i.value=!0;try{l.value&&(o.page=1,m.value=[],l.value=!1);const t=await b.post("/api-school/student/page",{data:{...o}});if(m.value.length>0&&t.data.pages===1)return;o.page=t.data.current+1,m.value=t.data.rows,h.value=m.value.length>0,console.log(h.value," showContact.value "),i.value=!1,p.value=!0}catch(t){const s=t.message;y(s),h.value=!1,p.value=!0}},F=t=>{o.time=t.selectedValues[0]+t.selectedValues[1],o.timeName=t.selectedValues[0]+"\u5E74"+t.selectedValues[1]+"\u6708",T("setTime",o.timeName),a.showPopoverTime=!1,l.value=!0,c()},O=t=>{o.orchestraId=t.value,o.orchestraName=t.name,a.showPopoverOrchestra=!1,l.value=!0,c()},x=t=>{o.subjectId=t.value,o.subjectName=t.name,console.log(t,o),l.value=!0,c()},W=async()=>{const t=q.user.data.schoolInfos.map(s=>s.id).join(",");try{const s=await b.post("/api-school/orchestra/page",{data:{page:1,rows:9999,schoolId:t}});a.actions=s.data.rows.map(u=>({name:u.name,value:u.id})),a.actions.unshift({name:"\u5168\u90E8\u4E50\u56E2",value:""})}catch(s){const u=s.message;y(u)}},C=async()=>{try{const t=await b.post("/api-school/subject/page",{data:{page:1,rows:9999}});a.subjects=t.data.rows.map(s=>({name:s.name,value:s.id})),a.subjects.unshift({name:"\u5168\u90E8\u58F0\u90E8",value:""})}catch(t){const s=t.message;y(s)}};B(()=>{C(),W(),c(),T("setTime",o.timeName)});const I=()=>{p.value=!1,i.value=!0,c()};return()=>{let t;return e(k,null,[e("div",{class:f.chioseWrap},[e("div",{style:{padding:"0 13px",background:"#FFF"}},[e("div",{class:f.searchBand,onClick:()=>{a.showPopoverTime=!0}},[o.timeName,e(w,{name:a.showPopoverTime?"arrow-up":"arrow-down"},null)])]),e("div",{style:{padding:"0 13px",background:"#FFF"}},[e("div",{class:f.searchBand,onClick:()=>{a.showPopoverOrchestra=!0}},[o.orchestraName,e(w,{name:a.showPopoverOrchestra?"arrow-up":"arrow-down"},null)])]),e("div",{style:{padding:"0 13px",background:"#FFF"}},[e("div",{class:f.searchBand,onClick:()=>{a.showPopoverSubject=!0}},[o.subjectName,e(w,{name:a.showPopoverSubject?"arrow-up":"arrow-down"},null)])])]),h.value?e(z,{modelValue:l.value,"onUpdate:modelValue":s=>l.value=s,onRefresh:I},{default:()=>[e(Q,{loading:i.value,"onUpdate:loading":s=>i.value=s,finished:p.value,"finished-text":"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:c},de(t=m.value.map((s,u)=>e(X,{item:s,type:"day",index:u+1},null)))?t:{default:()=>[t]})]}):e(A,null,null),e($,{show:a.showPopoverTime,"onUpdate:show":s=>a.showPopoverTime=s,position:"bottom",style:"{ height: '30%' }"},{default:()=>[e(H,{onCancel:()=>{a.showPopoverTime=!1},onConfirm:F,modelValue:a.currentDate,"onUpdate:modelValue":s=>a.currentDate=s,title:"\u9009\u62E9\u5E74\u6708",minDate:N.value,maxDate:S.value,columnsType:Y.value},null)]}),e(D,{show:a.showPopoverOrchestra,"onUpdate:show":s=>a.showPopoverOrchestra=s,title:"\u9009\u62E9\u4E50\u56E2",actions:a.actions,onSelect:O},null),e(D,{style:{height:"40%"},"close-on-click-action":!0,show:a.showPopoverSubject,"onUpdate:show":s=>a.showPopoverSubject=s,title:"\u9009\u62E9\u58F0\u90E8",actions:a.subjects,onSelect:x},null)])}}});function he(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!E(r)}var ve=_({emits:["setTime"],name:"day-bang",setup(r,{slots:d,attrs:G,emit:T}){R();const a=j({showPopoverTime:!1,showPopoverOrchestra:!1,showPopoverSubject:!1,actions:[],subjects:[],currentDate:[v().format("YYYY"),v().format("MM")]}),o=j({time:a.currentDate[0]+""+a.currentDate[1],timeName:a.currentDate[0]+"\u5E74"+a.currentDate[1]+"\u6708",orchestraId:"",orchestraName:"\u5168\u90E8\u4E50\u56E2",subjectId:"",subjectName:"\u5168\u90E8\u58F0\u90E8",page:1,rows:50,sortType:"PRACTICE_DAY"}),N=n(new Date(v().subtract(5,"year").format("YYYY-MM-DD"))),S=n(new Date(v().add(5,"year").format("YYYY-MM-DD"))),Y=n(["year","month"]),l=n(!1),i=n(!1),p=n(!1),h=n(!1),m=n([]),c=async()=>{i.value=!0;try{l.value&&(o.page=1,m.value=[],l.value=!1);const t=await b.post("/api-school/student/page",{data:{...o}});if(m.value.length>0&&t.data.pages===1)return;o.page=t.data.current+1,m.value=t.data.rows,h.value=m.value.length>0,console.log(h.value," showContact.value "),i.value=!1,p.value=!0}catch(t){const s=t.message;y(s),h.value=!1,p.value=!0}},F=t=>{o.time=t.selectedValues[0]+t.selectedValues[1],o.timeName=t.selectedValues[0]+"\u5E74"+t.selectedValues[1]+"\u6708",a.showPopoverTime=!1,T("setTime",o.timeName),l.value=!0,c()},O=t=>{o.orchestraId=t.value,o.orchestraName=t.name,a.showPopoverOrchestra=!1,l.value=!0,c()},x=t=>{o.subjectId=t.value,o.subjectName=t.name,console.log(t,o),l.value=!0,c()},W=async()=>{const t=q.user.data.schoolInfos.map(s=>s.id).join(",");try{const s=await b.post("/api-school/orchestra/page",{data:{page:1,rows:9999,schoolId:t}});a.actions=s.data.rows.map(u=>({name:u.name,value:u.id})),a.actions.unshift({name:"\u5168\u90E8\u4E50\u56E2",value:""})}catch(s){const u=s.message;y(u)}},C=async()=>{try{const t=await b.post("/api-school/subject/page",{data:{page:1,rows:9999}});a.subjects=t.data.rows.map(s=>({name:s.name,value:s.id})),a.subjects.unshift({name:"\u5168\u90E8\u58F0\u90E8",value:""})}catch(t){const s=t.message;y(s)}};B(()=>{C(),W(),c(),T("setTime",o.timeName)});const I=()=>{p.value=!1,i.value=!0,c()};return()=>{let t;return e(k,null,[e("div",{class:f.chioseWrap},[e("div",{style:{padding:"0 13px",background:"#FFF"}},[e("div",{class:f.searchBand,onClick:()=>{a.showPopoverTime=!0}},[o.timeName,e(w,{name:a.showPopoverTime?"arrow-up":"arrow-down"},null)])]),e("div",{style:{padding:"0 13px",background:"#FFF"}},[e("div",{class:f.searchBand,onClick:()=>{a.showPopoverOrchestra=!0}},[o.orchestraName,e(w,{name:a.showPopoverOrchestra?"arrow-up":"arrow-down"},null)])]),e("div",{style:{padding:"0 13px",background:"#FFF"}},[e("div",{class:f.searchBand,onClick:()=>{a.showPopoverSubject=!0}},[o.subjectName,e(w,{name:a.showPopoverSubject?"arrow-up":"arrow-down"},null)])])]),h.value?e(z,{modelValue:l.value,"onUpdate:modelValue":s=>l.value=s,onRefresh:I},{default:()=>[e(Q,{loading:i.value,"onUpdate:loading":s=>i.value=s,finished:p.value,"finished-text":"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:c},he(t=m.value.map((s,u)=>e(X,{item:s,type:"time",index:u+1},null)))?t:{default:()=>[t]})]}):e(A,null,null),e($,{show:a.showPopoverTime,"onUpdate:show":s=>a.showPopoverTime=s,position:"bottom",style:"{ height: '30%' }"},{default:()=>[e(H,{onCancel:()=>{a.showPopoverTime=!1},onConfirm:F,modelValue:a.currentDate,"onUpdate:modelValue":s=>a.currentDate=s,title:"\u9009\u62E9\u5E74\u6708",minDate:N.value,maxDate:S.value,columnsType:Y.value},null)]}),e(D,{show:a.showPopoverOrchestra,"onUpdate:show":s=>a.showPopoverOrchestra=s,title:"\u9009\u62E9\u4E50\u56E2",actions:a.actions,onSelect:O},null),e(D,{style:{height:"40%"},"close-on-click-action":!0,show:a.showPopoverSubject,"onUpdate:show":s=>a.showPopoverSubject=s,title:"\u9009\u62E9\u58F0\u90E8",actions:a.subjects,onSelect:x},null)])}}});const fe="_topWrap_jr41u_1",ge="_topTime_jr41u_6",we="_rankTabs_jr41u_16";var V={topWrap:fe,topTime:ge,rankTabs:we};const P=n("student"),U=n("");var Fe=_({name:"ranking-list",setup(){R(),j({});const r=d=>{U.value=d};return()=>e(k,null,[e(K,{position:"top",background:"#F8F8F8"},{default:()=>[e("div",{class:V.topWrap},[e(J,{isBack:!0,color:"#ffffff",background:"transparent",border:!1},null),e("span",{class:V.topTime},[U.value])]),e(ee,{active:P.value,"onUpdate:active":d=>P.value=d,class:V.rankTabs,background:"rgba(0,0,0,.35)","title-active-color":"#fff","title-inactive-color":"#fff",color:"#fff"},{default:()=>[e(M,{name:"student",title:"\u5929\u6570\u699C"},{default:()=>[P.value=="student"?e(pe,{onSetTime:d=>r(d)},null):null]}),e(M,{name:"teacher",title:"\u65F6\u957F\u699C"},{default:()=>[P.value=="teacher"?e(ve,{onSetTime:d=>r(d)},null):null]})]})]})])}});export{Fe as default};