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