import{_ as M}from"./Brk5FU9k.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,U as N,A as B,h as f,t as v,n as L}from"./dVzHJMF1.js";import{_ as O}from"./DDV-HLQE.js";import{_ as P}from"./BqnRxGiA.js";import{_ as $}from"./RwcpOhWN.js";import j from"./C5Oc2f2M.js";import z from"./B7Hqpkvs.js";import{U as Z}from"./BNYh59m7.js";import{u as q}from"./CrEL4Vxb.js";import{_ as G}from"./CPhxMljB.js";import{_ as H}from"./C682XpkB.js";import{r as U,h as J}from"./pI06Dkb8.js";import{a as A}from"./BRY5UTQQ.js";import Q from"./G1F3Bacz.js";import{D as W}from"./CX2DUt_P.js";import{T as X}from"./Byi2WFzI.js";import{a as Y}from"./Ck6rUnj-.js";import{u as oo}from"./CJ1p9Ehj.js";import{u as eo}from"./BWID9sOX.js";import"./yXj_05M0.js";import"./Bhud8mbC.js";import"./DhLu8RVk.js";import"./CWHHmK0V.js";import"./tESAK1vk.js";import"./B79Hoqpc.js";import"./cMkL48JQ.js";import"./iZ-xiGRB.js";import"./BSLzRQpY.js";import"./B-d7gz-d.js";import"./CNJ8Vm0G.js";import"./Bpf-t_rp.js";import"./yHxjwlra.js";import"./KG16xCEZ.js";import"./FcRkkR--.js";import"./DP0doleY.js";import"./BAtzogEJ.js";import"./DYJY2RZG.js";import"./a1m94JqE.js";import"./CM8mMzv6.js";import"./BuQ9u7Je.js";import"./BW5cYMVL.js";import"./DiwqsPB4.js";import"./KcBrPYTF.js";import"./Coj9p228.js";import"./r1Y5hC84.js";import"./CBbadgK0.js";import"./CH1bAkoS.js";import"./DaykkcNl.js";import"./D2P12BLM.js";import"./DTJCrQga.js";import"./DDpCYtr5.js";import"./C9UvFovT.js";import"./FaLtR_4n.js";import"./C9L2ikqF.js";import"./B3dHCiEQ.js";import"./BZjcnCH7.js";import"./B_Kqq5Cu.js";import"./BSe03gVj.js";import"./B-6EeO4n.js";import"./CPg0DzIm.js";import"./BphmgIhx.js";import"./ClA_a7pZ.js";import"./D4oUL8iA.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=q();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(Z),"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(U(e.data.id.idElemento),J(e))}return(e,u)=>{const m=M,a=B,p=O,b=io,i=G,s=Q,I=H;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(U))(r(W))},{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(A))(l.data.kmInicial)),1)]),_:1}),o(s,{field:"kmFinal",header:"KM final",sortable:""},{body:t(l=>[f(v(("applyKmEstacaMask"in e?e.applyKmEstacaMask:r(A))(l.data.kmFinal)),1)]),_:1})]),_:1},8,["value"])],64)}}});export{fe as default};
