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