index-3e2f7c9b.js 7.7 KB

1
  1. import{d as oa,B as na,u as sa,r as g,f as ia,z as _a,S as ca,o as s,c as F,i as a,w as e,a as l,T as I,F as M,C as ua,j as i,m as _,D as p,t as ma,l as O,X as pa,I as da,G as fa,H as ya,_ as ha,q as ba,J as ga,K as wa,L as ka,M as va,__tla as ja}from"./index-1e808f2e.js";import{_ as xa,__tla as Ca}from"./index.vue_vue_type_script_setup_true_lang-571824c6.js";import{E as Na,a as Sa,b as Oa,__tla as Ra}from"./el-dropdown-item-e91442cd.js";import{_ as Ta,__tla as Pa}from"./DictTag.vue_vue_type_script_lang-5c02ebfe.js";import{_ as Va,__tla as Aa}from"./ContentWrap.vue_vue_type_script_setup_true_lang-cc335a20.js";import{a as Ua,D as B,__tla as qa}from"./dict-a31cb4ba.js";import{c as R,__tla as Ja}from"./permission-ddb026c8.js";import{_ as La,__tla as za}from"./JobForm.vue_vue_type_script_setup_true_lang-197d52a2.js";import{_ as Fa,__tla as Ia}from"./JobDetail.vue_vue_type_script_setup_true_lang-107fdd76.js";import{d as Ma}from"./download-20922b56.js";import{b as Ba,e as Da,d as Ka,f as Ea,r as Ga,__tla as Ha}from"./index-7421350a.js";import{c as d}from"./constants-e43f22dd.js";import{u as Wa,__tla as Xa}from"./useMessage-5f9e8917.js";import{__tla as Ya}from"./index-73afebcf.js";import"./color-6e929987.js";import{__tla as Qa}from"./el-card-03b3588b.js";import{__tla as Za}from"./Dialog-f44f9d78.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as $a}from"./el-descriptions-item-8d4be2e8.js";import{__tla as ae}from"./el-timeline-item-cb959fb7.js";import{__tla as ee}from"./formatTime-a348c3be.js";let D,te=Promise.all([(()=>{try{return ja}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Pa}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return qa}catch{}})(),(()=>{try{return Ja}catch{}})(),(()=>{try{return za}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ha}catch{}})(),(()=>{try{return Xa}catch{}})(),(()=>{try{return Ya}catch{}})(),(()=>{try{return Qa}catch{}})(),(()=>{try{return Za}catch{}})(),(()=>{try{return $a}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return ee}catch{}})()]).then(async()=>{D=oa({name:"InfraJob",__name:"index",setup(le){const{t:x}=na(),f=Wa(),{push:K}=sa(),C=g(!0),T=g(0),P=g([]),n=ia({pageNo:1,pageSize:10,name:void 0,status:void 0,handlerName:void 0}),V=g(),N=g(!1),y=async()=>{C.value=!0;try{const r=await Ba(n);P.value=r.list,T.value=r.total}finally{C.value=!1}},k=()=>{n.pageNo=1,y()},E=()=>{V.value.resetFields(),k()},G=async()=>{try{await f.exportConfirm(),N.value=!0;const r=await Da(n);Ma.excel(r,"\u5B9A\u65F6\u4EFB\u52A1.xls")}catch{}finally{N.value=!1}},A=g(),U=(r,o)=>{A.value.open(r,o)},H=async r=>{try{await f.confirm("\u786E\u8BA4\u8981\u7ACB\u5373\u6267\u884C\u4E00\u6B21"+r.name+"?",x("common.reminder")),await Ga(r.id),f.success("\u6267\u884C\u6210\u529F"),await y()}catch{}},q=g(),W=r=>{q.value.open(r)},J=r=>{K(r&&r>0?"/job/job-log?id="+r:"/job/job-log")};return _a(()=>{y()}),(r,o)=>{const L=pa,v=da,X=fa,Y=ya,w=ha,u=ba,Q=ga,z=Va,h=wa,Z=Ta,S=Na,$=Sa,aa=Oa,ea=ka,ta=xa,b=ca("hasPermi"),la=va;return s(),F(M,null,[a(z,null,{default:e(()=>[a(Q,{class:"-mb-15px",model:l(n),ref_key:"queryFormRef",ref:V,inline:!0,"label-width":"100px"},{default:e(()=>[a(v,{label:"\u4EFB\u52A1\u540D\u79F0",prop:"name"},{default:e(()=>[a(L,{modelValue:l(n).name,"onUpdate:modelValue":o[0]||(o[0]=t=>l(n).name=t),placeholder:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",clearable:"",onKeyup:I(k,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),a(v,{label:"\u4EFB\u52A1\u72B6\u6001",prop:"status"},{default:e(()=>[a(Y,{modelValue:l(n).status,"onUpdate:modelValue":o[1]||(o[1]=t=>l(n).status=t),placeholder:"\u8BF7\u9009\u62E9\u4EFB\u52A1\u72B6\u6001",clearable:"",class:"!w-240px"},{default:e(()=>[(s(!0),F(M,null,ua(l(Ua)(l(B).INFRA_JOB_STATUS),t=>(s(),i(X,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(v,{label:"\u5904\u7406\u5668\u7684\u540D\u5B57",prop:"handlerName"},{default:e(()=>[a(L,{modelValue:l(n).handlerName,"onUpdate:modelValue":o[2]||(o[2]=t=>l(n).handlerName=t),placeholder:"\u8BF7\u8F93\u5165\u5904\u7406\u5668\u7684\u540D\u5B57",clearable:"",onKeyup:I(k,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),a(v,null,{default:e(()=>[a(u,{onClick:k},{default:e(()=>[a(w,{icon:"ep:search",class:"mr-5px"}),_(" \u641C\u7D22")]),_:1}),a(u,{onClick:E},{default:e(()=>[a(w,{icon:"ep:refresh",class:"mr-5px"}),_(" \u91CD\u7F6E")]),_:1}),p((s(),i(u,{type:"primary",plain:"",onClick:o[3]||(o[3]=t=>U("create"))},{default:e(()=>[a(w,{icon:"ep:plus",class:"mr-5px"}),_(" \u65B0\u589E ")]),_:1})),[[b,["infra:job:create"]]]),p((s(),i(u,{type:"success",plain:"",onClick:G,loading:l(N)},{default:e(()=>[a(w,{icon:"ep:download",class:"mr-5px"}),_(" \u5BFC\u51FA ")]),_:1},8,["loading"])),[[b,["infra:job:export"]]]),p((s(),i(u,{type:"info",plain:"",onClick:o[4]||(o[4]=t=>J())},{default:e(()=>[a(w,{icon:"ep:zoom-in",class:"mr-5px"}),_(" \u6267\u884C\u65E5\u5FD7 ")]),_:1})),[[b,["infra:job:query"]]])]),_:1})]),_:1},8,["model"])]),_:1}),a(z,null,{default:e(()=>[p((s(),i(ea,{data:l(P)},{default:e(()=>[a(h,{label:"\u4EFB\u52A1\u7F16\u53F7",align:"center",prop:"id"}),a(h,{label:"\u4EFB\u52A1\u540D\u79F0",align:"center",prop:"name"}),a(h,{label:"\u4EFB\u52A1\u72B6\u6001",align:"center",prop:"status"},{default:e(t=>[a(Z,{type:l(B).INFRA_JOB_STATUS,value:t.row.status},null,8,["type","value"])]),_:1}),a(h,{label:"\u5904\u7406\u5668\u7684\u540D\u5B57",align:"center",prop:"handlerName"}),a(h,{label:"\u5904\u7406\u5668\u7684\u53C2\u6570",align:"center",prop:"handlerParam"}),a(h,{label:"CRON \u8868\u8FBE\u5F0F",align:"center",prop:"cronExpression"}),a(h,{label:"\u64CD\u4F5C",align:"center",width:"200"},{default:e(t=>[p((s(),i(u,{type:"primary",link:"",onClick:j=>U("update",t.row.id)},{default:e(()=>[_(" \u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[b,["infra:job:update"]]]),p((s(),i(u,{type:"primary",link:"",onClick:j=>(async c=>{try{const m=c.status===d.STOP?"\u5F00\u542F":"\u5173\u95ED";await f.confirm("\u786E\u8BA4\u8981"+m+'\u5B9A\u65F6\u4EFB\u52A1\u7F16\u53F7\u4E3A"'+c.id+'"\u7684\u6570\u636E\u9879?',x("common.reminder"));const ra=c.status===d.STOP?d.NORMAL:d.STOP;await Ka(c.id,ra),f.success(m+"\u6210\u529F"),await y()}catch{c.status=c.status===d.NORMAL?d.STOP:d.NORMAL}})(t.row)},{default:e(()=>[_(ma(t.row.status===l(d).STOP?"\u5F00\u542F":"\u6682\u505C"),1)]),_:2},1032,["onClick"])),[[b,["infra:job:update"]]]),p((s(),i(u,{type:"danger",link:"",onClick:j=>(async c=>{try{await f.delConfirm(),await Ea(c),f.success(x("common.delSuccess")),await y()}catch{}})(t.row.id)},{default:e(()=>[_(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[b,["infra:job:delete"]]]),p((s(),i(aa,{onCommand:j=>((c,m)=>{switch(c){case"handleRun":H(m);break;case"openDetail":W(m.id);break;case"handleJobLog":J(m==null?void 0:m.id)}})(j,t.row)},{dropdown:e(()=>[a($,null,{default:e(()=>[l(R)(["infra:job:trigger"])?(s(),i(S,{key:0,command:"handleRun"},{default:e(()=>[_(" \u6267\u884C\u4E00\u6B21 ")]),_:1})):O("",!0),l(R)(["infra:job:query"])?(s(),i(S,{key:1,command:"openDetail"},{default:e(()=>[_(" \u4EFB\u52A1\u8BE6\u7EC6 ")]),_:1})):O("",!0),l(R)(["infra:job:query"])?(s(),i(S,{key:2,command:"handleJobLog"},{default:e(()=>[_(" \u8C03\u5EA6\u65E5\u5FD7 ")]),_:1})):O("",!0)]),_:1})]),default:e(()=>[a(u,{type:"primary",link:""},{default:e(()=>[a(w,{icon:"ep:d-arrow-right"}),_(" \u66F4\u591A")]),_:1})]),_:2},1032,["onCommand"])),[[b,["infra:job:trigger","infra:job:query"]]])]),_:1})]),_:1},8,["data"])),[[la,l(C)]]),a(ta,{total:l(T),page:l(n).pageNo,"onUpdate:page":o[5]||(o[5]=t=>l(n).pageNo=t),limit:l(n).pageSize,"onUpdate:limit":o[6]||(o[6]=t=>l(n).pageSize=t),onPagination:y},null,8,["total","page","limit"])]),_:1}),a(La,{ref_key:"formRef",ref:A,onSuccess:y},null,512),a(Fa,{ref_key:"detailRef",ref:q},null,512)],64)}}})});export{te as __tla,D as default};