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