import{_ as B,c as E,g as e,w as t,b as c,i as p,t as o,e as S,h as w,f as C,F as A,u as D,k as u,a as L,T as P,o as x}from"./app-D7zH3Nl5.js";import{h as T}from"./hrmManagement-B9P5L2Nz.js";import{A as V,B as H,a as I,_ as U}from"./AdminPageHeader-4nW0e2pw.js";import{T as j}from"./Text-BYGZwHPp.js";import{D as z}from"./dayjs-Bh5BavPT.js";import{_ as F,a as q}from"./index-Cv7zOydE.js";import{_ as G}from"./index-Bso6TOMG.js";import"./dropdown-C-HKHQ-f.js";import"./index-BUzTR6QN.js";import"./useFlexGapSupport-CpBR-RD-.js";import"./move-DTmUXir3.js";import"./index-BUQyFFfI.js";import"./transButton--XrRgMTg.js";import"./useDestroyed-B0Qhtgc6.js";import"./index-_ApNSgqk.js";import"./index-B1-dW-7G.js";import"./Base-Dri4L_EE.js";import"./TextArea-C1mL3q5m.js";import"./EditOutlined-Corvrvzt.js";import"./index-DzAtlijK.js";import"./index-ClJ_H-9Y.js";import"./CalendarOutlined-m89BWwmS.js";import"./index-DnrvHM6n.js";import"./pickAttrs-1XPwZpL6.js";import"./index-Cu62pBdq.js";import"./index-Q5rqE8AL.js";import"./index-DTmsoxos.js";import"./index-DkTJbm8y.js";import"./Checkbox-BT3Ug64z.js";import"./index-twmpq7Gp.js";import"./RadioButton-BeQscLER.js";import"./MinusSquareOutlined-CjNBof4X.js";import"./FolderOpenOutlined-tH0_VpKZ.js";const J={components:{AdminPageHeader:V},setup(){const{t:n}=D(),{getMonthNameByNumber:r}=T(),v=[{title:n("leave.leave_type"),dataIndex:"name"},{title:n("menu.remaining_leaves"),dataIndex:"remaining_leaves"}],a=u([]),m=u(!0),{dayjs:b,permsArray:f}=L(),s=u({year:b()}),l=u([]);P(()=>{i()});const i=()=>{m.value=!0;var g=s.value.year.format("YYYY");axiosAdmin.get(`self/remaining-leaves?year=${g}`).then(d=>{a.value=d.data.data,l.value=d.data.month_year,m.value=!1})};return{columns:v,remainingLeaves:a,selectedYearStartEndMonths:l,getMonthNameByNumber:r,filters:s,tableLoading:m,setUrlData:i,permsArray:f}}},K={class:"table-responsive"};function O(n,r,v,a,m,b){const f=U,s=c("router-link"),l=I,i=H,g=c("AdminPageHeader"),d=j,_=q,k=z,h=F,M=c("admin-page-filters"),Y=G,N=c("admin-page-table-content");return x(),E(A,null,[e(g,null,{header:t(()=>[e(f,{title:n.$t("menu.remaining_leaves"),class:"p-0"},null,8,["title"])]),breadcrumb:t(()=>[e(i,{separator:"-",style:{"font-size":"12px"}},{default:t(()=>[e(l,null,{default:t(()=>[e(s,{to:{name:"admin.dashboard.index"}},{default:t(()=>[p(o(n.$t("menu.dashboard")),1)]),_:1})]),_:1}),e(l,null,{default:t(()=>[p(o(n.$t("menu.leaves")),1)]),_:1}),e(l,null,{default:t(()=>[p(o(n.$t("menu.remaining_leaves")),1)]),_:1})]),_:1})]),_:1}),e(M,null,{default:t(()=>[e(h,{gutter:[16,16],align:"middle"},{default:t(()=>[e(_,{xs:24,sm:24,md:12,lg:10,xl:10},{default:t(()=>[a.selectedYearStartEndMonths&&a.selectedYearStartEndMonths.start_month?(x(),S(d,{key:0,strong:""},{default:t(()=>[p(o(a.getMonthNameByNumber(a.selectedYearStartEndMonths.start_month))+" "+o(a.selectedYearStartEndMonths.start_year)+" - "+o(a.getMonthNameByNumber(a.selectedYearStartEndMonths.end_month))+" "+o(a.selectedYearStartEndMonths.end_year),1)]),_:1})):w("",!0)]),_:1}),e(_,{xs:24,sm:24,md:12,lg:14,xl:14},{default:t(()=>[e(h,{gutter:[16,16],justify:"end"},{default:t(()=>[e(_,{xs:24,sm:24,md:12,lg:12,xl:8},{default:t(()=>[e(k,{value:a.filters.year,"onUpdate:value":r[0]||(r[0]=y=>a.filters.year=y),placeholder:n.$t("common.select_default_text",[n.$t("holiday.year")]),picker:"year",onChange:a.setUrlData,style:{width:"100%"},allowClear:!1},null,8,["value","placeholder","onChange"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),e(N,null,{default:t(()=>[e(h,null,{default:t(()=>[e(_,{span:24},{default:t(()=>[C("div",K,[e(Y,{columns:a.columns,"row-key":y=>y.xid,"data-source":a.remainingLeaves,pagination:!1,loading:a.tableLoading,bordered:"",size:"middle"},{bodyCell:t(({})=>r[1]||(r[1]=[])),_:1},8,["columns","row-key","data-source","loading"])])]),_:1})]),_:1})]),_:1})],64)}const Ee=B(J,[["render",O]]);export{Ee as default};
