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