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