import{_ as y}from"./FavorisSwitch-DD6nTfzi.js";import{f as k,o as l,c as w,b as m,a,z as F,av as j,i as h,q as $,d as B,r as E,ar as A}from"./vendor-0kGcmQpG.js";import{u as M,S as c,a as P,s as t}from"./index-Bn9WoKhP.js";const V={class:"flex min-w-full flex-col lg:flex-row lg:items-center gap-2 p-1"},q={class:"btns flex items-center gap-2 lg:w-1/2 lg:justify-start py-2"},S={__name:"CommissionParFamille",props:["masquerFermer"],setup(p){const{showError:u,showWarn:f}=M(),s=A({lecture:!1,ajout:!1,modif:!1,supp:!1,devalidation:!1,validation:!1}),d=p,n=E(),v=async()=>{try{const e=(await P.post(`${t.lienApi}/verifierDroit/${t.state.dbCommun6}`,{id_utilisateur:t.userId,id_page:814,mail:t.state.userCloud.mail},{headers:{"Content-Type":"application/json"}})).data;e&&Object.keys(e).length>0&&(s.lecture=e.lecture,s.ajout=e.ajout,s.modif=e.modif,s.supp=e.supp,s.devalidation=e.devalidation,s.validation=e.validation),s.lecture||(f("Vous n'avez pas le droit, veuillez consulter l'administrateur"),c("CommissionParFamille"))}catch(o){u("Une erreur est survenue : "+(o.response?.data?.message||o.message))}finally{t.state.afficher_in_progress=!1}};k(async()=>{await v()});const x=()=>{},_=()=>{},g=()=>{};return(o,e)=>{const i=F,C=j,b=y;return l(),w("div",V,[m("div",q,[a(i,{icon:"pi pi-refresh",label:"Afficher",text:"",onClick:e[0]||(e[0]=r=>x())}),a(i,{icon:"pi pi-cog",label:"Actions",text:"",onClick:e[1]||(e[1]=r=>n.value.toggle(r))}),a(C,{ref_key:"actionsMenu",ref:n,model:[{label:"Exporter vers Excel",icon:"pi pi-file-excel",command:()=>g()},{label:"Imprimer",icon:"pi pi-print",command:()=>_()}],popup:!0},null,8,["model"]),d.masquerFermer?B("",!0):(l(),h(i,{key:0,icon:"pi pi-times",label:"Fermer",text:"",onClick:e[2]||(e[2]=r=>$(c)("CommissionParFamille"))})),a(b,{fen:"CommissionParFamille",text:"Commission par famille"})]),e[3]||(e[3]=m("h2",{class:"justify-self-end ml-auto mr-3 font-bold text-xl"},"En dev",-1))])}}};export{S as default};
