import{g,y as x,H as $,K as F,I as U}from"./primevue-CfIk0_DY.js";import{s}from"./index-BxIwIJfy.js";import{M as y}from"./MasterDetailReferentiel-c0KTUzyB.js";import{N as h}from"./NumeroChip-QCXXOqUM.js";import{i as k,b as w,k as N,l as A,d as l,v as d,j as r,t as C}from"./vue-core-Di3IuVqe.js";import"./cjs-helpers-psZwOBky.js";import"./vue-cal-DKMVGERa.js";import"./moment-BeHQNF8T.js";import"./usePagerDetail-BeqYPv-1.js";import"./DataGrid-CoMfrBJA.js";import"./useAgGridConfig-Dp3DkgaV.js";const D={class:"md-form-grid"},z={class:"flex items-end md-col-full",style:{gap:"8px"}},O={class:"field",style:{flex:"1","min-width":"0"}},S={class:"field"},T={class:"field"},B={class:"field"},I={class:"flex items-center",style:{height:"32px"}},j={class:"ml-2 text-sm text-gray-600"},P={class:"field"},R={class:"field"},q={class:"field"},E={class:"field md-col-full"},ll={__name:"Formation",props:["ndoc","embedded"],setup(u){const p=["Sécurité","Technique","Management","OFPPT","Autre"],b={list:()=>`${s.lienApi}/formation/${s.db}`,getOne:t=>`${s.lienApi}/uneformation/${s.db}/${t}`,add:()=>`${s.lienApi}/AjouterEtRenvoyerFormation/${s.db}`,save:t=>`${s.lienApi}/enregistrerFormation/${s.db}/${t}`,remove:t=>`${s.lienApi}/supprimerFormation/${s.db}/${t}`},f={excelFileName:"Formations",excelSheetName:"Formations",documentNumberFields:["ndoc"],excludedColumns:["ndoc","id_formation"],columnWidths:{code:110,libelle:280,type_formation:130,duree_standard:120,duree_validite_mois:120,organisme_defaut:200,actif:80}};return(t,o)=>{const m=g,_=x,V=$,c=F,v=U,n=k("maxlen-db");return w(),N(y,{"page-id":1422,"tab-id":"Formation","id-field":"id_formation",resource:b,grid:f,embedded:u.embedded,ndoc:u.ndoc,variant:"drawer","drawer-width":"640px",title:"Formation","entity-label":"une formation","empty-icon":"pi pi-book","delete-message":"Supprimer cette formation du catalogue ?"},{form:A(({entete:e,modeModification:i})=>[l("div",D,[l("div",z,[d(h,{value:e.id_formation},null,8,["value"]),l("div",O,[o[0]||(o[0]=l("label",{for:"inputFocus",class:"block mb-1"},"Libellé",-1)),r(d(m,{size:"small",id:"inputFocus",modelValue:e.libelle,"onUpdate:modelValue":a=>e.libelle=a,disabled:!i,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","disabled"]),[[n,"formation.libelle"]])])]),l("div",S,[o[1]||(o[1]=l("label",{class:"block mb-1"},"Code",-1)),r(d(m,{size:"small",modelValue:e.code,"onUpdate:modelValue":a=>e.code=a,disabled:!i,maxlength:"30",class:"w-full"},null,8,["modelValue","onUpdate:modelValue","disabled"]),[[n,"formation.code"]])]),l("div",T,[o[2]||(o[2]=l("label",{class:"block mb-1"},"Type",-1)),d(_,{modelValue:e.type_formation,"onUpdate:modelValue":a=>e.type_formation=a,options:p,size:"small",disabled:!i,class:"w-full",placeholder:"—",showClear:""},null,8,["modelValue","onUpdate:modelValue","disabled"])]),l("div",B,[o[3]||(o[3]=l("label",{class:"block mb-1"},"Actif",-1)),l("div",I,[d(V,{modelValue:e.actif,"onUpdate:modelValue":a=>e.actif=a,binary:"",disabled:!i},null,8,["modelValue","onUpdate:modelValue","disabled"]),l("span",j,C(e.actif?"Oui":"Non"),1)])]),l("div",P,[o[4]||(o[4]=l("label",{class:"block mb-1"},"Durée standard (h)",-1)),d(c,{modelValue:e.duree_standard,"onUpdate:modelValue":a=>e.duree_standard=a,disabled:!i,size:"small",minFractionDigits:0,maxFractionDigits:2,fluid:""},null,8,["modelValue","onUpdate:modelValue","disabled"])]),l("div",R,[o[5]||(o[5]=l("label",{class:"block mb-1"},"Validité (mois)",-1)),d(c,{modelValue:e.duree_validite_mois,"onUpdate:modelValue":a=>e.duree_validite_mois=a,disabled:!i,size:"small",min:0,fluid:""},null,8,["modelValue","onUpdate:modelValue","disabled"])]),l("div",q,[o[6]||(o[6]=l("label",{class:"block mb-1"},"Organisme par défaut",-1)),r(d(m,{size:"small",modelValue:e.organisme_defaut,"onUpdate:modelValue":a=>e.organisme_defaut=a,disabled:!i,maxlength:"100",class:"w-full"},null,8,["modelValue","onUpdate:modelValue","disabled"]),[[n,"formation.organisme_defaut"]])]),l("div",E,[o[7]||(o[7]=l("label",{class:"block mb-1"},"Observation",-1)),d(v,{modelValue:e.observation,"onUpdate:modelValue":a=>e.observation=a,disabled:!i,class:"w-full",rows:"3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])])]),_:1},8,["embedded","ndoc"])}}};export{ll as default};
