PageSourceSearch

https://dom.santanadomaranhao.ma.gov.br/build/assets/FaqForm-QXoCz-lf.js

js santanadomaranhao.ma.gov.br collected 2026-09-25 02:07:31 UTC 4,196 bytes, 1 lines download raw bytes

1import{d as h,G as g,i as y,r as m,D as k,a as u,t as q,z as p,o as a,l as e,w as V,p as f,v as F,Z as I,k as d,I as C,K as D,E as R,n as S,s as l}from"./app-GC03Gq4U.js";import{_ as U}from"./Layout.vue_vue_type_script_setup_true_lang-OjQXUhnG.js";import{I as _}from"./IconLoading-nChL0Y9u.js";import{_ as z}from"./Editor.vue_vue_type_style_index_0_lang-7fn1MnTp.js";import{s as x}from"./show-error-zM9JovDt.js";import{s as v}from"./show-success--uwFjSj5.js";import{u as B}from"./use-user-faq-validation.composable-XuquMx7G.js";import"./index-7hMjYadJ.js";import"./index-423UCd14.js";import"./index-L_JWdKAj.js";import"./logo-VLooSubU.js";import"./index-xsBlUFEN.js";import"./index.esm-eq4vbLAy.js";import"./_commonjsHelpers-4gQjN7DL.js";import"./use-validation.composable-WMHtkYOX.js";const E={class:"flex-grow flex flex-row flex-wrap"},M={class:"animate__animated animate__slideInUp animate__faster w-full bg-white rounded-md shadow-sm p-5 flex flex-col"},j={class:"border border-black/10 w-full p-4"},A={class:"flex flex-row items-start justify-start flex-wrap w-full"},N=e("div",{class:"px-2 w-full"},[e("div",{class:"border-b border-black/10 pb-1 mb-2"},[e("span",{class:"font-medium text-xs text-black/80"},"Identificação")])],-1),P={class:"w-full flex flex-wrap"},L={class:"w-full md:w-9/12 p-2 flex flex-wrap"},$=e("span",{class:"text-xs text-black font-semibold group-hover:text-primary duration-500"},"Pergunta",-1),G={class:"w-full md:w-3/12 p-2 flex flex-wrap"},K=e("span",{class:"text-xs text-black font-semibold group-hover:text-primary duration-500"},"Ordem",-1),O=e("option",{value:0,disabled:"",hidden:""},"Selecione",-1),T=["value"],Z={class:"group w-full p-2 flex flex-col"},H=e("span",{class:"text-xs text-black font-semibold group-hover:text-primary duration-500"},"Resposta",-1),J={key:0,class:"group w-full p-2 flex justify-end border-t mt-4 pt-4"},Q={class:"text-xs font-bold bg-primary duration-500 h-10 w-28 rounded-md text-white"},W={key:0},X={key:1,class:"group w-full p-2 flex justify-end border-t mt-4 pt-4"},Y={class:"text-xs font-bold bg-primary duration-500 h-10 w-28 rounded-md text-white"},ee={key:0},be=h({__name:"FaqForm",setup(te){B();const n=g(),c=y(),r=m(!1),s=m({...{id:0,question:"",answer:"",order:0}}),b=async()=>{var i;if(+((i=n.params)==null?void 0:i.id)&&+n.params.id>0)try{const o=await p.get("user-faqs/"+n.params.id);if(o.status===200){const t=o.data.data.item;s.value={id:t.id||0,question:t.question||"",answer:t.answer||"",order:t.order||0}}}catch(o){return x(o),c.push("/dashboard/informacoes-institucionais/faq")}},w=async()=>{r.value=!0;try{if((await p.post("user-faqs",{...s.value,report_id:s.value.id})).status===200)return s.value.id==0?v("Cadastrado com sucesso","Registro cadastrado com sucesso"):v("Atualizado com sucesso","Registro atualizado com sucesso"),c.push("/dashboard/informacoes-institucionais/faq")}catch(i){x(i)}finally{r.value=!1}};return k(()=>{b()}),(i,o)=>(a(),u(U,{title:s.value.id>0?"Editar Pergunta":"Adicionar Pergunta"},{default:q(()=>[e("div",E,[e("div",M,[e("div",j,[e("form",{onSubmit:V(w,["prevent"]),class:"w-full"},[e("div",A,[N,e("div",P,[e("div",L,[$,f(e("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=t=>s.value.question=t),class:"p-2 h-9 rounded-md bg-black/5 mt-1 text-xs text-black outline-0 border border-black/10 group-hover:border-primary duration-500 w-full"},null,512),[[F,s.value.question]])]),e("div",G,[K,f(e("select",{"onUpdate:modelValue":o[1]||(o[1]=t=>s.value.order=t),class:"p-2 h-9 rounded-md bg-black/5 mt-1 text-xs text-black outline-0 border border-black/10 group-hover:border-primary duration-500 w-full"},[O,(a(),d(R,null,C(100,t=>e("option",{key:t,value:t},D(t),9,T)),64))],512),[[I,s.value.order]])]),e("div",Z,[H,S(z,{modelValue:s.value.answer,"onUpdate:modelValue":o[2]||(o[2]=t=>s.value.answer=t)},null,8,["modelValue"])])])]),s.value.id==0?(a(),d("div",J,[e("button",Q,[r.value?l("",!0):(a(),d("span",W,"Cadastrar")),r.value?(a(),u(_,{key:1})):l("",!0)])])):l("",!0),s.value.id!=0?(a(),d("div",X,[e("button",Y,[r.value?l("",!0):(a(),d("span",ee,"Atualizar")),r.value?(a(),u(_,{key:1})):l("",!0)])])):l("",!0)],32)])])])]),_:1},8,["title"]))}});
1export{be as default};

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.