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