import{A as _,f as h}from"./AddEdit-78MTlGEV.js";import{_ as k,x as w,Z as b,a as T,r as u,e as C,o as a,g as E,f as c,w as s,V as d,F as $,c as n,J as v,p as g,B as S,ah as B}from"./app-DGDivIsO.js";const D=w({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:b,AddEdit:_},setup(e,{emit:p}){const{permsArray:m}=T(),{initData:l,addEditUrl:f}=h(),o=u(!1),r=u("add"),t=u({...l});return{permsArray:m,visible:o,addEditType:r,addEditUrl:f,formData:t,addEditSuccess:()=>{o.value=!1,t.value={...l},p("onAddSuccess")},onClose:()=>{o.value=!1},showAdd:()=>{o.value=!0}}}}),O={key:0};function P(e,p,m,l,f,o){const r=g,t=C("PlusOutlined"),i=S,y=B,A=C("AddEdit");return e.permsArray.includes("warehouses_create")||e.permsArray.includes("admin")?(a(),E("div",O,[e.customType=="menu"?(a(),c(r,{onClick:e.showAdd,key:"customers"},{icon:s(()=>[d(e.$slots,"icon")]),default:s(()=>[d(e.$slots,"default")]),_:3},8,["onClick"])):(a(),E($,{key:1},[e.tooltip?(a(),c(y,{key:0,placement:"topLeft",title:e.$t("warehouse.add"),"arrow-point-at-center":""},{default:s(()=>[n(i,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[n(t)]),default:s(()=>[d(e.$slots,"default")]),_:3},8,["onClick","type"])]),_:3},8,["title"])):(a(),c(i,{key:1,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[n(t)]),default:s(()=>[d(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),n(A,{addEditType:e.addEditType,visible:e.visible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,formData:e.formData,data:e.formData,pageTitle:e.$t("warehouse.add"),successMessage:e.$t("warehouse.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"])])):v("",!0)}const M=k(D,[["render",P]]);export{M as W};
