import{_ as M}from"./Brk5FU9k.js";import{d as x,O as U,P as I,c as V,a as y,o as k,f as o,E as K,w as t,g as e,F as D,i as w,R as E,U as O,A as N,h as v,t as h,n as L}from"./dVzHJMF1.js";import{_ as B}from"./DDV-HLQE.js";import{_ as P}from"./BqnRxGiA.js";import{_ as $}from"./RwcpOhWN.js";import j from"./C5Oc2f2M.js";import X from"./B7Hqpkvs.js";import{U as z}from"./BNYh59m7.js";import{u as Z}from"./CrEL4Vxb.js";import{_ as q}from"./CPhxMljB.js";import{_ as G}from"./C682XpkB.js";import{r as S,h as H}from"./pI06Dkb8.js";import{a as R}from"./BRY5UTQQ.js";import{D as J}from"./CX2DUt_P.js";import{a as Q}from"./D4oUL8iA.js";import{T as W}from"./Byi2WFzI.js";import{u as Y}from"./CJ1p9Ehj.js";import{u as oo}from"./BWID9sOX.js";import _ from"./G1F3Bacz.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";const ao={class:"base-grid grid lg:grid-cols-4 grid-cols-2"},eo=x({__name:"Filtros",async setup(T){let n,p;const c=U(),g=([n,p]=I(()=>c.getEmpresaSelecionada()),n=await n,p(),n),A=Z();async function u(a){return await w.rodovias.getByEmpresa(g.sigla,a)}const F=V(()=>{var a,f,m,i,l;return(l=(i=(m=(f=(a=A.value)==null?void 0:a.fields)==null?void 0:f.rodovia)==null?void 0:m.states)==null?void 0:i.value)==null?void 0:l.length});return(a,f)=>{const m=X,i=P,l=$,b=j;return k(),y("div",ao,[o(i,{name:"search",label:"Localizar:"},{default:t(()=>[o(m,{type:"search",fluid:""})]),_:1}),o(i,{name:"rodovia",label:"Rodovia:"},{default:t(()=>[o(l,{id:"rodovia",name:"rodovia","paginated-data-key":"rodovias","async-fn":u,"option-label":r=>r.descricao+"/"+r.uf,"option-value":"id","show-clear":"","show-toggle-all":!1},null,8,["option-label"])]),_:1}),e(F)?(k(),y(D,{key:0},[o(i,{name:"kmInicial",label:"Km inicial:"},{default:t(r=>[o(m,{id:"km-inicial",modelValue:r.value,"onUpdate:modelValue":d=>r.value=d,type:"text",placeholder:"KM inicial"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(i,{name:"kmFinal",label:"Km final:"},{default:t(r=>[o(m,{id:"km-final",modelValue:r.value,"onUpdate:modelValue":d=>r.value=d,type:"text",placeholder:"KM final"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(i,{name:"uf",label:"UF:"},{default:t(()=>[o(b,{id:"uf",name:"uf",options:e(z),"option-label":"nome","option-value":"sigla",placeholder:"Selecione...","show-clear":"","show-toggle-all":!1,filter:""},null,8,["options"])]),_:1})],64)):K("",!0)])}}}),to=Object.assign(eo,{__name:"AtivosElementoFaixaDominioCercaFiltros"}),_a=x({__name:"index",async setup(T){let n,p;const c=Y({view:E.ATV_VISUALIZAR_CADASTRO_FAIXA_DOMINIO_CERCA,add:E.ATV_EDITAR_CADASTRO_FAIXA_DOMINIO_CERCA}),g=U(),A=([n,p]=I(()=>g.getEmpresaSelecionada()),n=await n,p(),n),u=oo("ativos-cadastros-faixa-dominio-cerca",a=>w.ativos.cadastros.findAllByTipo(A.sigla,W.FaixaDominioCerca,a));function F(a){(c.value.add||c.value.view)&&L(S(a.data.id.idElemento),H(a))}return(a,f)=>{const m=M,i=N,l=B,b=to,r=q,d=G;return k(),y(D,null,[o(l,{title:"Cadastros - Faixa de domínio - Cerca"},O({_:2},[e(c).add?{name:"title-buttons",fn:t(()=>[o(i,{to:("resolveRelativeRoute"in a?a.resolveRelativeRoute:e(S))(e(J))},{default:t(()=>[o(m,{mode:"add"})]),_:1},8,["to"])]),key:"0"}:void 0]),1024),o(r,{status:e(u).status.value,schema:e(Q),"paginated-url":""},{default:t(()=>[o(b)]),_:1},8,["status","schema"]),o(d,{value:e(u),onRowClick:F},{default:t(()=>[o(e(_),{field:"codigoCerca.nome",header:"Identificação",sortable:""}),o(e(_),{field:"rodovia",header:"Rodovia",sortable:"","sort-field":"rodovia.descricao"},{body:t(s=>{var C;return[v(h((C=s.data.rodovia)==null?void 0:C.descricao),1)]}),_:1}),o(e(_),{field:"uf",header:"UF",sortable:""},{body:t(s=>[v(h(s.data.uf),1)]),_:1}),o(e(_),{field:"kmInicial",header:"KM inicial",sortable:""},{body:t(s=>[v(h(("applyKmEstacaMask"in a?a.applyKmEstacaMask:e(R))(s.data.kmInicial)),1)]),_:1}),o(e(_),{field:"kmFinal",header:"KM final",sortable:""},{body:t(s=>[v(h(("applyKmEstacaMask"in a?a.applyKmEstacaMask:e(R))(s.data.kmFinal)),1)]),_:1})]),_:1},8,["value"])],64)}}});export{_a as default};
