import{d as x,t as U,_ as M}from"./index.e4ceb7bd.js";/* empty css              *//* empty css              *//* empty css               *//* empty css               *//* empty css               *//* empty css              *//* empty css               *//* empty css               */import{d as E,r as C,j as $,aP as j,bu as H,C as p,D as J,aI as e,aH as a,aJ as l,b5 as g,aE as k,E as O,aR as I,bq as Q,br as W,b0 as X,a$ as Y,bt as A,aV as G,ac as K,aU as L,aX as Z,bh as ee,bv as te,aY as ae}from"./arco.2329baeb.js";import"./chart.db8aed57.js";import"./vue.46369188.js";const se={class:"container"},ne={name:"TaskManagement"},oe=E({...ne,setup(ie){const s=C({task_id:"",status:"",weight:"",queue_name:"",page:1,page_size:10,total:0}),y=C({...s}),q=[{title:"task_id",dataIndex:"task_id"},{title:"status",dataIndex:"status"},{title:"weight",dataIndex:"weight"},{title:"queue_name",dataIndex:"queue_name"},{title:"worker_pid",dataIndex:"worker_pid"},{title:"create_time",dataIndex:"create_time"},{title:"end_time",dataIndex:"end_time"},{title:"operations",dataIndex:"operations",slotName:"operations",width:200}],b=$([]),d=()=>{const o="/api/task/list";x.get(o,{params:s}).then(t=>{b.value=t.data,y.total=t.total})},v=()=>{s.page=1,s.page_size=10,s.total=0,s.task_id="",s.status="",s.weight="",s.queue_name="",d()},S=o=>{s.page=o,d()},T=o=>{const t="/api/task/stop";x.post(t,{task_id:o.task_id}).then(r=>{I.success(r.msg),d()})},F=o=>{const t="/api/task/retry";x.post(t,{task_id:o.task_id}).then(r=>{I.success(r.msg),d()})};return d(),(o,t)=>{const r=j("Breadcrumb"),_=Q,u=W,i=X,m=Y,R=A,h=G,z=K,c=L,w=U,V=Z,B=ee,D=te,P=ae,f=H("permission");return p(),J("div",se,[e(r,{items:"System / TaskManagement"}),e(P,{title:"TaskManagement",class:"general-card"},{default:a(()=>[e(m,null,{default:a(()=>[e(i,{flex:1},{default:a(()=>[e(R,{"label-col-props":{span:6},model:s,"wrapper-col-props":{span:18},"label-align":"left"},{default:a(()=>[e(m,{gutter:16},{default:a(()=>[e(i,{span:8},{default:a(()=>[e(u,{field:"task_id","hide-label":""},{default:a(()=>[e(_,{modelValue:s.task_id,"onUpdate:modelValue":t[0]||(t[0]=n=>s.task_id=n),placeholder:"Please enter the query parameters"},{prefix:a(()=>t[4]||(t[4]=[l("Task ID")])),_:1},8,["modelValue"])]),_:1})]),_:1}),e(i,{span:8},{default:a(()=>[e(u,{field:"queue_name","hide-label":""},{default:a(()=>[e(_,{modelValue:s.queue_name,"onUpdate:modelValue":t[1]||(t[1]=n=>s.queue_name=n),placeholder:"Please enter the query parameters"},{prefix:a(()=>t[5]||(t[5]=[l("Queue Name")])),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,{gutter:16},{default:a(()=>[e(i,{span:8},{default:a(()=>[e(u,{field:"weight","hide-label":""},{default:a(()=>[e(_,{modelValue:s.weight,"onUpdate:modelValue":t[2]||(t[2]=n=>s.weight=n),placeholder:"Please enter the query parameters"},{prefix:a(()=>t[6]||(t[6]=[l("Weight")])),_:1},8,["modelValue"])]),_:1})]),_:1}),e(i,{span:8},{default:a(()=>[e(u,{field:"status","hide-label":""},{default:a(()=>[e(_,{modelValue:s.status,"onUpdate:modelValue":t[3]||(t[3]=n=>s.status=n),placeholder:"Please enter the query parameters"},{prefix:a(()=>t[7]||(t[7]=[l("Status")])),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(h,{direction:"vertical",style:{height:"84px"}}),e(i,{flex:"100px",style:{"text-align":"right"}},{default:a(()=>[e(V,{size:18,direction:"vertical"},{default:a(()=>[g((p(),k(c,{type:"primary",onClick:d},{icon:a(()=>[e(z)]),default:a(()=>[t[8]||(t[8]=l(" Search "))]),_:1})),[[f,["admin"]]]),g((p(),k(c,{onClick:v},{icon:a(()=>[e(w)]),default:a(()=>[t[9]||(t[9]=l(" SearchReset "))]),_:1})),[[f,["admin"]]])]),_:1})]),_:1})]),_:1}),e(h,{style:{"margin-top":"0"}}),e(m,{style:{"margin-bottom":"16px"}},{default:a(()=>[e(i,{span:12}),e(i,{span:12,style:{display:"flex","align-items":"center","justify-content":"end"}},{default:a(()=>[e(B,{content:"Refresh"},{default:a(()=>[O("div",{class:"action-icon",onClick:v},[e(w,{size:"18"})])]),_:1})]),_:1})]),_:1}),e(D,{"row-key":"id",pagination:y,columns:q,data:b.value,bordered:!1,size:"small",onPageChange:S},{operations:a(({record:n})=>[e(V,null,{default:a(()=>[g((p(),k(c,{type:"outline",size:"mini",status:"danger",onClick:N=>T(n)},{default:a(()=>t[10]||(t[10]=[l(" Stop ")])),_:2},1032,["onClick"])),[[f,["admin"]]]),g((p(),k(c,{type:"text",size:"mini",status:"warning",onClick:N=>F(n)},{default:a(()=>t[11]||(t[11]=[l("Retry ")])),_:2},1032,["onClick"])),[[f,["admin"]]])]),_:2},1024)]),_:1},8,["pagination","data"])]),_:1})])}}});const ye=M(oe,[["__scopeId","data-v-d573e229"]]);export{ye as default};
