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