1import{d as D,f as R,bZ as j,S as T,r as s,D as B,j as N,k as p,a as $,t as E,m as q,s as m,n as h,E as z,z as y,o as n,l as a,p as f,bE as g,v as L,w as P,e as O,_ as Z}from"./app-rHguuL5e.js";import{_ as G}from"./Layout.vue_vue_type_script_setup_true_lang-LfRyzQeH.js";import{s as k}from"./show-error-ODmFk4VX.js";import{s as I}from"./show-success-jYkIZIbz.js";import"./index-7hMjYadJ.js";import"./index-423UCd14.js";import"./index-L_JWdKAj.js";import"./logo-VLooSubU.js";const H={class:"flex flex-row items-start justify-start flex-wrap w-full mt-5"},J={class:"group w-full md:w-6/12 px-3 pb-3 flex flex-col"},K=a("span",{class:"text-[10px] text-black font-semibold group-hover:text-primary duration-500"},"Selecione o arquivo",-1),Q={class:"flex-grow flex flex-row flex-wrap"},W={class:"animate__animated animate__slideInUp animate__faster w-full bg-white rounded-md shadow-sm p-5 flex flex-col"},X=a("p",{class:"text-xs text-black/70 mb-4"}," Configure os links para as regulamentações da Lei de Acesso à Informação (LAI) nos âmbitos Estadual, Federal e Municipal. ",-1),Y={class:"w-full flex flex-wrap"},ee={class:"w-full p-2"},ae={class:"flex items-center space-x-2"},le=a("label",{for:"lai_estadual",class:"text-xs text-black group-hover:text-primary duration-500"},"Exibir Regulamentação da LAI Estadual",-1),te={key:0,class:"w-full md:w-6/12 p-2 flex flex-row items-center"},se=["disabled"],oe={class:"w-full p-2"},ie={class:"flex items-center space-x-2"},ne=a("label",{for:"lai_federal",class:"text-xs text-black group-hover:text-primary duration-500"},"Exibir Regulamentação da LAI Federal",-1),de={key:0,class:"w-full md:w-6/12 p-2 flex flex-row items-center"},re=["disabled"],ue={class:"w-full p-2"},ce={class:"flex items-center space-x-2"},pe=a("label",{for:"lai_municipal",class:"text-xs text-black group-hover:text-primary duration-500"},"Exibir Regulamentação da LAI Municipal",-1),me={key:0,class:"w-full md:w-6/12 p-2 flex flex-row items-center"},fe=["disabled"],_e={class:"w-full flex flex-col md:flex-row justify-end items-center mt-8 pr-2"},ve=["disabled"],xe={key:0,class:"text-white font-semibold text-xs"},be={key:1,class:"animate-spin"},Ie=D({__name:"RegulamentacaoLai",setup(he){R(T,j);const V=O(()=>Z(()=>import("./ModalCreate-6v2Q2wYb.js"),__vite__mapDeps([0,1,2]))),d=s(!1),_=s(""),r=s(!1),v=s(""),u=s(!1),x=s(""),C=s(0),A=s(0),o=s(!1),c=s(!1),w=s(null),b=s("municipal"),M=t=>{w.value=t.target.files[0]},U=async()=>{o.value=!0;const t=new FormData;if(!w.value){k("Nenhum arquivo selecionado");return}t.append("file",w.value);try{const e=await y.post("uploads/document",t);if(e.status===200){I("Tudo certo!","Arquivo enviado com sucesso");const i=e.data.data.url;b.value==="estadual"?(d.value=!0,_.value=i):b.value==="federal"?(r.value=!0,v.value=i):(u.value=!0,x.value=i),w.value=null,c.value=!1}}catch(e){k(e)}finally{o.value=!1}},F=async()=>{o.value=!0;try{(await y.post("sic/settings",{department_id:C.value,position_id:A.value,show_lai_estadual:d.value,link_lai_estadual:_.value,show_lai_federal:r.value,link_lai_federal:v.value,show_lai_municipal:u.value,link_lai_municipal:x.value})).status===200&&I("Tudo certo!","Regulamentação atualizada com sucesso")}catch(t){k(t)}finally{o.value=!1}},S=async()=>{try{const t=await y.get("sic/settings");if(t.status===200){const e=t.data.data;C.value=e.department_id||0,A.value=e.position_id||0,e.link_lai_estadual&&(d.value=!0,_.value=e.link_lai_estadual),e.link_lai_federal&&(r.value=!0,v.value=e.link_lai_federal),e.link_lai_municipal&&(u.value=!0,x.value=e.link_lai_municipal)}}catch(t){k(t)}};return B(()=>{S()}),(t,e)=>{const i=N("v-icon");return n(),p(z,null,[c.value?(n(),$(q(V),{key:0,handleClose:()=>c.value=!1,handleSubmit:U,loading:o.value?"create":"",modalType:"create"},{default:E(()=>[a("div",H,[a("div",J,[K,a("input",{type:"file",class:"p-2 h-9 rounded-md bg-black/5 mt-2 text-xs text-black outline-0 border border-black/10 group-hover:border-primary duration-500 w-full",onChange:M},null,32)])])]),_:1},8,["handleClose","loading"])):m("",!0),h(G,{title:"Regulamentação da LAI"},{default:E(()=>[a("form",{class:"w-full",onSubmit:P(F,["prevent"])},[a("div",Q,[a("div",W,[X,a("div",Y,[a("div",ee,[a("div",ae,[f(a("input",{type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),id:"lai_estadual",class:"rounded"},null,512),[[g,d.value]]),le]),d.value?(n(),p("div",te,[f(a("input",{placeholder:"Link para a LAI Estadual","onUpdate:modelValue":e[1]||(e[1]=l=>_.value=l),type:"text",class:"p-2 h-9 rounded-md bg-black/5 mt-2 text-xs text-black outline-0 border border-black/10 group-hover:border-primary duration-500 w-full"},null,512),[[L,_.value]]),a("button",{disabled:o.value,onClick:e[2]||(e[2]=l=>{b.value="estadual",c.value=!0}),type:"button",class:"h-9 mt-2 ml-3 w-10 rounded-md bg-primary flex items-center justify-center"},[h(i,{name:"la-file-upload-solid",scale:"1.2",class:"text-white"})],8,se)])):m("",!0)]),a("div",oe,[a("div",ie,[f(a("input",{type:"checkbox","onUpdate:modelValue":e[3]||(e[3]=l=>r.value=l),id:"lai_federal",class:"rounded"},null,512),[[g,r.value]]),ne]),r.value?(n(),p("div",de,[f(a("input",{placeholder:"Link para a LAI Federal","onUpdate:modelValue":e[4]||(e[4]=l=>v.value=l),type:"text",class:"p-2 h-9 rounded-md bg-black/5 mt-2 text-xs text-black outline-0 border border-black/10 group-hover:border-primary duration-500 w-full"},null,512),[[L,v.value]]),a("button",{disabled:o.value,onClick:e[5]||(e[5]=l=>{b.value="federal",c.value=!0}),type:"button",class:"h-9 mt-2 ml-3 w-10 rounded-md bg-primary flex items-center justify-center"},[h(i,{name:"la-file-upload-solid",scale:"1.2",class:"text-white"})],8,re)])):m("",!0)]),a("div",ue,[a("div",ce,[f(a("input",{type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=l=>u.value=l),id:"lai_municipal",class:"rounded"},null,512),[[g,u.value]]),pe]),u.value?(n(),p("div",me,[f(a("input",{placeholder:"Link para a LAI Municipal","onUpdate:modelValue":e[7]||
1(e[7]=l=>x.value=l),type:"text",class:"p-2 h-9 rounded-md bg-black/5 mt-2 text-xs text-black outline-0 border border-black/10 group-hover:border-primary duration-500 w-full"},null,512),[[L,x.value]]),a("button",{disabled:o.value,onClick:e[8]||(e[8]=l=>{b.value="municipal",c.value=!0}),type:"button",class:"h-9 mt-2 ml-3 w-10 rounded-md bg-primary flex items-center justify-center"},[h(i,{name:"la-file-upload-solid",scale:"1.2",class:"text-white"})],8,fe)])):m("",!0)])]),a("div",_e,[a("button",{disabled:o.value,class:"w-48 bg-primary text-white rounded-md shadow-md h-8"},[o.value?m("",!0):(n(),p("span",xe,"Atualizar")),o.value?(n(),p("div",be,[h(i,{name:"si-spinrilla",scale:"0.7",class:"text-white text-xs duration-500"})])):m("",!0)],8,ve)])])])],32)]),_:1})],64)}}});export{Ie as default}; 2function __vite__mapDeps(indexes) { 3 if (!__vite__mapDeps.viteFileDeps) { 4 __vite__mapDeps.viteFileDeps = ["assets/ModalCreate-6v2Q2wYb.js","assets/app-rHguuL5e.js","assets/app-foF1wa47.css"] 5 } 6 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 7}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.