import{h as B,y as D,r as I,p as i,M as n,N as r,a6 as f,l as P,W as c,V as b,k as e,o as v,q as s,m as _,a0 as g,$ as V,a4 as w,a2 as U,an as W,t as d,a7 as p}from"./vue-a39e6937.js";import{f as q}from"./index-ba596ae9.js";import{F as u}from"./index-f0d8af94.js";import{b as h}from"./validate-4ecec794.js";const K={class:"title"},A=B({__name:"popupForm",setup(M){const m=D(),t=W("baTable"),{t:o}=q(),k=I({title:[h({name:"required",title:o("routine.notice.title")})],type:[h({name:"required",title:o("routine.notice.type")})]});return(T,l)=>{const C=d("el-form"),x=d("el-scrollbar"),y=d("el-button"),S=d("el-dialog"),F=p("drag"),N=p("zoom"),$=p("loading"),z=p("blur");return i(),n(S,{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(),P("div",K,[c(b(e(t).form.operate?e(o)(e(t).form.operate):""),1)])),[[F,[".ba-operate-dialog",".el-dialog__header"]],[N,".ba-operate-dialog"]])]),footer:r(()=>[v("div",{style:_("width: calc(100% - "+e(t).form.labelWidth/1.8+"px)")},[s(y,{onClick:l[7]||(l[7]=a=>e(t).toggleForm(""))},{default:r(()=>[c(b(e(o)("Cancel")),1)]),_:1}),f((i(),n(y,{loading:e(t).form.submitLoading,onClick:l[8]||(l[8]=a=>e(t).onSubmit(m.value)),type:"primary"},{default:r(()=>[c(b(e(t).form.operateIds&&e(t).form.operateIds.length>1?e(o)("Save and edit next item"):e(o)("Save")),1)]),_:1},8,["loading"])),[[z]])],4)]),default:r(()=>[f((i(),n(x,{class:"ba-table-form-scrollbar"},{default:r(()=>[v("div",{class:U(["ba-operate-form","ba-"+e(t).form.operate+"-form"]),style:_("width: calc(100% - "+e(t).form.labelWidth/2+"px)")},[e(t).form.loading?w("",!0):(i(),n(C,{key:0,ref_key:"formRef",ref:m,onKeyup:l[6]||(l[6]=g(a=>e(t).onSubmit(m.value),["enter"])),model:e(t).form.items,"label-position":"right","label-width":e(t).form.labelWidth+"px",rules:k},{default:r(()=>[s(u,{label:e(o)("routine.notice.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)("routine.notice.title")})}},null,8,["label","modelValue","input-attr"]),s(u,{label:e(o)("routine.notice.type"),type:"radio",modelValue:e(t).form.items.type,"onUpdate:modelValue":l[1]||(l[1]=a=>e(t).form.items.type=a),prop:"type",data:{content:{0:e(o)("routine.notice.type 0"),1:e(o)("routine.notice.type 1")}},"input-attr":{placeholder:e(o)("Please select field",{field:e(o)("routine.notice.type")})}},null,8,["label","modelValue","data","input-attr"]),s(u,{label:e(o)("routine.notice.content"),type:"editor",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]=g(V(()=>{},["stop"]),["enter"])),l[4]||(l[4]=g(V(a=>e(t).onSubmit(m.value),["ctrl"]),["enter"]))],"input-attr":{placeholder:e(o)("Please input field",{field:e(o)("routine.notice.content")})}},null,8,["label","modelValue","input-attr"]),e(t).form.operate=="edit"?(i(),n(u,{key:0,label:e(o)("routine.notice.weigh"),type:"number",prop:"weigh",modelValue:e(t).form.items.weigh,"onUpdate:modelValue":l[5]||(l[5]=a=>e(t).form.items.weigh=a),modelModifiers:{number:!0},"input-attr":{step:"1",placeholder:e(o)("Please input field",{field:e(o)("routine.notice.weigh")})}},null,8,["label","modelValue","input-attr"])):w("",!0)]),_:1},8,["model","label-width","rules"]))],6)]),_:1})),[[$,e(t).form.loading]])]),_:1},8,["model-value","onClose"])}}});export{A as _};
