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