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,cL 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,d2 as F,P as S}from"./index-B3cqKsI_.js";import{_ as Y}from"./uni-nav-bar.xE5Um1Eb.js";import{_ as w}from"./empty06.CJM5YkYo.js";import{B as C}from"./index.0khhkIFD.js";import{h as D}from"./moment.BD7_iMEL.js";import{_ as L}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.EqO7jntL.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */const M=L(e({__name:"schedule",setup(e,{expose:L}){const M=a({list:[],count:0,loaded:!1,loading:!1,monthRange:"考勤时间"}),R=a({refreshFlag:!1,page:1,limit:10,name:"",time:""}),A=(new Date).getFullYear(),z=(new Date).getMonth()+1,N=t([10,z-1,10,z-1]),B=(()=>{const e=A-10,a=A+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];M.monthRange=`${n-2e3}年${r}月-${o-2e3}年${d}月`,R.time=`${n}/${r.toString().padStart(2,"0")}-${o}/${d.toString().padStart(2,"0")}`,R.page=1,M.loaded=!1},P=()=>{b({url:"/pages/attendance/scheduleAdd"})},Q=e=>{M.loaded=!1,R.page=1,R.name=e.detail.value};return L({refreshList:()=>{M.loaded=!1,R.page=1,R.refreshFlag=!R.refreshFlag}}),s(R,(()=>{(async()=>{if(M.loading||M.loaded)return;M.loading=!0;const{refreshFlag:e,...a}=R,t=await F(a);M.count=t.data.count,1===R.page?M.list=t.data.list:M.list=[...M.list,...t.data.list],M.loaded=t.data.list.length<R.limit,M.loading=!1})()}),{immediate:!0}),l((()=>{M.loaded||M.loading||R.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(M).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(M).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,D(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(M).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{M as default};
