import{_ as U}from"./Brk5FU9k.js";import{d as b,a as E,o as h,f as o,g as i,w as e,R as A,O as M,P as I,U as w,F as x,i as N,A as O,h as s,t as m,n as K}from"./dVzHJMF1.js";import{_ as P}from"./DDV-HLQE.js";import{_ as V}from"./CPhxMljB.js";import{_ as B}from"./C682XpkB.js";import{r as g,h as L}from"./pI06Dkb8.js";import{a as v}from"./BRY5UTQQ.js";import $ from"./G1F3Bacz.js";import{D as G}from"./CX2DUt_P.js";import{A as _}from"./DJzKbefB.js";import{a as j}from"./CBivZMLc.js";import{u as z}from"./CJ1p9Ehj.js";import{u as Z}from"./BWID9sOX.js";import{_ as q}from"./DSijqxIZ.js";import{_ as H}from"./CfWU_JKz.js";import{_ as J}from"./BqnRxGiA.js";import Q from"./C5Oc2f2M.js";import{A as W}from"./wlXwsacy.js";import{T as X}from"./Byi2WFzI.js";import"./yXj_05M0.js";import"./Bhud8mbC.js";import"./DhLu8RVk.js";import"./CWHHmK0V.js";import"./tESAK1vk.js";import"./B79Hoqpc.js";import"./iZ-xiGRB.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"./B7Hqpkvs.js";import"./DiwqsPB4.js";import"./KcBrPYTF.js";import"./B_Kqq5Cu.js";import"./CBbadgK0.js";import"./a1m94JqE.js";import"./CM8mMzv6.js";import"./DP0doleY.js";import"./BAtzogEJ.js";import"./r1Y5hC84.js";import"./BSe03gVj.js";import"./B-6EeO4n.js";import"./BuQ9u7Je.js";import"./BW5cYMVL.js";import"./CPg0DzIm.js";import"./BphmgIhx.js";import"./ClA_a7pZ.js";import"./D4oUL8iA.js";import"./Bpf-t_rp.js";import"./yHxjwlra.js";import"./KG16xCEZ.js";import"./RwcpOhWN.js";import"./B-d7gz-d.js";import"./BSLzRQpY.js";import"./CNJ8Vm0G.js";import"./FcRkkR--.js";import"./DYJY2RZG.js";import"./Coj9p228.js";import"./BNYh59m7.js";import"./CrEL4Vxb.js";import"./CYvl7uw_.js";import"./cMkL48JQ.js";import"./fvoe36K6.js";const Y={class:"base-grid grid lg:grid-cols-4 grid-cols-2"},oo=b({__name:"Filtros",setup(S){return(p,f)=>{const l=q,u=H,c=J,d=Q;return h(),E("div",Y,[o(l,{"tipo-ativo":i(_).TipoAtivo.Drenagem},null,8,["tipo-ativo"]),o(c,{name:"sigla",label:"Sigla:"},{default:e(()=>[o(u,{name:"sigla","campo-referencia":"idSigla","tipo-ativo":i(_).TipoAtivo.Drenagem,multi:""},null,8,["tipo-ativo"])]),_:1}),o(c,{name:"classificacao",label:"Classificação:"},{default:e(()=>[o(d,{id:"classificacao",name:"classificacao",options:i(W).TIPO_CLASSIFICACAO_DRENAGEM,"option-label":"label","option-value":"value",placeholder:"Selecione...","show-clear":"","show-toggle-all":!1,filter:""},null,8,["options"])]),_:1})])}}}),to=Object.assign(oo,{__name:"AtivosElementoDrenagemFiltros"}),bt=b({__name:"index",async setup(S){let p,f;const l=z({view:A.ATV_VISUALIZAR_CADASTRO_DRENAGEM,add:A.ATV_EDITAR_CADASTRO_DRENAGEM}),u=M(),c=([p,f]=I(()=>u.getEmpresaSelecionada()),p=await p,f(),p),d=Z("ativos-cadastros-drenagem",a=>N.ativos.cadastros.findAllByTipo(c.sigla,X.Drenagem,a));function D(a){return a&&a.charAt(0).toUpperCase()+a.slice(1)}function R(a){(l.value.view||l.value.add)&&K(g(a.data.id.idElemento),L(a))}return(a,ao)=>{const C=U,T=O,y=P,k=V,r=$,F=B;return h(),E(x,null,[o(y,{title:"Cadastros - Drenagem/OAC"},w({_:2},[i(l).add?{name:"title-buttons",fn:e(()=>[o(T,{to:("resolveRelativeRoute"in a?a.resolveRelativeRoute:i(g))(i(G))},{default:e(()=>[o(C,{mode:"add"})]),_:1},8,["to"])]),key:"0"}:void 0]),1024),o(k,{status:i(d).status.value,schema:i(j),"paginated-url":""},{default:e(()=>[o(i(to))]),_:1},8,["status","schema"]),o(F,{value:i(d),onRowClick:R},{default:e(()=>[o(r,{field:"codigo",header:"Identificação",sortable:""}),o(r,{field:"classificacao",header:"Classificação",sortable:""},{body:e(t=>[s(m(D(t.data.classificacao)),1)]),_:1}),o(r,{field:"tipoElemento.descricao",header:"Tipo",sortable:""},{body:e(t=>{var n;return[s(m((n=t.data.tipoElemento)==null?void 0:n.descricao),1)]}),_:1}),o(r,{field:"sigla",header:"Sigla",sortable:""},{body:e(t=>{var n;return[s(m(((n=t.data.sigla)==null?void 0:n.nome)||"Não se aplica"),1)]}),_:1}),o(r,{field:"rodovia",header:"Rodovia",sortable:"","sort-field":"rodovia.descricao"},{body:e(t=>{var n;return[s(m((n=t.data.rodovia)==null?void 0:n.descricao),1)]}),_:1}),o(r,{field:"uf",header:"UF",sortable:""},{body:e(t=>[s(m(t.data.uf),1)]),_:1}),o(r,{field:"kmInicial",header:"KM inicial",sortable:""},{body:e(t=>[s(m(("applyKmEstacaMask"in a?a.applyKmEstacaMask:i(v))(t.data.kmInicial)),1)]),_:1}),o(r,{field:"kmFinal",header:"KM final",sortable:""},{body:e(t=>[s(m(("applyKmEstacaMask"in a?a.applyKmEstacaMask:i(v))(t.data.kmFinal)),1)]),_:1}),o(r,{field:"sentido",header:"Sentido",sortable:""},{body:e(t=>[s(m(i(_).Enums.TipoSentido[t.data.sentido]),1)]),_:1}),o(r,{field:"direcao",header:"Direção",sortable:""},{body:e(t=>[s(m(i(_).Enums.TipoDirecao[t.data.direcao]),1)]),_:1})]),_:1},8,["value"])],64)}}});export{bt as default};
