import{F as h,M as C,aJ as T,r as F,I as M,W as B}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897314.js";import"./index.1703796278973312.js";import{s as J}from"./config.1703796278973.js";import{d as S,k as U,v as q,w as I,o as f,c as p,a as r,b as u,u as t,B as x}from"./vue.1703796278973.js";const G=S({__name:"output",props:{data:{default:""}},emits:["closeModel","saveSuc"],setup(w,{emit:_}){const o=w,k=U();h.useForm;let e=q({status:!1,address:"",topic:""});I(()=>{var l,a,n,c,d,i,m,s,v,g,b;e.status=((n=(a=(l=o.data)==null?void 0:l.data)==null?void 0:a.state)==null?void 0:n.value)==="enabled",e.address=(m=(i=(d=(c=o.data)==null?void 0:c.data)==null?void 0:d.config)==null?void 0:i.config)==null?void 0:m.address,e.topic=(b=(g=(v=(s=o.data)==null?void 0:s.data)==null?void 0:v.config)==null?void 0:g.config)==null?void 0:b.topic});const y=()=>{_("closeModel")},j=()=>{k.value.validateFields().then(()=>{var l,a;J({config:{sourceType:"kafka",config:{...e,state:e!=null&&e.status?"enabled":"disable"}},state:e!=null&&e.status?"enabled":"disable",id:(a=(l=o==null?void 0:o.data)==null?void 0:l.data)==null?void 0:a.id,sourceType:"kafka",exchangeType:"producer"}).then(n=>{n.status===200&&(C.success("操作成功"),_("saveSuc"))})})};return(l,a)=>{const n=T,c=F,d=M,i=h,m=B;return f(),p(m,{maskClosable:!1,width:"45vw",title:"编辑",onCancel:y,onOk:j,visible:"",cancelText:"取消",okText:"确定"},{default:r(()=>[u(i,{layout:"vertical",model:t(e),ref_key:"formRef",ref:k},{default:r(()=>[u(c,{label:"状态"},{default:r(()=>[u(n,{"checked-children":"启用","un-checked-children":"启用",checked:t(e).status,"onUpdate:checked":a[0]||(a[0]=s=>t(e).status=s)},null,8,["checked"])]),_:1}),t(e).status?(f(),p(c,{key:0,label:"kafka地址",name:"address",rules:[{required:!0,message:"请输入kafka地址"},{max:64,message:"最多输入64个字符"}]},{default:r(()=>[u(d,{value:t(e).address,"onUpdate:value":a[1]||(a[1]=s=>t(e).address=s),placeholder:"请输入kafka地址"},null,8,["value"])]),_:1})):x("",!0),t(e).status?(f(),p(c,{key:1,label:"topic",name:"topic",rules:[{required:!0,message:"请输入topic"},{max:64,message:"最多输入64个字符"}]},{default:r(()=>[u(d,{value:t(e).topic,"onUpdate:value":a[2]||(a[2]=s=>t(e).topic=s)},null,8,["value"])]),_:1})):x("",!0)]),_:1},8,["model"])]),_:1})}}});export{G as _};
