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