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