2 lines
7.4 KiB
JavaScript

import{Q as e,G as a,r as l,a as o,I as t,U as n,d as u,T as d,o as r,c as s,K as i,M as p,f as m,e as c,w as b,j as f,V as g,W as v,k as _,J as h,n as j,l as w,A as y,m as k,v as V}from"./index.e5c8b0d6.js";import{g as x}from"./job.fcbfb179.js";const N={class:"app-container"},C={key:0},S={key:1},T={class:"dialog-footer"},G=a({name:"JobLog"}),U=Object.assign(G,{setup(a){const{proxy:G}=V(),{sys_common_status:U,sys_job_group:D}=G.useDict("sys_common_status","sys_job_group"),L=l([]),I=l(!1),$=l(!0),q=l(!0),M=l([]),P=l(!0),R=l(0),Y=l([]),z=o(),K=t({form:{},queryParams:{pageNum:1,pageSize:10,dictName:void 0,dictType:void 0,status:void 0}}),{queryParams:J,form:O,rules:Q}=n(K);function A(){var a;$.value=!0,(a=G.addDateRange(J.value,Y.value),e({url:"/monitor/jobLog/list",method:"get",params:a})).then((e=>{L.value=e.rows,R.value=e.total,$.value=!1}))}function F(){G.$tab.closeOpenPage({path:"/monitor/job"})}function W(){J.value.pageNum=1,A()}function B(){Y.value=[],G.resetForm("queryRef"),W()}function E(e){M.value=e.map((e=>e.jobLogId)),P.value=!e.length}function H(a){G.$modal.confirm('是否确认删除调度日志编号为"'+M.value+'"的数据项?').then((function(){return a=M.value,e({url:"/monitor/jobLog/"+a,method:"delete"});var a})).then((()=>{A(),G.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function X(){G.$modal.confirm("是否确认清空所有调度日志数据项?").then((function(){return e({url:"/monitor/jobLog/clean",method:"delete"})})).then((()=>{A(),G.$modal.msgSuccess("清空成功")})).catch((()=>{}))}function Z(){G.download("monitor/jobLog/export",{...J.value},`job_log_${(new Date).getTime()}.xlsx`)}return(()=>{const e=z.params&&z.params.jobId;void 0!==e&&0!=e?x(e).then((e=>{J.value.jobName=e.data.jobName,J.value.jobGroup=e.data.jobGroup,A()})):A()})(),A(),(e,a)=>{const l=u("el-input"),o=u("el-form-item"),t=u("el-option"),n=u("el-select"),V=u("el-date-picker"),x=u("el-button"),G=u("el-form"),M=u("el-col"),z=u("right-toolbar"),K=u("el-row"),Q=u("el-table-column"),ee=u("dict-tag"),ae=u("el-table"),le=u("pagination"),oe=u("el-dialog"),te=d("hasPermi"),ne=d("loading");return r(),s("div",N,[i(c(G,{model:m(J),ref:"queryRef",inline:!0,"label-width":"68px"},{default:b((()=>[c(o,{label:"任务名称",prop:"jobName"},{default:b((()=>[c(l,{modelValue:m(J).jobName,"onUpdate:modelValue":a[0]||(a[0]=e=>m(J).jobName=e),placeholder:"请输入任务名称",clearable:"",style:{width:"240px"},onKeyup:f(W,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),c(o,{label:"任务组名",prop:"jobGroup"},{default:b((()=>[c(n,{modelValue:m(J).jobGroup,"onUpdate:modelValue":a[1]||(a[1]=e=>m(J).jobGroup=e),placeholder:"请选择任务组名",clearable:"",style:{width:"240px"}},{default:b((()=>[(r(!0),s(g,null,v(m(D),(e=>(r(),_(t,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),c(o,{label:"执行状态",prop:"status"},{default:b((()=>[c(n,{modelValue:m(J).status,"onUpdate:modelValue":a[2]||(a[2]=e=>m(J).status=e),placeholder:"请选择执行状态",clearable:"",style:{width:"240px"}},{default:b((()=>[(r(!0),s(g,null,v(m(U),(e=>(r(),_(t,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),c(o,{label:"执行时间",style:{width:"308px"}},{default:b((()=>[c(V,{modelValue:m(Y),"onUpdate:modelValue":a[3]||(a[3]=e=>h(Y)?Y.value=e:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])])),_:1}),c(o,null,{default:b((()=>[c(x,{type:"primary",icon:"Search",onClick:W},{default:b((()=>[j("搜索")])),_:1}),c(x,{icon:"Refresh",onClick:B},{default:b((()=>[j("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[p,m(q)]]),c(K,{gutter:10,class:"mb8"},{default:b((()=>[c(M,{span:1.5},{default:b((()=>[i((r(),_(x,{type:"danger",plain:"",icon:"Delete",disabled:m(P),onClick:H},{default:b((()=>[j("删除")])),_:1},8,["disabled"])),[[te,["monitor:job:remove"]]])])),_:1},8,["span"]),c(M,{span:1.5},{default:b((()=>[i((r(),_(x,{type:"danger",plain:"",icon:"Delete",onClick:X},{default:b((()=>[j("清空")])),_:1})),[[te,["monitor:job:remove"]]])])),_:1},8,["span"]),c(M,{span:1.5},{default:b((()=>[i((r(),_(x,{type:"warning",plain:"",icon:"Download",onClick:Z},{default:b((()=>[j("导出")])),_:1})),[[te,["monitor:job:export"]]])])),_:1},8,["span"]),c(M,{span:1.5},{default:b((()=>[c(x,{type:"warning",plain:"",icon:"Close",onClick:F},{default:b((()=>[j("关闭")])),_:1})])),_:1},8,["span"]),c(z,{showSearch:m(q),"onUpdate:showSearch":a[4]||(a[4]=e=>h(q)?q.value=e:null),onQueryTable:A},null,8,["showSearch"])])),_:1}),i((r(),_(ae,{data:m(L),onSelectionChange:E},{default:b((()=>[c(Q,{type:"selection",width:"55",align:"center"}),c(Q,{label:"日志编号",width:"80",align:"center",prop:"jobLogId"}),c(Q,{label:"任务名称",align:"center",prop:"jobName","show-overflow-tooltip":!0}),c(Q,{label:"任务组名",align:"center",prop:"jobGroup","show-overflow-tooltip":!0},{default:b((e=>[c(ee,{options:m(D),value:e.row.jobGroup},null,8,["options","value"])])),_:1}),c(Q,{label:"调用目标字符串",align:"center",prop:"invokeTarget","show-overflow-tooltip":!0}),c(Q,{label:"日志信息",align:"center",prop:"jobMessage","show-overflow-tooltip":!0}),c(Q,{label:"执行状态",align:"center",prop:"status"},{default:b((e=>[c(ee,{options:m(U),value:e.row.status},null,8,["options","value"])])),_:1}),c(Q,{label:"执行时间",align:"center",prop:"createTime",width:"180"},{default:b((a=>[w("span",null,y(e.parseTime(a.row.createTime)),1)])),_:1}),c(Q,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:b((e=>[i((r(),_(x,{link:"",type:"primary",icon:"View",onClick:a=>{return l=e.row,I.value=!0,void(O.value=l);var l}},{default:b((()=>[j("详细")])),_:2},1032,["onClick"])),[[te,["monitor:job:query"]]])])),_:1})])),_:1},8,["data"])),[[ne,m($)]]),i(c(le,{total:m(R),page:m(J).pageNum,"onUpdate:page":a[5]||(a[5]=e=>m(J).pageNum=e),limit:m(J).pageSize,"onUpdate:limit":a[6]||(a[6]=e=>m(J).pageSize=e),onPagination:A},null,8,["total","page","limit"]),[[p,m(R)>0]]),c(oe,{title:"调度日志详细",modelValue:m(I),"onUpdate:modelValue":a[8]||(a[8]=e=>h(I)?I.value=e:null),width:"700px","append-to-body":""},{footer:b((()=>[w("div",T,[c(x,{onClick:a[7]||(a[7]=e=>I.value=!1)},{default:b((()=>[j("关 闭")])),_:1})])])),default:b((()=>[c(G,{model:m(O),"label-width":"100px"},{default:b((()=>[c(K,null,{default:b((()=>[c(M,{span:12},{default:b((()=>[c(o,{label:"日志序号:"},{default:b((()=>[j(y(m(O).jobLogId),1)])),_:1}),c(o,{label:"任务名称:"},{default:b((()=>[j(y(m(O).jobName),1)])),_:1})])),_:1}),c(M,{span:12},{default:b((()=>[c(o,{label:"任务分组:"},{default:b((()=>[j(y(m(O).jobGroup),1)])),_:1}),c(o,{label:"执行时间:"},{default:b((()=>[j(y(m(O).createTime),1)])),_:1})])),_:1}),c(M,{span:24},{default:b((()=>[c(o,{label:"调用方法:"},{default:b((()=>[j(y(m(O).invokeTarget),1)])),_:1})])),_:1}),c(M,{span:24},{default:b((()=>[c(o,{label:"日志信息:"},{default:b((()=>[j(y(m(O).jobMessage),1)])),_:1})])),_:1}),c(M,{span:24},{default:b((()=>[c(o,{label:"执行状态:"},{default:b((()=>[0==m(O).status?(r(),s("div",C,"正常")):1==m(O).status?(r(),s("div",S,"失败")):k("",!0)])),_:1})])),_:1}),c(M,{span:24},{default:b((()=>[1==m(O).status?(r(),_(o,{key:0,label:"异常信息:"},{default:b((()=>[j(y(m(O).exceptionInfo),1)])),_:1})):k("",!0)])),_:1})])),_:1})])),_:1},8,["model"])])),_:1},8,["modelValue"])])}}});export{U as default};