import{h as $,y as F,r as I,p as i,M as d,N as r,a6 as f,l as N,W as b,V as c,k as e,o as V,q as m,m as _,a0 as v,$ as y,a4 as z,a2 as B,an as P,t as p,a7 as u}from"./vue-a39e6937.js";import{f as W}from"./index-ba596ae9.js";import{F as s}from"./index-f0d8af94.js";import{b as K}from"./validate-4ecec794.js";const T={class:"title"},L=$({__name:"popupForm",setup(q){const n=F(),t=P("baTable"),{t:o}=W(),k=I({code:[K({name:"required",title:o("sms.template.code")})]});return(E,l)=>{const x=p("el-form"),C=p("el-scrollbar"),g=p("el-button"),w=p("el-dialog"),S=u("drag"),h=u("zoom"),D=u("loading"),U=u("blur");return i(),d(w,{class:"ba-operate-dialog","close-on-click-modal":!1,"model-value":!!e(t).form.operate,onClose:e(t).toggleForm,width:"50%"},{header:r(()=>[f((i(),N("div",T,[b(c(e(t).form.operate?e(o)(e(t).form.operate):""),1)])),[[S,[".ba-operate-dialog",".el-dialog__header"]],[h,".ba-operate-dialog"]])]),footer:r(()=>[V("div",{style:_("width: calc(100% - "+e(t).form.labelWidth/1.8+"px)")},[m(g,{onClick:l[9]||(l[9]=a=>e(t).toggleForm(""))},{default:r(()=>[b(c(e(o)("Cancel")),1)]),_:1}),f((i(),d(g,{loading:e(t).form.submitLoading,onClick:l[10]||(l[10]=a=>e(t).onSubmit(n.value)),type:"primary"},{default:r(()=>[b(c(e(t).form.operateIds&&e(t).form.operateIds.length>1?e(o)("Save and edit next item"):e(o)("Save")),1)]),_:1},8,["loading"])),[[U]])],4)]),default:r(()=>[f((i(),d(C,{class:"ba-table-form-scrollbar"},{default:r(()=>[V("div",{class:B(["ba-operate-form","ba-"+e(t).form.operate+"-form"]),style:_("width: calc(100% - "+e(t).form.labelWidth/2+"px)")},[e(t).form.loading?z("",!0):(i(),d(x,{key:0,ref_key:"formRef",ref:n,onKeyup:l[8]||(l[8]=v(a=>e(t).onSubmit(n.value),["enter"])),model:e(t).form.items,"label-position":"right","label-width":e(t).form.labelWidth+"px",rules:k},{default:r(()=>[m(s,{label:e(o)("sms.template.title"),type:"string",modelValue:e(t).form.items.title,"onUpdate:modelValue":l[0]||(l[0]=a=>e(t).form.items.title=a),prop:"title","input-attr":{placeholder:e(o)("Please input field",{field:e(o)("sms.template.title")})}},null,8,["label","modelValue","input-attr"]),m(s,{label:e(o)("sms.template.code"),type:"string",modelValue:e(t).form.items.code,"onUpdate:modelValue":l[1]||(l[1]=a=>e(t).form.items.code=a),prop:"code",attr:{"block-help":"可在业务代码中使用唯一标识调取本模板发送短信"},"input-attr":{placeholder:e(o)("Please input field",{field:e(o)("sms.template.code")})}},null,8,["label","modelValue","input-attr"]),m(s,{label:e(o)("sms.template.content"),type:"textarea",modelValue:e(t).form.items.content,"onUpdate:modelValue":l[2]||(l[2]=a=>e(t).form.items.content=a),prop:"content",onKeyup:[l[3]||(l[3]=v(y(()=>{},["stop"]),["enter"])),l[4]||(l[4]=v(y(a=>e(t).onSubmit(n.value),["ctrl"]),["enter"]))],attr:{"block-help":"可使用模板变量：${var_name}"},"input-attr":{placeholder:"有的服务商需要使用短信内容来发送短信，请按需填写"}},null,8,["label","modelValue"]),m(s,{label:e(o)("sms.template.template"),type:"string",modelValue:e(t).form.items.template,"onUpdate:modelValue":l[5]||(l[5]=a=>e(t).form.items.template=a),prop:"template",attr:{"block-help":"有的服务商需要使用模板ID来发送短信，请按需填写"},"input-attr":{placeholder:e(o)("Please input field",{field:e(o)("sms.template.template")})}},null,8,["label","modelValue","input-attr"]),m(s,{label:e(o)("sms.template.variables"),type:"remoteSelect",modelValue:e(t).form.items.variables,"onUpdate:modelValue":l[6]||(l[6]=a=>e(t).form.items.variables=a),prop:"variables","input-attr":{multiple:!0,field:"title","remote-url":"/admin/sms.variable/index",placeholder:e(o)("Please select field",{field:e(o)("sms.template.variables")})},attr:{"block-help":"您可以完整的填写短信内容，也可以直接在此选择模板使用到的变量"}},null,8,["label","modelValue","input-attr"]),m(s,{label:e(o)("state"),modelValue:e(t).form.items.status,"onUpdate:modelValue":l[7]||(l[7]=a=>e(t).form.items.status=a),type:"radio",data:{content:{0:e(o)("Disable"),1:e(o)("Enable")},childrenAttr:{border:!0}}},null,8,["label","modelValue","data"])]),_:1},8,["model","label-width","rules"]))],6)]),_:1})),[[D,e(t).form.loading]])]),_:1},8,["model-value","onClose"])}}});export{L as _};
