1import{_ as L}from"./AuthenticatedLayout-aebca31e.js";import{v as O,p as h,N as c,a as n,b as S,o as r,g as m,f as t,w as l,d as s,k as T,t as g,e as p,c as F,j as N,F as U}from"./app-5fc1912d.js";import{I as z}from"./iconify-03d69e80.js";import{_ as B}from"./InputLabel-cab2995d.js";import{_ as P}from"./_plugin-vue_export-helper-c27b6911.js";import"./ApplicationLogo-e0d31125.js";import"./icon-df62cc88.js";import"./validacaoNome-49cf0a9d.js";const H={components:{Icon:z,AuthenticatedLayout:L,InputLabel:B},props:{formacoes:{type:Array,default:""}},data(){return{selectedOptions:{status:""},acaoTomada:!0,columns:[{name:"formacao",align:"center",label:"Nome",field:"formacao",sortable:!0},{name:"status_id",align:"right",label:"Status",field:"status_id",sortable:!0},{name:"actions",align:"center",label:"Ações",field:"actions",sortable:!0}],filter:"",selected:[],showInscritosDialog:!1,showDialog:!1,showDialogCandidato:!1,showForm:!1,openModal:!1,isEditing:!1,labelEditing:!1,form:O({id:"",formacao:"",status:""}),typeModal:null,openModalDelete:!1,statusOption:[{label:"Ativo",value:"1"},{label:"Inativo",value:"0"}]}},methods:{openModalForm(i,o=[]){this.openModal=!0,i===1?(this.typeModal=1,this.form.reset()):o&&(this.typeModal=2,this.form.id=o.id,this.form.formacao=o.formacao,this.form.status=o.status_id)},openModalDeleteAction(i){this.openModalDelete=!0,this.form.id=i.id},getStatusColor(i){if(i==="1")return"primary";if(i==="0")return"negative"},destroyFormacoes(){h.delete(route("admin.vagaformacao.destroy",this.form.id)).then(()=>{c.create({type:"positive",position:"top-right",message:"Formação removida com sucesso."}),this.openModalDelete=!1,setTimeout(()=>{window.location.href=window.location.href},1e3)}).catch(i=>{c.create({type:"negative",color:"negative",position:"top-right",message:`${i.response.data.error}`})})},adicionarFormacao(){if(!this.form.formacao||!this.selectedOptions.status){c.create({type:"warning",position:"top-right",message:"Preencha todos os campos antes de adicionar um tipo."});return}this.form.reset()},storeFormacao(){this.form.status=this.selectedOptions.status.value,h.post(route("admin.vagaformacao.store"),this.form).then(()=>{this.openModal=!1,c.create({type:"positive",position:"top-right",message:"Dados adicionados com sucesso."}),setTimeout(()=>{window.location.href=window.location.href},2e3)}).catch(i=>{c.create({type:"negative",color:"negative",position:"top-right",message:`${i.response.data.error}`})})},paginationLabel(){return`Total de registro(s) encontrado(s): ${this.formacoes.length}`},saveFormacoes(){this.form.status=this.selectedOptions.status.value,h.patch(route("admin.vagaformacao.update",this.form.id),this.form).then(()=>{this.openModal=!1,c.create({type:"positive",position:"top-right",message:"Dados atualizados com sucesso."}),this.showForm=!1,setTimeout(()=>{window.location.href=window.location.href},2e3)}).catch(i=>{c.create({type:"negative",color:"negative",position:"top-right",message:`${i.response.data.error}`})})}}},G=s("title",null,"Minhas Vagas",-1),J={class:"tw-py-12"},K={class:"tw-max-w-7xl tw-mx-auto sm:tw-px-6 lg:tw-px-8"},Q={class:"tw-bg-white tw-overflow-hidden tw-shadow-sm sm:tw-rounded-lg"},R=s("span",{class:"tw-mr-1"},"Adicionar",-1),W={key:0},X={class:"tw-inline-flex tw-items-center tw-rounded-md tw-shadow-sm"},Y=["onClick"],Z=["onClick"],$={key:1},ee={key:2},te={class:"tw-w-full tw-flex tw-justify-center tw-items-center"},oe={key:0,class:"text-h6"},se={key:1,class:"text-h6"},ae={class:"tw-grid tw-grid-cols-2 md:tw-grid-cols-1 tw-gap-5"},le={class:"tw-grid tw-grid-cols-3 md:tw-grid-cols-2 tw-gap-5"},ne=s("div",{class:"text-h6"},"Excluir Formação",-1),ie=s("div",null,"Você tem certeza que deseja deletar esse registro?",-1),re={class:"tw-mt-5 tw-flex"},de=s("span",{class:"tw-mr-1"},"Excluir",-1),ce={class:"tw-flex tw-items-center tw-justify-center tw-bg-cyan-500 tw-px-3 tw-py-2 tw-rounded-md tw-text-white"},me=s("span",{class:"tw-mr-1"},"Cancelar",-1);function ue(i,o,k,we,a,d){const M=n("Head"),u=n("Icon"),v=n("q-icon"),b=n("q-input"),V=n("q-badge"),C=n("q-td"),D=n("q-table"),w=n("q-card-section"),y=n("InputLabel"),A=n("q-select"),f=n("q-btn"),I=n("q-form"),x=n("q-card"),q=n("q-dialog"),j=n("AuthenticatedLayout"),E=S("close-popup");return r(),m(U,null,[t(M,null,{default:l(()=>[G]),_:1}),t(j,null,{default:l(()=>[s("div",J,[s("div",K,[s("div",Q,[t(D,{flat:"",bordered:"",rows:k.formacoes,columns:a.columns,filter:a.filter,"row-key":"id",selected:a.selected,"onUpdate:selected":o[2]||(o[2]=e=>a.selected=e),"no-data-label":"Sem dados cadastrados","no-results-label":"A sua pesquisa não retornou dados","rows-per-page-options":[0],"pagination-label":d.paginationLabel},{"top-left":l(()=>[s("button",{onClick:o[0]||(o[0]=e=>d.openModalForm(1)),class:"tw-flex tw-items-center tw-justify-center tw-bg-green-500 tw-px-3 tw-py-2 tw-rounded-md tw-text-black"},[R,t(u,{icon:"material-symbols:add-circle"})])]),"top-right":l(()=>[t(b,{borderless:"",dense:"",modelValue:a.filter,"onUpdate:modelValue":o[1]||(o[1]=e=>a.filter=e),placeholder:"Pesquisar",class:"tw-border tw-border-gray-400 tw-rounded-md tw-px-2"},{append:l(()=>[t(v,{name:"search"})]),_:1},8,["modelValue"])]),"body-cell":l(e=>[t(C,{props:e},{default:l(()=>[e.col.name==="actions"?(r(),m("div",W,[s("div",X,[s("button",{onClick:_=>d.openModalForm(2,e.row),class:"tw-text-slate-800 hover:tw-text-green-500 tw-text-sm tw-bg-white hover:tw-bg-slate-100 tw-border tw-border-slate-200 tw-rounded-l-lg tw-font-medium tw-px-4 tw-py-2 tw-inline-flex tw-space-x-1 tw-items-center",title:"Editar Tipo"},[t(u,{icon:"tabler:edit"})],8,Y),s("button",{onClick:_=>d.openModalDeleteAction(e.row),class:"tw-text-slate-800 hover:tw-text-red-500 tw-text-sm tw-bg-white hover:tw-bg-slate-100 tw-border tw-border-slate-200 tw-rounded-r-lg tw-font-medium tw-px-4 tw-py-2 tw-inline-flex tw-space-x-1 tw-items-center",title:"Excluir Tipo"},[t(u,{icon:"uil:trash"})],8,Z)])])):e.col.name==="status_id"?(r(),m("div",$,[t(V,{color:d.getStatusColor(e.value)},{default:l(()=>[T(g(e.value==1?"Ativo":"Inativo"),1)]),_:2},1032,["color"])])):(r(),m("div",ee,g(e.value),1))]),_:2},1032,["props"])]),"no-data":l(({icon:e,message:_,filter:pe})=>[s("div",te,[s("span",null,g(_),1),t(v,{size:"2em",name:"sentiment_dissatisfied"})])]),_:1},8,["rows","columns","filter","selected","pagination-label"])])])]),t(q,{modelValue:a.openModal,"onUpdate:modelValue":o[6]||(o[6]=e=>a.openModal=e),"content-class":"dialog-content"},{default:l(()=>[t(x,{style:{width:"900px","max-width":"80vw"}},{default:l(()=>[t(w,null,{default:l(()=>[a.typeModal===1?(r(),m("div",oe,"Adicionar Formação")):p("",!0),a.typeModal===2?(r(),m("div",se,"Editar Formação")):p("",!0)]),_:1}),t(w,null,{default:l(()=>[t(I,{class:"tw-space-y-6"},{default:l(()=>[s("div",ae,[s("div",null,[t(y,{for:"name",required:"",value:"Formação"}),t(b,{modelValue:a.form.formacao,"onUpdate:modelValue":o[3]||(o[3]=e=>a.form.formacao=e),outlined:"",clearable:"",id:"formacao",type:"text",class:"tw-mt-1 tw-block tw-w-full",autofocus:"","lazy-rules":"",rules:[e=>!!e||"Por favor, insira a Formação desejada"]},null,8,["modelValue","rules"])])]),s("div",le,[s("div",null,[t(y,{for:"status",required:"",value:"Status"}),t(A,{outlined:"",clearable:"","hide-selected":"data.status_id",id:"status",class:"tw-mt-1 tw-block tw-w-full",modelValue:a.selectedOptions.status,"onUpdate:modelValue":o[4]||(o[4]=e=>a.selectedOptions.status=e),options:a.statusOption,rules:[e=>!!e||"Por favor, selecione o Status"]},null,8,["modelValue","options","rules"])])]),s("div",null,[a.typeModal===1?(r(),F(f,{key:0,label:"Cadastrar Formação",onClick:d.storeFormacao,color:"cyan"},null,8,["onClick"])):p("",!0),a.typeModal===2?(r(),F(f,{key:1,label:"Salvar Formação",onClick:d.saveFormacoes,color:"cyan"},null,8,["onClick"])):p("",!0),t(f,{class:"tw-items-center tw-ml-7 tw-justify-center tw-bg-red-500 tw-px-3 tw-py-2 tw-rounded-md tw-text-white",label:"Fechar",color:"danger",onClick:o[5]||(o[5]=e=>a.openModal=!1)})])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),t(q,{modelValue:a.openModalDelete,"onUpdate:modelValue":o[8]||(o[8]=e=>a.openModalDelete=e)},{default:l(()=>[t(x,{style:{width:"700px","max-width":"80vw"}},{default:l(()=>[t(w,null,{default:l(()=>[ne]),_:1}),t(w,null,{default:l(()=>[ie,s("div",re,[s("button",{onClick:o[7]||(o[7]=e=>
1d.destroyFormacoes()),class:"tw-mr-5 tw-flex tw-items-center tw-justify-center tw-bg-red-500 tw-px-3 tw-py-2 tw-rounded-md tw-text-white"},[de,t(u,{icon:"uil:trash"})]),N((r(),m("button",ce,[me,t(u,{icon:"material-symbols:cancel-outline"})])),[[E]])])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})],64)}const qe=P(H,[["render",ue]]);export{qe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.