import{r as h,o as n,g as u,u as a,F as k,D as C,c as G,w as b,a as r,f as p,t as $,i as l,h as c,b as x,L as y}from"./app-SC54XQDl.js";import{u as B}from"./app-Ba7ZqSpq.js";import{T as N}from"./app-DoVkxbmA.js";const S={key:0,class:"label-group"},V=["value"],w=["onClick"],I=r("i",{class:"icon remove"},null,-1),L=[I],j={__name:"ServerGroupSelector",props:["v-groups"],setup(d){const i=B(),v=d,{groups:t}=function(){let e=v.vGroups;return e==null&&(e=[]),{groups:h(e)}}(),f=function(){let e=t.value.map(function(o){return o.id.toString()}).join(",");i.popup("/servers/groups/selectPopup?selectedGroupIds="+e,{callback:function(o){t.value.push(o.data.group)}})},m=function(){i.popup("/servers/groups/createPopup",{callback:function(e){t.value=[],t.value.push(e.data.group)}})},g=function(e){t.value.$remove(e)};return(e,o)=>(n(),u("div",null,[a(t).length>0?(n(),u("div",S,[a(t).length>0?(n(!0),u(k,{key:0},C(a(t),(s,_)=>(n(),G(N,{outlined:""},{default:b(()=>[r("input",{type:"hidden",name:"groupIds",value:s.id},null,8,V),p(" "+$(s.name)+"  ",1),r("a",{href:"",title:"删除",onClick:l(T=>g(_),["prevent"])},L,8,w)]),_:2},1024))),256)):c("",!0),x(y)])):c("",!0),r("div",null,[r("a",{href:"",onClick:o[0]||(o[0]=l(s=>f(),["prevent"]))},"[选择分组]"),p("   "),r("a",{href:"",onClick:o[1]||(o[1]=l(s=>m(),["prevent"]))},"[添加分组]")])]))}};export{j as _};
