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