import{_ as M}from"./G7u0egV4.js";import{d as R,O as F,P as w,c as K,a as y,o as T,f as o,E as D,w as t,g as r,F as V,i as x,R as E,W as N,A as B,h as f,t as v,n as L}from"./JQJBiNWj.js";import{_ as O}from"./DUQr9DrG.js";import{_ as P}from"./gxHWKiUc.js";import{_ as $}from"./D7IyRfqO.js";import j from"./BBDFeM-T.js";import z from"./CJYlvWEf.js";import{U as W}from"./CRodc3LN.js";import{u as Z}from"./DncddsCV.js";import{_ as q}from"./DTOFlTEg.js";import{_ as G}from"./CYDRfonM.js";import{r as A,h as H}from"./CLkB_muw.js";import{a as U}from"./BRY5UTQQ.js";import J from"./CuNuZBQO.js";import{D as Q}from"./DKM0wLqG.js";import{T as X}from"./BKl0aY3w.js";import{a as Y}from"./Cs-oNAkj.js";import{u as oo}from"./CL7Msd7o.js";import{u as eo}from"./BfZwoNNq.js";import"./HM4z-iuB.js";import"./DqVYbxj5.js";import"./BwwR4PPN.js";import"./B6O9xiO5.js";import"./CxkaGOlL.js";import"./BgAkS4D_.js";import"./Dm5UwSfy.js";import"./D42GNhrT.js";import"./Dc_YXEFz.js";import"./CbtPaznW.js";import"./DmwTwIPt.js";import"./B-La3K3C.js";import"./F98GHXdS.js";import"./DvBDpJyt.js";import"./FcRkkR--.js";import"./Dk4pWsnS.js";import"./BSHuRY0P.js";import"./DPeK_S5k.js";import"./ClVEEBFD.js";import"./2JTb7YQn.js";import"./CeGk6Fsr.js";import"./D1rKqwCM.js";import"./CeWG_dyW.js";import"./CDSORL4U.js";import"./BAmc1GPw.js";import"./3oa0FK2h.js";import"./BuR5k2Xw.js";import"./CH1bAkoS.js";import"./Dd3ROLQd.js";import"./f6QOa6wf.js";import"./Tk23Dwa0.js";import"./DMxbovom.js";import"./DBWLnasn.js";import"./RO0fiRDZ.js";import"./Cr9ZZaT-.js";import"./DNRi6U01.js";import"./BYfmWBgX.js";import"./vkXHPWu2.js";import"./qAEGbaa4.js";import"./CASPyZT-.js";import"./CfLdzzlL.js";import"./CjLYEAc3.js";import"./BTchAptP.js";import"./BlGPNclf.js";const to={class:"base-grid grid lg:grid-cols-4 grid-cols-2"},ao=R({__name:"Filtros",async setup(C){let n,c;const d=F(),h=([n,c]=w(()=>d.getEmpresaSelecionada()),n=await n,c(),n),g=Z();async function _(e){return await x.rodovias.getByEmpresa(h.sigla,e)}const S=K(()=>{var e,u,m,a,p;return(p=(a=(m=(u=(e=g.value)==null?void 0:e.fields)==null?void 0:u.rodovia)==null?void 0:m.states)==null?void 0:a.value)==null?void 0:p.length});return(e,u)=>{const m=z,a=P,p=$,b=j;return T(),y("div",to,[o(a,{name:"search",label:"Localizar:"},{default:t(()=>[o(m,{type:"search",fluid:""})]),_:1}),o(a,{name:"rodovia",label:"Rodovia:"},{default:t(()=>[o(p,{id:"rodovia",name:"rodovia","paginated-data-key":"rodovias","async-fn":_,"option-label":i=>i.descricao+"/"+i.uf,"option-value":"id","show-clear":"","show-toggle-all":!1},null,8,["option-label"])]),_:1}),r(S)?(T(),y(V,{key:0},[o(a,{name:"kmInicial",label:"Km inicial:"},{default:t(i=>[o(m,{id:"km-inicial",modelValue:i.value,"onUpdate:modelValue":s=>i.value=s,type:"text",placeholder:"KM inicial"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(a,{name:"kmFinal",label:"Km final:"},{default:t(i=>[o(m,{id:"km-final",modelValue:i.value,"onUpdate:modelValue":s=>i.value=s,type:"text",placeholder:"KM final"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(a,{name:"uf",label:"UF:"},{default:t(()=>[o(b,{id:"uf",name:"uf",options:r(W),"option-label":"nome","option-value":"sigla",placeholder:"Selecione...","show-clear":"","show-toggle-all":!1,filter:""},null,8,["options"])]),_:1})],64)):D("",!0)])}}}),io=Object.assign(ao,{__name:"AtivosElementoTuneisFiltros"}),fe=R({__name:"index",async setup(C){let n,c;const d=oo({view:E.ATV_VISUALIZAR_CADASTRO_TUNEIS,add:E.ATV_EDITAR_CADASTRO_TUNEIS}),h=F(),g=([n,c]=w(()=>h.getEmpresaSelecionada()),n=await n,c(),n),_=eo("ativos-cadastros-tuneis",e=>x.ativos.cadastros.findAllByTipo(g.sigla,X.Tuneis,e));function S(e){(d.value.add||d.value.view)&&L(A(e.data.id.idElemento),H(e))}return(e,u)=>{const m=M,a=B,p=O,b=io,i=q,s=J,I=G;return T(),y(V,null,[o(p,{title:"Cadastros - Túneis"},N({_:2},[r(d).add?{name:"title-buttons",fn:t(()=>[o(a,{to:("resolveRelativeRoute"in e?e.resolveRelativeRoute:r(A))(r(Q))},{default:t(()=>[o(m,{mode:"add"})]),_:1},8,["to"])]),key:"0"}:void 0]),1024),o(i,{status:r(_).status.value,schema:r(Y),"paginated-url":""},{default:t(()=>[o(b)]),_:1},8,["status","schema"]),o(I,{value:r(_),onRowClick:S},{default:t(()=>[o(s,{field:"nomeTunel",header:"Nome",sortable:""}),o(s,{field:"rodovia",header:"Rodovia",sortable:"","sort-field":"rodovia.descricao"},{body:t(l=>{var k;return[f(v((k=l.data.rodovia)==null?void 0:k.descricao),1)]}),_:1}),o(s,{field:"uf",header:"UF",sortable:""},{body:t(l=>[f(v(l.data.uf),1)]),_:1}),o(s,{field:"kmInicial",header:"KM inicial",sortable:""},{body:t(l=>[f(v(("applyKmEstacaMask"in e?e.applyKmEstacaMask:r(U))(l.data.kmInicial)),1)]),_:1}),o(s,{field:"kmFinal",header:"KM final",sortable:""},{body:t(l=>[f(v(("applyKmEstacaMask"in e?e.applyKmEstacaMask:r(U))(l.data.kmFinal)),1)]),_:1})]),_:1},8,["value"])],64)}}});export{fe as default};
