var g=(v,E,c)=>new Promise((F,f)=>{var l=t=>{try{p(c.next(t))}catch(s){f(s)}},o=t=>{try{p(c.throw(t))}catch(s){f(s)}},p=t=>t.done?F(t.value):Promise.resolve(t.value).then(l,o);p((c=c.apply(v,E)).next())});import{u as A,F as I}from"./useForm-DFfbRY9m.js";import{u as U}from"./useValidator-dY8qp_qX.js";import{I as h}from"./index-OziN21LA.js";import{p as V,j as m,k as a}from"./element-plus-C2aeItNs.js";import{l as B,aL as M,aK as R,m as i,p as y,F as T,a7 as S,u as n,U as e,q as b,T as j,M as D,R as C,r as N,S as u,Z as O,w as z}from"./vue-chunks-l-AyUCfi.js";const G={class:"w-full"},$={class:"params-index"},q={class:"params-edit flex justify-center items-center"},L=B({__name:"addParams",props:M({formModel:{type:Object,default:()=>({})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(v){const E=o=>{l.value.splice(l.value.indexOf(o),1)},c=()=>{l.value=[...l.value,{value:"",key:""}]},F=o=>{const p=l.value[o];l.value.splice(o,1),l.value.splice(o-1,0,p)},f=o=>{const p=l.value[o];l.value.splice(o,1),l.value.splice(o+1,0,p)};let l=R(v,"modelValue");return(o,p)=>(i(),y("div",G,[(i(!0),y(T,null,S(n(l),(t,s)=>(i(),y("div",{key:s,class:"flex params-box justify-center items-center"},[e(n(V),{modelValue:t.key,"onUpdate:modelValue":d=>t.key=d,style:{width:"44%","margin-right":"6%"},placeholder:"参数名"},null,8,["modelValue","onUpdate:modelValue"]),e(n(V),{modelValue:t.value,"onUpdate:modelValue":d=>t.value=d,style:{width:"44%"},placeholder:"参数值"},null,8,["modelValue","onUpdate:modelValue"]),b("div",$,j(s+1),1),b("div",q,[s+1==n(l).length?(i(),D(n(h),{key:0,size:20,onClick:c,icon:"tdesign:add",class:"cursor-pointer","hover-color":"var(--el-color-primary)"})):C("",!0),s+1!=n(l).length?(i(),D(n(h),{key:1,size:20,onClick:d=>E(s),icon:"tdesign:remove",class:"cursor-pointer","hover-color":"var(--el-color-primary)"},null,8,["onClick"])):C("",!0),e(n(h),{size:20,onClick:d=>f(s),icon:"tdesign:chevron-down",class:"cursor-pointer","hover-color":"var(--el-color-primary)"},null,8,["onClick"]),s!=0?(i(),D(n(h),{key:2,size:20,onClick:d=>F(s),icon:"tdesign:chevron-up",class:"cursor-pointer","hover-color":"var(--el-color-primary)"},null,8,["onClick"])):C("",!0)])]))),128))]))}}),X=B({__name:"Write",props:{currentRow:{type:Object,default:()=>null}},setup(v,{expose:E}){const{required:c,isUrl:F}=U(),f=v,l=N([{field:"label",label:"标签",component:"Input",value:"",colProps:{span:24},componentProps:{clearable:!1}},{field:"customUrl",label:"回调地址",component:"Input",value:"",colProps:{span:24}},{label:"Method:",field:"methods",colProps:{span:24},component:"RadioGroup",value:"GET",componentProps:{rules:[c()],options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"}]}},{field:"moreData",label:"自定义参数",value:[{key:"",value:""}],colProps:{span:24},formItemProps:{slots:{default:r=>e(L,{modelValue:r.moreData,"onUpdate:modelValue":k=>r.moreData=k},null)}},componentProps:{min:0}},{label:"输入参数:",colProps:{span:24},formItemProps:{slots:{default:r=>e("div",{class:"w-full"},[e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("参数")]}),e(a,{span:8},{default:()=>[u("名称")]}),e(a,{span:8},{default:()=>[u("例子")]})]}),e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("uid")]}),e(a,{span:8},{default:()=>[u("用户ID")]}),e(a,{span:8},{default:()=>[u("用来描述用户身份信息唯一ID")]})]}),e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("uname")]}),e(a,{span:8},{default:()=>[u("用户昵称")]}),e(a,{span:8},{default:()=>[u("发消息的用户昵称")]})]}),e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("roomId")]}),e(a,{span:8},{default:()=>[u("群id")]}),e(a,{span:8},{default:()=>[u("发消息的群id")]})]}),e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("roomName")]}),e(a,{span:8},{default:()=>[u("群名")]}),e(a,{span:8},{default:()=>[u("发消息的群名")]})]}),e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("word")]}),e(a,{span:8},{default:()=>[u("用户的问题")]}),e(a,{span:8},{default:()=>[u("用户的提问，比如 在吗？")]})]}),e(m,null,{default:()=>[e(a,{span:8},{default:()=>[u("自定义参数属性")]}),e(a,{span:8},{default:()=>[u("上面自定义的参数")]}),e(a,{span:8},{default:()=>[u("自定义参数的值")]})]})])}}},{label:"输出参数:",formItemProps:{slots:{default:r=>e("p",{class:"m-0"},[u("请按"),e("a",{class:"text-red-600",href:"https://wechat.aibotk.com/docs/callback#%E8%BF%94%E5%9B%9E%E6%95%B0%E6%8D%AE%E8%AF%B4%E6%98%8E",target:"_blank"},[u("文档中的数据结构")]),u("原样返回,否则将无法正常渲染")])}},colProps:{span:24}}]),o=O({customUrl:[c(),F()],tags:[c()]}),{formRegister:p,formMethods:t}=A(),{setValues:s,getFormData:d,getElFormExpose:w,setSchema:x}=t,P=()=>g(this,null,function*(){const r=yield w();if(yield r==null?void 0:r.validate().catch(_=>{}))return yield d()});return z(()=>f.currentRow,r=>{r&&s(r)},{deep:!0,immediate:!0}),E({submit:P}),(r,k)=>(i(),D(n(I),{rules:o,"auto-set-placeholder":!1,onRegister:n(p),schema:l.value},null,8,["rules","onRegister","schema"]))}});export{X as _};
