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