import{d as e,e as a,r as t,T as s,aa as l,f as n,g as r,o,h as d,w as i,i as c,a as u,cM as f,j as p,t as g,k as m,l as _,F as h,N as v,x as y,aU as b,z as x,bl as $,a8 as j,O as k,d3 as F,P as S}from"./index-Cg3FU-dV.js";import{_ as Y}from"./uni-nav-bar.BXgu2eq7.js";import{_ as w}from"./empty06.CJM5YkYo.js";import{B as C}from"./index.C_aYDizf.js";import{h as M}from"./moment.BD7_iMEL.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.D_sy4NxH.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */const R=D(e({__name:"schedule",setup(e,{expose:D}){const R=a({list:[],count:0,loaded:!1,loading:!1,monthRange:"考勤时间"}),A=a({refreshFlag:!1,page:1,limit:10,name:"",time:""}),L=(new Date).getFullYear(),z=(new Date).getMonth()+1,N=t([10,z-1,10,z-1]),B=(()=>{const e=L-10,a=L+10;return Array.from({length:a-e+1},((a,t)=>e+t))})(),G=Array.from({length:12},((e,a)=>a+1)),H=[B,G,B,G],I=e=>{e=e.replace(/-/g,"/");const a=new Date(e);return`${a.getFullYear()}年${(a.getMonth()+1).toString().padStart(2,"0")}月`},O=e=>{const[a,t,s,l]=e.detail.value;if(s<a||s===a&&l<t)return y.error("结束时间不能小于开始时间","none"),void(N.value=[...N.value]);N.value=[a,t,s,l];const n=B[a],r=G[t],o=B[s],d=G[l];R.monthRange=`${n-2e3}年${r}月-${o-2e3}年${d}月`,A.time=`${n}/${r.toString().padStart(2,"0")}-${o}/${d.toString().padStart(2,"0")}`,A.page=1,R.loaded=!1},P=()=>{b({url:"/pages/attendance/scheduleAdd"})},Q=e=>{R.loaded=!1,A.page=1,A.name=e.detail.value};return D({refreshList:()=>{R.loaded=!1,A.page=1,A.refreshFlag=!A.refreshFlag}}),s(A,(()=>{(async()=>{if(R.loading||R.loaded)return;R.loading=!0;const{refreshFlag:e,...a}=A,t=await F(a);R.count=t.data.count,1===A.page?R.list=t.data.list:R.list=[...R.list,...t.data.list],R.loaded=t.data.list.length<A.limit,R.loading=!1})()}),{immediate:!0}),l((()=>{R.loaded||R.loading||A.page++})),(e,a)=>{const t=n(r("uni-nav-bar"),Y),s=x,l=$,y=j,b=k,F=S;return o(),d(s,{class:"main"},{default:i((()=>[c(s,{class:"header-fixed"},{default:i((()=>[c(t,{"background-color":"transparent",border:!1,"status-bar":"","left-icon":"left",title:"排班管理",onClickLeft:u(f),dark:"",class:"custom-nav-bar","right-icon":"plusempty",onClickRight:P},null,8,["onClickLeft"]),c(s,{class:"search-bar"},{default:i((()=>[c(s,{class:"search-bar-body"},{default:i((()=>[c(s,{class:"iconfont icon-sousuo"}),c(l,{type:"text",placeholder:"请输入考勤组名称","placeholder-class":"placeholder",onConfirm:Q})])),_:1})])),_:1}),c(y,{mode:"multiSelector",value:u(N),class:"date-picker-content",range:H,onChange:O},{default:i((()=>[c(s,{class:"month-range"},{default:i((()=>[p(g(u(R).monthRange)+" ",1),c(s,{class:"iconfont icon-zhankai1"})])),_:1})])),_:1},8,["value"])])),_:1}),c(s,{class:"schedule-list"},{default:i((()=>[(o(!0),m(h,null,_(u(R).list,(e=>{return o(),d(F,{class:"schedule-item",key:e.id,url:`/pages/attendance/scheduleDetail?group_id=${e.group_id}&date=${a=e.date,M(a).format("YYYY-MM")}`,"hover-class":"none"},{default:i((()=>[c(s,{class:"schedule-title"},{default:i((()=>[p(g(I(e.date))+"排班表",1)])),_:2},1024),c(s,{class:"schedule-info"},{default:i((()=>[c(s,{class:"schuedling-info-label"},{default:i((()=>[p("考勤组名")])),_:1}),c(s,{class:"schuedling-info-value"},{default:i((()=>[p(g(e.group.name),1)])),_:2},1024)])),_:2},1024),c(s,{class:"schedule-info"},{default:i((()=>[c(s,{class:"schuedling-info-label"},{default:i((()=>[p("考勤成员")])),_:1}),c(s,{class:"schuedling-info-value flex"},{default:i((()=>[c(s,{class:"over-text avatar-list flex"},{default:i((()=>[(o(!0),m(h,null,_(e.group.members,(e=>(o(),d(b,{key:e.id,src:e.avatar,class:"member-avatar"},null,8,["src"])))),128))])),_:2},1024),c(s,{class:"member-count"},{default:i((()=>[p("等"+g(e.group.members.length)+"人",1)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["url"]);var a})),128))])),_:1}),0===u(R).list.length?(o(),d(s,{key:0,class:"empty-container"},{default:i((()=>[c(b,{src:w,mode:"aspectFit"}),c(s,{class:"empty-text"},{default:i((()=>[p("暂无排班信息~")])),_:1})])),_:1})):v("",!0),c(C,{type:4,"page-path":"/pages/attendance/schedule"})])),_:1})}}}),[["__scopeId","data-v-390ca261"]]);export{R as default};
