UNPKG

@cpany/app

Version:
2 lines (1 loc) 5.86 kB
import{I as D}from"./account-Cn5wceoV.js";import{m as v,o as _,c as r,a as e,d as F,t as l,r as B,b as A,u as x,e as C,f as k,g as E,h as s,w as n,i as t,j as y,k as a,l as M,n as T,p as $,q as L,s as Q,v as z}from"./index-DQ3P2Jm7.js";import{C as i,a as g}from"./c-table-BNgV5wWB.js";import{_ as w}from"./user-link-C8lYDapJ.js";const S={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},V=e("path",{fill:"currentColor",d:"M6.5 20q-2.28 0-3.89-1.57Q1 16.85 1 14.58q0-1.95 1.17-3.48q1.18-1.53 3.08-1.95q.63-2.3 2.5-3.72Q9.63 4 12 4q2.93 0 4.96 2.04Q19 8.07 19 11q1.73.2 2.86 1.5q1.14 1.28 1.14 3q0 1.88-1.31 3.19T18.5 20m-12-2h12q1.05 0 1.77-.73q.73-.72.73-1.77t-.73-1.77Q19.55 13 18.5 13H17v-2q0-2.07-1.46-3.54Q14.08 6 12 6Q9.93 6 8.46 7.46Q7 8.93 7 11h-.5q-1.45 0-2.47 1.03Q3 13.05 3 14.5T4.03 17q1.02 1 2.47 1m5.5-6"},null,-1),H=[V];function I(h,u){return _(),r("svg",S,H)}const N=v({name:"mdi-cloud-outline",render:I}),j={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},O=e("path",{fill:"currentColor",d:"M13.16 12.74L14 14h-1.5c-.15 2.71-.5 5.41-1 8.08l-1-.16c.5-2.62.84-5.26 1-7.92H10l.84-1.26C8.64 11.79 7 8.36 7 6a5 5 0 0 1 5-5a5 5 0 0 1 5 5c0 2.36-1.64 5.79-3.84 6.74"},null,-1),R=[O];function U(h,u){return _(),r("svg",j,R)}const G=v({name:"mdi-balloon",render:U}),J={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},K=e("path",{fill:"currentColor",d:"M20 11h3v2h-3zM1 11h3v2H1zM13 1v3h-2V1zM4.92 3.5l2.13 2.14l-1.42 1.41L3.5 4.93zm12.03 2.13l2.12-2.13l1.43 1.43l-2.13 2.12zM12 6a6 6 0 0 1 6 6c0 2.22-1.21 4.16-3 5.2V19a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-1.8c-1.79-1.04-3-2.98-3-5.2a6 6 0 0 1 6-6m2 15v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-1zm-3-3h2v-2.13c1.73-.44 3-2.01 3-3.87a4 4 0 0 0-4-4a4 4 0 0 0-4 4c0 1.86 1.27 3.43 3 3.87z"},null,-1),P=[K];function W(h,u){return _(),r("svg",J,P)}const X=v({name:"mdi-lightbulb-on-outline",render:W}),Y={class:"text-gray-400 text-sm mb-1"},Z={class:"flex items-center py-2 text-xl"},tt={class:"inline-block text-2xl ml-1"},f=F({__name:"c-stastic",props:{title:null},setup(h){return(u,b)=>(_(),r("div",null,[e("p",Y,l(h.title),1),e("p",Z,[B(u.$slots,"prefix",{class:"text-2xl"}),e("span",tt,[B(u.$slots,"default")])])]))}}),et={class:"flex <lg:flex-col-reverse"},st={class:"lg:w-3/5 <lg:w-full"},nt={class:"box divide-y"},lt=e("h3",{class:"mb-4"},"最近比赛",-1),ot={key:0},at={class:"flex flex-1 items-center justify-center"},it=a(" "),ut=e("div",{class:"my-4 px-3"},"好像都大家没有参加比赛?",-1),ct={class:"text-right <md:mt-4 pt-2"},dt=a("→ 更多比赛"),_t={class:"lg:w-2/5 <lg:w-full"},rt={class:"lg:ml-4 <lg:mb-4"},ht={class:"box divide-y"},mt={class:"mb-4"},ft={key:0},pt=a("总览 "),xt={class:"py-4 md:flex md:items-center md:justify-around <md:grid <md:grid-cols-2"},gt={class:"text-right pt-2"},vt=a("→ 历史"),bt={class:"box mt-4 divide-y"},Dt={class:"font-600"},Bt={class:"text-right pt-2"},Ct=a("→ 更多"),yt={class:"box mt-4 divide-y"},$t={class:"font-600"},wt={class:"text-right pt-2"},Ft=a("→ 更多"),Mt=F({__name:"Home",setup(h){const u=" "+(A/86400).toFixed(0)+" 天",b=x.sort((c,m)=>m.submissions.length-c.submissions.length).slice(0,C),q=x.map(c=>({contestsLength:c.contests.filter(({t:d})=>d>=k).length,...c})).sort((c,m)=>m.contestsLength-c.contestsLength).slice(0,C);return(c,m)=>{const d=E("router-link");return _(),r("div",et,[e("div",st,[e("div",nt,[lt,s(t(g),{data:t(T),class:"pt-2"},{columns:n(({row:o})=>[s(t(i),{label:"比赛","mobile-header-class":["min-w-8"]},{default:n(()=>[s(d,{to:o.path},{default:n(()=>[a(l(o.name),1)]),_:2},1032,["to"])]),_:2},1024),s(t(i),{label:"时间",align:"center",width:"10em"},{default:n(()=>[o.startTime?(_(),r("span",ot,l(t(M)(o.startTime).value),1)):y("",!0)]),_:2},1024),s(t(i),{label:"人数",align:"center",width:"5em"},{default:n(()=>[e("div",at,[s(t(D)),it,e("span",null,"x "+l(o.participantNumber),1)])]),_:2},1024)]),empty:n(()=>[ut]),_:1},8,["data"]),e("div",ct,[s(d,{to:{name:"Contests"},class:"text-gray-400 font-thin hover:underline"},{default:n(()=>[dt]),_:1})])])]),e("div",_t,[e("div",rt,[e("div",ht,[e("h3",mt,[t($)!==""?(_(),r("span",ft,l(t($))+" ",1)):y("",!0),pt]),e("div",xt,[s(t(f),{title:"用户"},{prefix:n(()=>[s(t(D))]),default:n(()=>[a(l(t(x).length),1)]),_:1}),s(t(f),{title:"参与比赛"},{prefix:n(()=>[s(t(N),{class:"text-blue-400"})]),default:n(()=>[a(l(t(L)),1)]),_:1}),s(t(f),{title:"提交"},{prefix:n(()=>[s(t(X),{class:"text-yellow-400"})]),default:n(()=>[a(l(t(Q)),1)]),_:1}),s(t(f),{title:"正确提交"},{prefix:n(()=>[s(t(G),{class:"text-red-400"})]),default:n(()=>[a(l(t(z)),1)]),_:1})]),e("div",gt,[s(d,{to:{name:"History"},class:"text-gray-400 font-thin hover:underline"},{default:n(()=>[vt]),_:1})])]),e("div",bt,[e("h3",{class:"mb-4"},"最近"+l(u)+"用户提交数"),s(t(g),{data:t(b),mobile:0},{columns:n(({row:o,index:p})=>[s(t(i),{label:"#",width:"2em",align:"center"},{default:n(()=>[e("span",Dt,l(p+1),1)]),_:2},1024),s(t(i),{label:"姓名"},{default:n(()=>[s(w,{name:o.name},null,8,["name"])]),_:2},1024),s(t(i),{label:"提交数",width:"6em",align:"center"},{default:n(()=>[e("span",null,l(o.submissions.length),1)]),_:2},1024)]),_:1},8,["data"]),e("div",Bt,[s(d,{to:{name:"Members"},class:"text-gray-400 font-thin hover:underline"},{default:n(()=>[Ct]),_:1})])]),e("div",yt,[e("h3",{class:"mb-4"},"最近"+l(u)+"用户比赛数"),s(t(g),{data:t(q),mobile:0},{columns:n(({row:o,index:p})=>[s(t(i),{label:"#",width:"2em",align:"center"},{default:n(()=>[e("span",$t,l(p+1),1)]),_:2},1024),s(t(i),{label:"姓名"},{default:n(()=>[s(w,{name:o.name},null,8,["name"])]),_:2},1024),s(t(i),{label:"比赛数",width:"6em",align:"center"},{default:n(()=>[e("span",null,l(o.contestsLength),1)]),_:2},1024)]),_:1},8,["data"]),e("div",wt,[s(d,{to:{name:"Members"},class:"text-gray-400 font-thin hover:underline"},{default:n(()=>[Ft]),_:1})])])])])])}}});export{Mt as default};