| 12 |
- import{d as k,c,b5 as _,c1 as w,au as g,Z as x,$ as b,a0 as v,n as s,T as C,bj as y,bi as a,a5 as n,aP as d,b9 as p,ce as B,cf as D}from"./index-8a67e3df.js";import"./dayjs-919e6097.js";import{_ as T}from"./index.vue_vue_type_script_setup_true_lang-d980f666.js";import{s as E}from"./tree-title-9e6e74b4.js";const z=k({__name:"task",setup(R){const f=[{title:"所有者",dataIndex:"owner"},{title:"ID",dataIndex:"id"},{field:"state",title:"状态",width:"100px",customRender:({record:e})=>{const t=[];switch(e.state){case 2:t.push(s(a,{color:"success"},{default:()=>[e.eventLoopRunning?"已激活":"已启动"]}));break;case 3:t.push(s(a,{color:"processing"},{default:()=>[n("运行中")]}));break;case 4:t.push(s(a,{color:"processing"},{default:()=>[n("异步运行中")]}));break;case 5:t.push(s(a,{color:"warning"},{default:()=>[n("销毁中")]}));break;case 6:t.push(s(a,{color:"error"},{default:()=>[n("已销毁")]}));break;default:t.push(s(a,null,{default:()=>[E[e.state]]}));break}return e.blocked?t.push(s(a,{color:"warning"},{default:()=>[n("被阻塞")]})):e.blocking&&t.push(s(a,{color:"error"},{default:()=>[n("阻塞")]})),t}},{dataIndex:"startReason",title:"启动原因",showOverflow:"tooltip"},{field:"startTime",title:"启动时间",width:"100px",customRender:({record:e})=>s(T,{value:e.startTime},null)},{field:"description",title:"描述",showOverflow:"tooltip",customRender:({record:e})=>JSON.stringify(e.description)},{field:"operate",title:"操作",width:"140px",slots:{default:"operate"},align:"center",fixed:"right",customRender:({record:e})=>[s(d,{type:"link",onClick:()=>m(e),size:"small"},{default:()=>[n("重启")]}),s(d,{danger:!0,type:"link",onClick:()=>h(e),size:"small"},{default:()=>[n("关闭")]})]}],o=c([]),r=c([]);_(i),i();function u(e){return e.children&&e.children.length?(e.children=e.children.map(u).sort((t,l)=>t.id-l.id),r.value.push(e.id)):delete e.children,e}function i(){w().then(e=>{o.value=[e].map(u),o.value})}function m(e){p.confirm({title:"重启任务",content:`确定重启任务 ${e.id} 吗?`,onOk:()=>B(e.pointer)})}function h(e){p.confirm({title:"关闭任务",content:`确定关闭任务 ${e.id} 吗?`,onOk:()=>D(e.pointer)})}return(e,t)=>{const l=g("Card");return x(),b(l,{class:"h-full overflow-scroll",bodyStyle:{height:"100%"}},{default:v(()=>[s(C(y),{rowKey:"id","indent-size":10,"data-source":o.value,columns:f,"expanded-row-keys":r.value},null,8,["data-source","expanded-row-keys"])]),_:1})}}});export{z as default};
- //# sourceMappingURL=task-b8645580.js.map
|