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