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