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