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