import{b as x,B as g}from"./primevue-CfIk0_DY.js";import{u as _,S as l,b as y,s as t}from"./index-BxIwIJfy.js";import{o as E,b as k,c as h,d as p,v as o,a7 as w,F as C,a as j,E as B}from"./vue-core-Di3IuVqe.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";const D={class:"w-full mb-6 flex flex-col sm:flex-row items-center align-baseline gap-3"},z={__name:"SyntheseDesEvaluations",setup(S){const{showError:c,showWarn:u}=_(),r=j(),s=B({lecture:!1,ajout:!1,modif:!1,supp:!1,devalidation:!1,validation:!1}),m=async()=>{try{const e=(await y.post(`${t.lienApi}/verifierDroit/${t.state.dbCommun6}`,{id_utilisateur:t.userId,id_page:512,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||(u("Vous n'avez pas le droit, veuillez consulter l'administrateur"),l("SyntheseDesEvaluations"))}catch(a){c("Une erreur est survenue : "+(a.response?.data?.message||a.message))}finally{t.state.afficher_in_progress=!1}},d=()=>{},f=()=>{},v=()=>{};return E(async()=>{await m()}),(a,e)=>{const i=x,b=g;return k(),h(C,null,[e[3]||(e[3]=p("div",{class:"btns flex items-center gap-2"},null,-1)),p("div",D,[o(i,{icon:"pi pi-refresh",label:"Afficher",text:"",onClick:e[0]||(e[0]=n=>d())}),o(i,{icon:"pi pi-cog",label:"Actions",text:"",onClick:e[1]||(e[1]=n=>r.value.toggle(n))}),o(i,{icon:"pi pi-times",label:"Fermer",text:"",onClick:e[2]||(e[2]=n=>w(l)("SyntheseDesEvaluations"))}),o(b,{ref_key:"actionsMenu",ref:r,model:[{label:"Exporter vers Excel",icon:"pi pi-file-excel",command:()=>f()},{label:"Imprimer",icon:"pi pi-print",command:()=>v()}],popup:!0},null,8,["model"])])],64)}}};export{z as default};
