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