import{_ as M}from"./G7u0egV4.js";import{d as x,O as I,P as U,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,W as O,A as N,h as v,t as h,n as L}from"./JQJBiNWj.js";import{_ as B}from"./DUQr9DrG.js";import{_ as P}from"./gxHWKiUc.js";import{_ as $}from"./D7IyRfqO.js";import j from"./BBDFeM-T.js";import X from"./CJYlvWEf.js";import{U as z}from"./CRodc3LN.js";import{u as W}from"./DncddsCV.js";import{_ as Z}from"./DTOFlTEg.js";import{_ as q}from"./CYDRfonM.js";import{r as S,h as G}from"./CLkB_muw.js";import{a as R}from"./BRY5UTQQ.js";import{D as H}from"./DKM0wLqG.js";import{a as J}from"./BlGPNclf.js";import{T as Q}from"./BKl0aY3w.js";import{u as Y}from"./CL7Msd7o.js";import{u as oo}from"./BfZwoNNq.js";import _ from"./CuNuZBQO.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";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=I(),g=([n,p]=U(()=>c.getEmpresaSelecionada()),n=await n,p(),n),A=W();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=I(),A=([n,p]=U(()=>g.getEmpresaSelecionada()),n=await n,p(),n),u=oo("ativos-cadastros-faixa-dominio-cerca",a=>w.ativos.cadastros.findAllByTipo(A.sigla,Q.FaixaDominioCerca,a));function F(a){(c.value.add||c.value.view)&&L(S(a.data.id.idElemento),G(a))}return(a,f)=>{const m=M,i=N,l=B,b=to,r=Z,d=q;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(H))},{default:t(()=>[o(m,{mode:"add"})]),_:1},8,["to"])]),key:"0"}:void 0]),1024),o(r,{status:e(u).status.value,schema:e(J),"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};
