import{_ as D,Z as U,am as I,aq as O,b as V,r as c,a as j,E as z,e as p,o as _,g as M,c as t,w as a,F as S,v as H,i,t as s,f as N,J as Y,h as F,j as T,az as q,aD as J,aE as Z,n as G,av as K,a3 as Q,ap as R,aw as W,a2 as X}from"./app-DGDivIsO.js";import{h as $}from"./hrmManagement-D0HQaQoD.js";import{A as ee}from"./AdminPageHeader-ff2SFNbk.js";import{L as ae}from"./LeaveSidebar-C6MprMg5.js";import"./index-C2QBqMxH.js";import"./ScheduleOutlined-CPLAH6Jp.js";import"./TabletOutlined-_Dgsj8rS.js";import"./FundViewOutlined-DW7vHq2q.js";import"./UnderlineOutlined-HUHvwWYl.js";const te={components:{PlusOutlined:U,EditOutlined:I,DeleteOutlined:O,AdminPageHeader:ee,LeaveSidebar:ae},setup(){const{t:o}=V(),{getMonthNameByNumber:d}=$(),w=[{title:o("leave.leave_type"),dataIndex:"name"},{title:o("menu.unpaid_leaves"),dataIndex:"unpaid_leaves"}],e=c([]),f=c(!0),{dayjs:E,user:b,permsArray:x}=j(),r=c({year:E(),user_id:void 0}),g=c([]),h=c([]),k="users?limit=10000";z(()=>{const u=axiosAdmin.get(k);Promise.all([u]).then(([m])=>{h.value=m.data,r.value={...r.value,user_id:b.value.xid},l()})});const l=()=>{f.value=!0;var u=r.value.year.format("YYYY");axiosAdmin.get(`leaves/unpaid-leaves?year=${u}&user_id=${r.value.user_id}`).then(m=>{e.value=m.data.data,g.value=m.data.month_year,f.value=!1})};return{columns:w,unpaidLeaves:e,filters:r,getMonthNameByNumber:d,selectedYearStartEndMonths:g,tableLoading:f,setUrlData:l,allUsers:h,permsArray:x}}},ne={class:"table-responsive"};function oe(o,d,w,e,f,E){const b=q,x=p("router-link"),r=J,g=Z,h=p("AdminPageHeader"),k=p("LeaveSidebar"),l=G,u=K,m=X,A=Q,B=R,v=H,C=p("admin-page-filters"),L=W,P=p("admin-page-table-content");return _(),M(S,null,[t(h,null,{header:a(()=>[t(b,{title:o.$t("menu.leave_types"),class:"p-0"},null,8,["title"])]),breadcrumb:a(()=>[t(g,{separator:"-",style:{"font-size":"12px"}},{default:a(()=>[t(r,null,{default:a(()=>[t(x,{to:{name:"admin.dashboard.index"}},{default:a(()=>[i(s(o.$t("menu.dashboard")),1)]),_:1})]),_:1}),t(r,null,{default:a(()=>[i(s(o.$t("menu.hrm")),1)]),_:1}),t(r,null,{default:a(()=>[i(s(o.$t("menu.unpaid_leaves")),1)]),_:1})]),_:1})]),_:1}),t(v,null,{default:a(()=>[t(l,{xs:24,sm:24,md:24,lg:4,xl:4,class:"bg-setting-sidebar"},{default:a(()=>[t(k)]),_:1}),t(l,{xs:24,sm:24,md:24,lg:20,xl:20},{default:a(()=>[t(C,null,{default:a(()=>[t(v,{gutter:[16,16],align:"middle"},{default:a(()=>[t(l,{xs:24,sm:24,md:12,lg:10,xl:10},{default:a(()=>[e.selectedYearStartEndMonths&&e.selectedYearStartEndMonths.start_month?(_(),N(u,{key:0,strong:""},{default:a(()=>[i(s(e.getMonthNameByNumber(e.selectedYearStartEndMonths.start_month))+" "+s(e.selectedYearStartEndMonths.start_year)+" - "+s(e.getMonthNameByNumber(e.selectedYearStartEndMonths.end_month))+" "+s(e.selectedYearStartEndMonths.end_year),1)]),_:1})):Y("",!0)]),_:1}),t(l,{xs:24,sm:24,md:12,lg:14,xl:14},{default:a(()=>[t(v,{gutter:[16,16],justify:"end"},{default:a(()=>[e.permsArray.includes("admin")||e.permsArray.includes("leaves_assign_to_all")?(_(),N(l,{key:0,xs:24,sm:24,md:12,lg:6,xl:6},{default:a(()=>[t(A,{value:e.filters.user_id,"onUpdate:value":d[0]||(d[0]=n=>e.filters.user_id=n),onChange:e.setUrlData,"show-search":"",style:{width:"100%"},placeholder:o.$t("common.select_default_text",[o.$t("leave.user")])},{default:a(()=>[(_(!0),M(S,null,F(e.allUsers,n=>(_(),N(m,{key:n.xid,value:n.xid,title:n.name},{default:a(()=>[i(s(n.name),1)]),_:2},1032,["value","title"]))),128))]),_:1},8,["value","onChange","placeholder"])]),_:1})):Y("",!0),t(l,{xs:24,sm:24,md:12,lg:12,xl:8},{default:a(()=>[t(B,{value:e.filters.year,"onUpdate:value":d[1]||(d[1]=n=>e.filters.year=n),placeholder:o.$t("common.select_default_text",[o.$t("holiday.year")]),picker:"year",onChange:e.setUrlData,style:{width:"100%"}},null,8,["value","placeholder","onChange"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),t(P,null,{default:a(()=>[t(v,null,{default:a(()=>[t(l,{span:24},{default:a(()=>[T("div",ne,[t(L,{"row-selection":{getCheckboxProps:n=>({disabled:!1,name:n.xid})},columns:e.columns,"row-key":n=>n.month,"data-source":e.unpaidLeaves,pagination:!1,loading:e.tableLoading,bordered:"",size:"middle"},{bodyCell:a(({column:n,record:y})=>[n.dataIndex=="name"?(_(),M(S,{key:0},[i(s(y.month?e.getMonthNameByNumber(y.month):"")+" "+s(y.year?y.year:""),1)],64)):Y("",!0)]),_:1},8,["row-selection","columns","row-key","data-source","loading"])])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})],64)}const pe=D(te,[["render",oe]]);export{pe as default};
