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