import{_ as a}from"./index105.js?v=1761009159";import{l as t,b as e}from"./utils-lib.js?v=1761009159";import{getJavaSpringProject as s,groupAddProjects as r}from"./site.js?v=1761009159";import{c as o,r as i,bV as n,H as l,v as c,x as m,e as p,B as u,I as d,y as f}from"./base-lib.js?v=1761009159";import{a as h}from"./column.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const j={class:"p-[2rem]"},v=o({__name:"group-add-projects",props:{compData:{}},emits:["close"],setup(o,{expose:v,emit:_}){const g=o,b=e(),y=_,x=i([]),D=i(!1),w=i([]),C=[h(),{prop:"name",label:"项目名称"}],H=a=>{w.value=a.map(a=>a.id)};return n(async()=>{try{D.value=!0;const a=(a=>{const t=g.compData.projectList.map(a=>a.id);return a.filter(a=>!t.includes(a.id))})((await s()).data);if(0===a.length)return b.error("暂无可用项目"),void y("close");x.value=a}catch(a){}finally{D.value=!1}}),v({onConfirm:async()=>{try{if(0===w.value.length)return void b.error("请选择项目");const a=await r({group_id:g.compData.group_id,project_ids:JSON.stringify(w.value)});b.request(a),a.status&&(y("close"),g.compData.refreshEvent())}catch(a){}}}),(e,s)=>{const r=t,o=a,i=l("bt-loading");return c(),m("div",j,[p(o,null,{"header-left":u(()=>s[0]||(s[0]=[])),"header-right":u(()=>s[1]||(s[1]=[])),content:u(()=>[d(p(r,{"max-height":300,column:C,data:f(x),onSelectionChange:H},null,8,["data"]),[[i,f(D)]])]),"footer-left":u(()=>s[2]||(s[2]=[])),_:1})])}}});export{v as default};
