import{r as t,f as V,g as T,o as M,c as z,b as l,a as o,z as S,M as A,F as B}from"./vendor-BDR7yMJi.js";import{u as P,s as r,a as k,g as E,k as H,h as n}from"./index-BSaHX2oa.js";const $={class:"w-full flex flex-row items-center gap-3"},U={class:"text-primary mt-2 bg-white p-2 border border-b-0"},G={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},I={class:"flex flex-col lg:flex-row gap-2"},R={class:"flex flex-col lg:flex-row gap-2"},q={class:"ag-theme-quartz",style:{height:"30vh"}},W={__name:"Cumulpointagepriodique",setup(L){const{showSuccess:p,showError:v}=P(),b=t(null),w=t(),C=[{field:"semaine",headerName:"Semaine",sortable:!0,filter:"agTextColumnFilter",width:100},{field:"journee",headerName:"Journée",sortable:!0,filter:"agTextColumnFilter",width:100},{field:"date",headerName:"Date",sortable:!0,filter:"agDateColumnFilter",valueFormatter:e=>H(e.value),width:120},{field:"matricule",headerName:"Matricule",sortable:!0,filter:"agTextColumnFilter",width:120},{field:"nom",headerName:"Nom",sortable:!0,filter:"agTextColumnFilter",width:150},{field:"e1",headerName:"E1",sortable:!0,width:80},{field:"s1",headerName:"S1",sortable:!0,width:80},{field:"e2",headerName:"E2",sortable:!0,width:80},{field:"s2",headerName:"S2",sortable:!0,width:80},{field:"e3",headerName:"E3",sortable:!0,width:80},{field:"s3",headerName:"S3",sortable:!0,width:80},{field:"e4",headerName:"E4",sortable:!0,width:80},{field:"s4",headerName:"S4",sortable:!0,width:80},{field:"e5",headerName:"E5",sortable:!0,width:80},{field:"s5",headerName:"S5",sortable:!0,width:80},{field:"nbHeures",headerName:"Nb Heures",sortable:!0,filter:"agNumberColumnFilter",valueFormatter:e=>n(e.value),width:120,type:"numericColumn",headerClass:"numeric-header-custom",aggFunc:"sum"},{field:"h25",headerName:"H25%",sortable:!0,filter:"agNumberColumnFilter",valueFormatter:e=>n(e.value),width:100,type:"numericColumn",headerClass:"numeric-header-custom",aggFunc:"sum"},{field:"h50",headerName:"H50%",sortable:!0,filter:"agNumberColumnFilter",valueFormatter:e=>n(e.value),width:100,type:"numericColumn",headerClass:"numeric-header-custom",aggFunc:"sum"},{field:"h100",headerName:"H100%",sortable:!0,filter:"agNumberColumnFilter",valueFormatter:e=>n(e.value),width:100,type:"numericColumn",headerClass:"numeric-header-custom",aggFunc:"sum"}],N=t({sortable:!0,filter:"agTextColumnFilter",resizable:!0,suppressHeaderMenuButton:!0}),_=t({statusPanels:[{statusPanel:"agTotalAndFilteredRowCountComponent",align:"left"},{statusPanel:"agAggregationComponent",align:"center"}]}),F=()=>["copy","copyWithHeaders","separator","export"],x=e=>{w.value=e.api,e.api.sizeColumnsToFit()},u=t(r.state.dossier.dated),i=t(r.state.dossier.datef),d=t(""),m=t(""),c=t([]);V(async()=>{u.value=r.state.dossier?.dated||new Date,i.value=r.state.dossier?.datef||new Date,await f()});const f=async()=>{r.state.afficher_in_progress=!0;try{const e=await k.post(`${r.lienApi}/SP_pointageDetaille/${r.db}`,{dateDu:u.value,dateAu:i.value,matricule:d.value,nomPrenom:m.value});c.value=e.data,p("Données chargées avec succès")}catch(e){const a=e.response?.data?.message||e.message;v(`Une erreur est survenue : ${a}`)}finally{r.state.afficher_in_progress=!1}};return(e,a)=>{const D=S,h=E,g=A,y=T("ag-grid-vue");return M(),z(B,null,[l("div",$,[o(D,{icon:"pi pi-refresh",label:"Afficher",onClick:f})]),l("div",U,[l("div",G,[l("div",null,[l("div",I,[o(h,{size:"small",modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=s=>u.value=s),placeholder:"Date Du","input-class":"w-full mb-2"},null,8,["modelValue"]),o(g,{size:"small",modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=s=>d.value=s),placeholder:"Matricule",class:"w-full mb-2"},null,8,["modelValue"])])]),l("div",null,[l("div",R,[o(h,{size:"small",modelValue:i.value,"onUpdate:modelValue":a[2]||(a[2]=s=>i.value=s),placeholder:"Date Au","input-class":"w-full mb-2"},null,8,["modelValue"]),o(g,{size:"small",modelValue:m.value,"onUpdate:modelValue":a[3]||(a[3]=s=>m.value=s),placeholder:"Nom prénom",class:"w-full mb-2"},null,8,["modelValue"])])])])]),l("div",q,[o(y,{ref_key:"gridCumul",ref:b,rowData:c.value,columnDefs:C,defaultColDef:N.value,theme:e.$agGridTheme,localeText:e.$agGridLocale,pagination:!0,paginationPageSize:50,statusBar:_.value,getContextMenuItems:F,onGridReady:x},null,8,["rowData","defaultColDef","theme","localeText","statusBar"])])],64)}}};export{W as default};
