1import{c as t,I as Q,_ as D,ah as W,ai as Y,ar as Z,d as M,N as V,H as v,J as E,r as i,o as u,h,w as n,f as b,t as y,i as S,L as O,ac as H,b as R,be as U,aB as I,s as ee,X as te,an as $,A as X,bC as F,cl as ne,bD as J,cc as K,C as w,v as ae,T as oe,az as se,aA as re,e as ce,F as le,p as de,j as ie,l as _e}from"./app-B2Y0-4Oe.js";import{A as ue}from"./AdminPageHeader-D4ZmExHN.js";import{C as me,M as pe}from"./MarkTodayAttendance-BnGqrpmt.js";import"./index-D-LizC8X.js";import{U as ge}from"./UserOutlined-D3NB5Obj.js";import{f as T}from"./filter-D8gtdSsr.js";import"./LogoutOutlined-Bj85gbs-.js";var fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"};function z(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?Object(arguments[s]):{},e=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),e.forEach(function(o){ve(a,o,r[o])})}return a}function ve(a,s,r){return s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}var N=function(s,r){var e=z({},s,r.attrs);return t(Q,z({},e,{icon:fe}),null)};N.displayName="BellOutlined";N.inheritAttrs=!1;const he={components:{CheckOutlined:W,CloseOutlined:Y,BellOutlined:N,DoubleRightOutlined:Z},setup(){const{permsArray:a,dayjs:s,formatTime:r,formatDate:e}=M(),{t:o}=V(),d=v(!1),m=v([]);E(()=>{c()});const c=()=>{d.value=!0,axiosAdmin.get("hrm/dashboard/pending-leaves").then(l=>{m.value=l.data.pending_leaves,d.value=!1})};return{initLoading:d,pendingLeaves:m,permsArray:a,formatDate:e,approveLeave:l=>{H.confirm({title:o("common.approved")+"?",icon:t(R),content:o("common.approved_message"),centered:!0,okText:o("common.yes"),okType:"danger",cancelText:o("common.no"),onOk(){return axiosAdmin.post(`leaves/update-status/${l}`,{status:"approved"}).then(_=>{c(),U.success({message:o("common.success"),description:o("common.status_changed"),placement:"bottomRight"})}).catch(()=>{})},onCancel(){}})},rejectLeave:l=>{H.confirm({title:o("common.rejected")+"?",icon:t(R),content:o("common.rejected_message"),centered:!0,okText:o("common.yes"),okType:"danger",cancelText:o("common.no"),onOk(){return axiosAdmin.post(`leaves/update-status/${l}`,{status:"rejected"}).then(_=>{c(),U.success({message:o("common.success"),description:o("common.status_changed"),placement:"bottomRight"})}).catch(()=>{})},onCancel(){}})}}}},ye={class:"pending-leave-hrm"};function be(a,s,r,e,o,d){const m=i("BellOutlined"),c=I,p=i("CheckOutlined"),g=ee,l=i("CloseOutlined"),_=te,k=$,A=X,C=F,x=ne,j=J,B=K,P=i("perfect-scrollbar"),L=i("DoubleRightOutlined"),q=w;return e.permsArray.includes("admin")||e.permsArray.includes("leaves_approve_reject")?(u(),h(q,{key:0,bodyStyle:{padding:"0px"}},{title:n(()=>[t(m),b(" "+y(a.$t("hrm_dashboard.pening_approvals"))+" ",1),t(c,{count:e.pendingLeaves.length},null,8,["count"])]),extra:n(()=>[t(g,{class:"mt-10",type:"link",onClick:s[0]||(s[0]=f=>a.$router.push({name:"admin.hrm.leaves.index"}))},{default:n(()=>[b(y(a.$t("common.view_all"))+" ",1),t(L)]),_:1})]),default:n(()=>[S("div",ye,[t(P,{options:{wheelSpeed:1,swipeEasing:!0,suppressScrollX:!0}},{default:n(()=>[t(B,{loading:e.initLoading,"item-layout":"horizontal","data-source":e.pendingLeaves},{renderItem:n(({item:f})=>[t(j,null,{extra:n(()=>[t(_,null,{default:n(()=>[f.status=="pending"&&(e.permsArray.includes("admin")||e.permsArray.includes("leaves_approve_reject"))?(u(),h(g,{key:0,onClick:G=>e.approveLeave(f.xid),type:"primary"},{icon:n(()=>[t(p)]),_:2},1032,["onClick"])):O("",!0),f.status=="pending"&&(e.permsArray.includes("admin")||e.permsArray.includes("leaves_approve_reject"))?(u(),h(g,{key:1,onClick:G=>e.rejectLeave(f.xid),type:"primary",danger:""},{icon:n(()=>[t(l)]),_:2},1032,["onClick"])):O("",!0)]),_:2},1024)]),default:n(()=>[t(x,{avatar:"",title:!1,loading:!!f.loading,active:""},{default:n(()=>[t(C,{description:f.reason},{title:n(()=>[t(k,{strong:""},{default:n(()=>[b(y(f.user.name),1)]),_:2},1024),b(" ("+y(e.formatDate(f.start_date))+" - "+y(e.formatDate(f.end_date))+") ",1)]),avatar:n(()=>[t(A,{src:f.user.profile_image_url},null,8,["src"])]),_:2},1032,["description"])]),_:2},1032,["loading"])]),_:2},1024)]),_:1},8,["loading","data-source"])]),_:1})])]),_:1})):O("",!0)}const ke=D(he,[["render",be]]),Ce={components:{UserOutlined:ge,CoffeeOutlined:me},setup(){const{permsArray:a,dayjs:s,formatTime:r,formatDate:e}=M();V();const o=v(!1),d=v([]),m=v("not_marked"),c=v(!1),p=v({}),g=v([]),l=v(0),_=v(0),k=v(0);E(()=>{A()});const A=()=>{o.value=!0,axiosAdmin.get("hrm/dashboard/today-attendance-users").then(x=>{d.value=x.data.users,p.value=x.data.holiday,c.value=x.data.is_holiday,l.value=T(d.value,{status:"not_marked"}).length,_.value=T(d.value,{status:"present"}).length,k.value=T(d.value,{status:"absent"}).length,C()})},C=()=>{o.value=!0,g.value=T(d.value,{status:m.value}),o.value=!1};return{attendanceStatus:m,initLoading:o,permsArray:a,formatDate:e,isHoliday:c,allUsers:d,holiday:p,filteredUsers:g,attendanceStatusChanged:C,totalNotMarked:l,totalPresent:_,totalAbsent:k}}},Oe={class:"today-attendance-status-hrm"};function Ae(a,s,r,e,o,d){const m=i("UserOutlined"),c=I,p=ae,g=oe,l=i("CoffeeOutlined"),_=se,k=$,A=X,C=F,x=J,j=K,B=i("perfect-scrollbar"),P=w;return u(),h(P,{bodyStyle:{padding:"0px"}},{title:n(()=>[t(m),b(" "+y(a.$t("hrm_dashboard.today_attendance")),1)]),extra:n(()=>[!e.isHoliday&&!e.initLoading?(u(),h(g,{key:0,activeKey:e.attendanceStatus,"onUpdate:activeKey":s[0]||(s[0]=L=>e.attendanceStatus=L),onChange:e.attendanceStatusChanged,size:"small"},{default:n(()=>[t(p,{key:"not_marked"},{tab:n(()=>[b(y(a.$t("hrm_dashboard.not_marked"))+" ",1),e.totalNotMarked>0?(u(),h(c,{key:0,"number-style":{backgroundColor:"#13c2c2"},count:e.totalNotMarked},null,8,["count"])):O("",!0)]),_:1}),t(p,{key:"present"},{tab:n(()=>[b(y(a.$t("hrm_dashboard.present"))+" ",1),e.totalPresent>0?(u(),h(c,{key:0,"number-style":{backgroundColor:"#52c41a"},count:e.totalPresent},null,8,["count"])):O("",!0)]),_:1}),t(p,{key:"absent"},{tab:n(()=>[b(y(a.$t("hrm_dashboard.absent"))+" ",1),e.totalAbsent>0?(u(),h(c,{key:0,count:e.totalAbsent},null,8,["count"])):O("",!0)]),_:1})]),_:1},8,["activeKey","onChange"])):O("",!0)]),default:n(()=>[S("div",Oe,[t(B,{options:{wheelSpeed:1,swipeEasing:!0,suppressScrollX:!0}},{default:n(()=>[e.isHoliday&&!e.initLoading?(u(),h(_,{key:0,title:a.$t("hrm_dashboard.today_is_holiday")},{icon:n(()=>[t(l)]),_:1},8,["title"])):(u(),h(j,{key:1,loading:e.initLoading,"item-layout":"horizontal","data-source":e.filteredUsers},{renderItem:n(({item:L})=>[t(x,null,{default:n(()=>[t(C,{description:L.reason},{title:n(()=>[t(k,{strong:""},{default:n(()=>[b(y(L.name),1)]),_:2},1024)]),avatar:n(()=>[t(A,{src:L.profile_image_url},null,8,["src"])]),_:2},1032,["description"])]),_:2},1024)]),_:1},8,["loading","data-source"]))]),_:1})])]),_:1})}const xe=D(Ce,[["render",Ae]]),Le={components:{ClockCircleOutlined:re,AdminPageHeader:ue,MarkTodayAttendance:pe,PedningLeaves:ke,TodayAttendance:xe},setup(){const{permsArray:a}=M();return{permsArray:a}}},Se={class:"dashboard-page-content-container"},Te={class:"mt-30 mb-20"},je={class:"mb-20"};function Be(a,s,r,e,o,d){const m=ie,c=i("AdminPageHeader"),p=i("ClockCircleOutlined"),g=i("MarkTodayAttendance"),l=w,_=_e,k=de,A=i("PedningLeaves"),C=i("TodayAttendance");return u(),ce(le,null,[t(c,null,{header:n(()=>
1[t(m,{title:a.$t("menu.dashboard"),class:"p-0"},null,8,["title"])]),_:1}),S("div",Se,[S("div",Te,[S("div",je,[t(k,{gutter:[15,15]},{default:n(()=>[t(_,{xs:24,sm:24,md:24,lg:24,xl:24},{default:n(()=>[t(l,null,{title:n(()=>[t(p),b(" "+y(a.$t("hrm_dashboard.today_attendance")),1)]),default:n(()=>[t(g)]),_:1})]),_:1})]),_:1})]),t(k,{class:"mb-20",gutter:[15,15]},{default:n(()=>[e.permsArray.includes("admin")||e.permsArray.includes("leaves_approve_reject")?(u(),h(_,{key:0,xs:24,sm:24,md:24,lg:12,xl:12},{default:n(()=>[t(A)]),_:1})):O("",!0),t(_,{xs:24,sm:24,md:24,lg:12,xl:12},{default:n(()=>[t(C)]),_:1})]),_:1})])])],64)}const Ue=D(Le,[["render",Be]]);export{Ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.