import{n as t,Q as a,b as e,l as s}from"./utils-lib.js?v=1761009159";import{_ as r}from"./index105.js?v=1761009159";import{c as o,r as n,aD as c,q as p,H as i,v as l,x as u,e as m,B as _,C as d,I as h,y as j,G as f}from"./base-lib.js?v=1761009159";import{u as g}from"./column.js?v=1761009159";import{delJavaGroup as y,getJavaGroupList as b}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const w={class:"p-2rem"},v=o({__name:"index",setup(o){const v=e(),E=n([{name:"test",status:"启动",projects:[]}]),x=n(!1),D=[{prop:"group_name",label:"组名"},{prop:"projects",label:"包含项目",width:250,render:t=>t.projects.map(t=>t.name).join("，")},{prop:"status",label:"项目状态",render:t=>{let a={succeeded:0,failed:0,waiting:0,not_run:0};const e=[];switch(t.now_operation){case"start":e.push("启动操作运行中");break;case"stop":e.push("停止操作运行中")}return t.projects&&t.projects.length>0&&(t.projects.forEach(t=>{a.hasOwnProperty(t.project_status)&&a[t.project_status]++}),a.succeeded>0&&e.push("正常运行".concat(a.succeeded,"个")),a.failed>0&&e.push("运行异常".concat(a.failed,"个")),a.not_run>0&&e.push("未运行".concat(a.not_run,"个")),a.wait>0&&e.push("".concat(a.wait,"个项目启动中"))),c("span",e.length?e.join("，"):"--")}},g([{onClick:e=>{t({isAsync:!0,title:"项目组【".concat(e.group_name,"】管理"),area:84,component:()=>a(()=>import("./group-detail.js?v=1761009159").then(t=>t.g),__vite__mapDeps([]),import.meta.url),compData:{...e,refreshEvent:A}})},title:"管理"},{onClick:async t=>{try{const a=await y({group_id:t.group_id});v.request(a),A()}catch(a){}},title:"删除"}])],k=async()=>{t({isAsync:!0,title:"添加项目组",area:50,btn:"确定",component:()=>a(()=>import("./add-group.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:{refreshEvent:A}})},A=async()=>{try{x.value=!0;const t=await b();t.status?E.value=t.data:v.error(t.msg)}catch(t){}finally{x.value=!1}};return p(async()=>{await A()}),(t,a)=>{const e=f,o=s,n=r,c=i("bt-loading");return l(),u("div",w,[m(n,null,{"header-left":_(()=>[m(e,{type:"primary",onClick:k},{default:_(()=>a[0]||(a[0]=[d("添加分组",-1)])),_:1,__:[0]})]),"header-right":_(()=>a[1]||(a[1]=[])),content:_(()=>[h(m(o,{maxHeight:"300",column:D,data:j(E)},null,8,["data"]),[[c,j(x)]])]),"footer-left":_(()=>a[2]||(a[2]=[])),_:1})])}}});export{v as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
