import{h as F,c as X,_ as Z}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{a1 as ee}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as te,r as _,c as ae,m as ne,al as E,ar as se,z as f,A as h,M as y,B as n,R as u,J as r,P as g,Q as x,a4 as W,D as le,K as oe,I as R}from"./vendor-866bb149-1782572373740v=1.0.0.js";const ue=v=>F.get("/javaPpoEventactivity/event/getEventStat",v,{headers:{noLoading:!0}}),re=v=>F.get("/javaPpoEventactivity/event/getEventCalendarCurrentWeeksDTO",v,{headers:{noLoading:!0}}),ce=v=>F.get(`/javaPpoEventactivity/event/getEventCalendarCurrentWeeksDTO/${v.weekOffset}`,v,{headers:{noLoading:!0}}),ie=v=>F.post("/javaPpoEventactivity/event/getEventCalendarEventList",v,{headers:{noLoading:!0}}),de={class:"home-container"},ve={class:"stat-cards"},pe={class:"stat-card purple"},_e={class:"stat-value"},fe={class:"stat-card blue"},me={class:"stat-value"},Ee={class:"stat-card orange"},ge={class:"stat-value"},ke={class:"week-cards-container"},we={class:"week-cards-wrapper"},De={class:"week-cards"},he=["onClick"],ye={class:"week-date flx-center"},Ce={class:"week-stats"},Se={class:"calendar-container"},Ae={class:"filter-buttons"},Fe={class:"calendar-table"},be=["onClick"],Be={key:0,class:"event-status"},Oe={class:"event-name"},Te=te({__name:"index",props:{info:{default:{}}},emits:[],setup(v,{emit:Le}){const V=(t,e)=>{const a=t.split(" ")[0].split("-"),i=e.split(" ")[0].split("-");return`${a[1]}.${a[2]}\u2014${i[1]}.${i[2]}`},S=_({todayEventApplyNum:0,totalEventApplyNum:0,totalEventNum:0}),k=_([]),C=_(0),p=_(new Map),M=_([]);_("\u5168\u90E8");const P=({row:t,column:e,rowIndex:a,columnIndex:i})=>{var o;if((o=e.label)!=null&&o.includes("\u4ECA\u5929"))return{color:"#409EFF",backgroundColor:"#ecf5ff"}},Y=async()=>{try{const t=await ue();t.data&&(S.value=t.data)}catch(t){console.error("\u83B7\u53D6\u7EDF\u8BA1\u6570\u636E\u5931\u8D25:",t)}},q=async()=>{try{const t=await re();t.data&&Array.isArray(t.data)&&(t.data.forEach(e=>{p.value.set(e.weekOffset,e)}),k.value=t.data.sort((e,a)=>e.weekOffset-a.weekOffset),k.value.length>0&&(C.value=k.value[0].weekOffset))}catch(t){console.error("\u83B7\u53D6\u5F53\u524D\u5468\u6570\u636E\u5931\u8D25:",t)}},$=async t=>{try{const e=await ce({weekOffset:t});e.data&&(p.value.set(t,e.data),b())}catch(e){console.error(`\u83B7\u53D6\u7B2C${t}\u5468\u6570\u636E\u5931\u8D25:`,e)}},b=()=>{const t=[];for(let e=c.value.start;e<=c.value.end;e++){const a=p.value.get(e);a&&t.push(a)}k.value=t.sort((e,a)=>e.weekOffset-a.weekOffset)},z=async t=>{C.value=t,await O(t)},B=_(!1),A=_(""),O=async t=>{const e=p.value.get(t);if(B.value=!0,!!e)try{const a=await ie({startTime:e.weekStartEndDTO.startTime,endTime:e.weekStartEndDTO.endTime,eventStatus:A.value});if(a.data&&Array.isArray(a.data)){const i=a.data.reduce((l,m)=>Math.max(l,m.eventCalendarEventList.length),0);let o=[];for(let l=0;l<i;l++){let m={};for(let w=0;w<a.data.length;w++){const D=a.data[w];m[D.time]=D.eventCalendarEventList[l]}o.push(m)}M.value=o}}catch(a){console.error("\u83B7\u53D6\u8D5B\u4E8B\u65E5\u5386\u6570\u636E\u5931\u8D25:",a)}finally{B.value=!1}},H=t=>{A.value=t,O(C.value)},J=t=>{X.push({path:"/gamesModule/eventMgmt/eventList/index",query:{eventId:t.eventId,eventName:t.name}})},K=ae(()=>{const t=p.value.get(C.value);if(!t)return[];const e=new Date(t.weekStartEndDTO.startTime.split(" ")[0]),a=[],i=["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"];for(let o=0;o<7;o++){const l=new Date(e);l.setDate(e.getDate()+o);const m=(l.getMonth()+1).toString().padStart(2,"0"),w=l.getDate().toString().padStart(2,"0");let D=i[l.getDay()];l.toISOString().split("T")[0]===new Date().toISOString().split("T")[0]&&(D="\u4ECA\u5929");const T=ee(l).format("YYYY-MM-DD");a.push({prop:`${T}`,label:`${D}
${m}\u6708${w}\u65E5`,date:l.toISOString().split("T")[0]})}return a}),c=_({start:0,end:3}),Q=async()=>{p.value,c.value;const t=c.value.start-1,e=c.value.end-1;p.value.has(t)||await $(t),c.value.start=t,c.value.end=e,b();const a=document.querySelector(".week-cards");a&&setTimeout(()=>{a.scrollTo({left:0})},100)},U=async()=>{const t=c.value.end+1;p.value,c.value,p.value.has(t)||await $(t),c.value.start+=1,c.value.end=t,b();const e=document.querySelector(".week-cards");e&&setTimeout(()=>{e.scrollTo({left:e.scrollWidth})},100)};return ne(async()=>{Y(),await q(),k.value.length>0&&await O(k.value[0].weekOffset)}),(t,e)=>{const a=E("el-col"),i=E("el-row"),o=E("el-radio-button"),l=E("el-radio-group"),m=E("el-tooltip"),w=E("el-table-column"),D=E("el-table"),T=E("el-card"),G=se("loading");return f(),h("div",de,[y(" \u9876\u90E8\u4E09\u680F\u7EDF\u8BA1\u6A21\u5757 "),n("div",ve,[u(i,{gutter:20},{default:r(()=>[u(a,{span:8},{default:r(()=>[n("div",pe,[e[1]||(e[1]=n("div",{class:"stat-title"},"\u4ECA\u65E5\u62A5\u540D\u4EBA\u6B21",-1)),n("div",_e,g(S.value.todayEventApplyNum||0)+"\u4EBA\u6B21",1)])]),_:1}),u(a,{span:8},{default:r(()=>[n("div",fe,[e[2]||(e[2]=n("div",{class:"stat-title"},"\u7D2F\u8BA1\u62A5\u540D\u4EBA\u6B21",-1)),n("div",me,g(S.value.totalEventApplyNum||0)+"\u4EBA\u6B21",1)])]),_:1}),u(a,{span:8},{default:r(()=>[n("div",Ee,[e[3]||(e[3]=n("div",{class:"stat-title"},"\u7D2F\u8BA1\u6D3B\u52A8\u6570\u91CF",-1)),n("div",ge,g(S.value.totalEventNum||0)+"\u4E2A",1)])]),_:1})]),_:1})]),u(T,null,{default:r(()=>[y(" \u4E2D\u95F4\u6309\u5468\u6570\u5C55\u793A\u7684\u6ED1\u52A8\u5361\u7247\u7EC4 "),n("div",ke,[y(" {{ currentWeekRange }} "),n("div",we,[u(i,null,{default:r(()=>[u(a,{span:1,class:"flx-center"},{default:r(()=>[n("div",{class:"slide-arrow left",onClick:Q},e[4]||(e[4]=[n("span",null,"\u2190",-1)]))]),_:1}),u(a,{span:22},{default:r(()=>[n("div",De,[y(" {{ weekList.length }} "),(f(!0),h(x,null,W(k.value,s=>(f(),h("div",{key:s.weekOffset,class:le(["week-card",{active:C.value===s.weekOffset}]),onClick:d=>z(s.weekOffset)},[n("div",ye,g(V(s.weekStartEndDTO.startTime,s.weekStartEndDTO.endTime)),1),n("div",Ce,[(f(!0),h(x,null,W(s.eventCalendarCurrentWeeksPOList,d=>(f(),h("span",{key:d.eventStatus,class:"stat-item"},g(d.eventStatusCn)+": "+g(d.num)+"\u4E2A ",1))),128))])],10,he))),128))])]),_:1}),u(a,{span:1,class:"flx-center"},{default:r(()=>[n("div",{class:"slide-arrow right",onClick:U},e[5]||(e[5]=[n("span",null,"\u2192",-1)]))]),_:1})]),_:1})])]),y(" \u5E95\u90E8\u65E5\u5386\u90E8\u5206 "),n("div",Se,[n("div",Ae,[u(l,{modelValue:A.value,"onUpdate:modelValue":e[0]||(e[0]=s=>A.value=s),size:"large",onChange:H},{default:r(()=>[u(o,{label:"\u5168\u90E8",value:""}),u(o,{label:"\u62A5\u540D\u4E2D",value:"applying"}),u(o,{label:"\u8FDB\u884C\u4E2D",value:"run"})]),_:1},8,["modelValue"])]),n("div",Fe,[oe((f(),R(D,{data:M.value,style:{width:"100%"},border:"","header-cell-style":P},{default:r(()=>[y(` <el-table-column prop="time" label="\u661F\u671F" width="80">\r
					<template #default="scope">\r
							<div class="weekday-label">\r
								{{ getWeekdayLabel(scope.row.time) }}\r
							</div>\r
						</template>\r
					</el-table-column> `),(f(!0),h(x,null,W(K.value,s=>(f(),R(w,{key:s.prop,prop:s.prop,label:s.label,align:"center"},{default:r(d=>{var I,N,j;return[n("div",{class:"event-item",onClick:L=>J(d.row[s.prop])},[(I=d.row[s.prop])!=null&&I.eventStatusCn?(f(),h("div",Be,g((N=d.row[s.prop])==null?void 0:N.eventStatusCn),1)):y("v-if",!0),u(m,{class:"box-item",effect:"dark",content:(j=d.row[s.prop])==null?void 0:j.name,placement:"top-start"},{default:r(()=>{var L;return[n("div",Oe,g((L=d.row[s.prop])==null?void 0:L.name),1)]}),_:2},1032,["content"])],8,be)]}),_:2},1032,["prop","label"]))),128))]),_:1},8,["data"])),[[G,B.value]])])])]),_:1})])}}});const $e=Z(Te,[["__scopeId","data-v-0546dae1"]]);export{$e as default};
