优化定时任务详情页展示&补充执行时间字段
This commit is contained in:
@@ -3,6 +3,7 @@ package com.ruoyi.quartz.domain;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
@@ -44,10 +45,12 @@ public class SysJobLog extends BaseEntity
|
|||||||
private String exceptionInfo;
|
private String exceptionInfo;
|
||||||
|
|
||||||
/** 开始时间 */
|
/** 开始时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
/** 停止时间 */
|
/** 结束时间 */
|
||||||
private Date stopTime;
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
public Long getJobLogId()
|
public Long getJobLogId()
|
||||||
{
|
{
|
||||||
@@ -129,14 +132,14 @@ public class SysJobLog extends BaseEntity
|
|||||||
this.startTime = startTime;
|
this.startTime = startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getStopTime()
|
public Date getEndTime()
|
||||||
{
|
{
|
||||||
return stopTime;
|
return endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStopTime(Date stopTime)
|
public void setEndTime(Date endTime)
|
||||||
{
|
{
|
||||||
this.stopTime = stopTime;
|
this.endTime = endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -149,7 +152,7 @@ public class SysJobLog extends BaseEntity
|
|||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("exceptionInfo", getExceptionInfo())
|
.append("exceptionInfo", getExceptionInfo())
|
||||||
.append("startTime", getStartTime())
|
.append("startTime", getStartTime())
|
||||||
.append("stopTime", getStopTime())
|
.append("stopTime", getEndTime())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public abstract class AbstractQuartzJob implements Job
|
|||||||
* 执行后
|
* 执行后
|
||||||
*
|
*
|
||||||
* @param context 工作执行上下文对象
|
* @param context 工作执行上下文对象
|
||||||
* @param sysJob 系统计划任务
|
* @param sysScheduleJob 系统计划任务
|
||||||
*/
|
*/
|
||||||
protected void after(JobExecutionContext context, SysJob sysJob, Exception e)
|
protected void after(JobExecutionContext context, SysJob sysJob, Exception e)
|
||||||
{
|
{
|
||||||
@@ -77,8 +77,8 @@ public abstract class AbstractQuartzJob implements Job
|
|||||||
sysJobLog.setJobGroup(sysJob.getJobGroup());
|
sysJobLog.setJobGroup(sysJob.getJobGroup());
|
||||||
sysJobLog.setInvokeTarget(sysJob.getInvokeTarget());
|
sysJobLog.setInvokeTarget(sysJob.getInvokeTarget());
|
||||||
sysJobLog.setStartTime(startTime);
|
sysJobLog.setStartTime(startTime);
|
||||||
sysJobLog.setStopTime(new Date());
|
sysJobLog.setEndTime(new Date());
|
||||||
long runMs = sysJobLog.getStopTime().getTime() - sysJobLog.getStartTime().getTime();
|
long runMs = sysJobLog.getEndTime().getTime() - sysJobLog.getStartTime().getTime();
|
||||||
sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒");
|
sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒");
|
||||||
if (e != null)
|
if (e != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="jobMessage" column="job_message" />
|
<result property="jobMessage" column="job_message" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="exceptionInfo" column="exception_info" />
|
<result property="exceptionInfo" column="exception_info" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="endTime" column="end_time" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectJobLogVo">
|
<sql id="selectJobLogVo">
|
||||||
select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time
|
select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, start_time, end_time, create_time
|
||||||
from sys_job_log
|
from sys_job_log
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@@ -78,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="jobMessage != null and jobMessage != ''">job_message,</if>
|
<if test="jobMessage != null and jobMessage != ''">job_message,</if>
|
||||||
<if test="status != null and status != ''">status,</if>
|
<if test="status != null and status != ''">status,</if>
|
||||||
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
|
||||||
|
<if test="startTime != null">start_time,</if>
|
||||||
|
<if test="endTime != null">end_time,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
|
<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
|
||||||
@@ -87,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
|
<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
|
||||||
<if test="status != null and status != ''">#{status},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
|
||||||
|
<if test="startTime != null">#{startTime},</if>
|
||||||
|
<if test="endTime != null">#{endTime},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectJobVo">
|
<sql id="selectJobVo">
|
||||||
select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark
|
select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, update_by, update_time, remark
|
||||||
from sys_job
|
from sys_job
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,10 @@
|
|||||||
margin-top: 6vh !important;
|
margin-top: 6vh !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 8px 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
|
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
@@ -268,6 +272,74 @@
|
|||||||
.detail-value { color: #303133; flex: 1; word-break: break-all; }
|
.detail-value { color: #303133; flex: 1; word-break: break-all; }
|
||||||
.detail-location { color: #999; font-size: 12px; }
|
.detail-location { color: #999; font-size: 12px; }
|
||||||
|
|
||||||
|
.method-tag {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 1px 7px;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-right: 6px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.mono { font-family: Consolas, 'SFMono-Regular', monospace; font-size: 12px; }
|
||||||
|
.code-body { padding: 14px; }
|
||||||
|
.code-wrap {
|
||||||
|
background: #f7f9fb;
|
||||||
|
border: 1px solid #e8ecf0;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
max-height: 260px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.code-action {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
z-index: 10;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.code-action .el-button {
|
||||||
|
height: 24px;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
border: 1px solid #dcdcdc;
|
||||||
|
}
|
||||||
|
.code-action .el-button:hover {
|
||||||
|
background: #ffffff;
|
||||||
|
border-color: #409EFF;
|
||||||
|
}
|
||||||
|
.code-pre {
|
||||||
|
margin: 0;
|
||||||
|
padding: 12px 14px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
font-family: Consolas, 'SFMono-Regular', monospace;
|
||||||
|
color: #444;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
overflow: auto;
|
||||||
|
max-height: 240px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
.error-title { color: #c0392b !important; }
|
||||||
|
.error-title i { color: #c0392b !important; }
|
||||||
|
.error-body { padding: 12px 16px; }
|
||||||
|
.error-msg {
|
||||||
|
background: #fff8f8;
|
||||||
|
border-left: 3px solid #e74c3c;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
color: #c0392b;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.7;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
/* http method */
|
/* http method */
|
||||||
.method-GET { background: #e8f5e9; color: #27ae60; }
|
.method-GET { background: #e8f5e9; color: #27ae60; }
|
||||||
.method-POST { background: #e3f2fd; color: #1565c0; }
|
.method-POST { background: #e3f2fd; color: #1565c0; }
|
||||||
|
|||||||
197
ruoyi-ui/src/views/monitor/job/detail.vue
Normal file
197
ruoyi-ui/src/views/monitor/job/detail.vue
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="type === 'log' ? '调度日志详细' : '任务详细'" :visible.sync="visible" width="780px" append-to-body @close="$emit('update:visible', false)">
|
||||||
|
<div class="detail-wrap">
|
||||||
|
|
||||||
|
<template v-if="type === 'log'">
|
||||||
|
<!-- 基本信息 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-info"></i> 基本信息</div>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">日志编号</span><span class="detail-value">{{ form.jobLogId }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item">
|
||||||
|
<span class="detail-label">执行状态</span>
|
||||||
|
<el-tag v-if="form.status == 0" type="success" size="small">正常</el-tag>
|
||||||
|
<el-tag v-else type="danger" size="small">失败</el-tag>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">开始时间</span><span class="detail-value">{{ form.startTime }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">结束时间</span><span class="detail-value">{{ form.endTime }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">记录时间</span><span class="detail-value">{{ form.createTime }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="form.status == 0 && form.startTime && form.endTime">
|
||||||
|
<div class="detail-item"><span class="detail-label">执行耗时</span><span class="detail-value">{{ costTime }} 毫秒</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 任务信息 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-time"></i> 任务信息</div>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">任务名称</span><span class="detail-value">{{ form.jobName }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item">
|
||||||
|
<span class="detail-label">任务分组</span>
|
||||||
|
<dict-tag :options="dict.type.sys_job_group" :value="form.jobGroup" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="detail-item"><span class="detail-label">日志信息</span><span class="detail-value">{{ form.jobMessage }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 调用目标 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-s-operation"></i> 调用目标</div>
|
||||||
|
<div class="code-body">
|
||||||
|
<div class="code-wrap"><pre class="code-pre">{{ form.invokeTarget || '(无)' }}</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 异常信息 -->
|
||||||
|
<div class="detail-card" v-if="form.status == 1">
|
||||||
|
<div class="detail-card-title error-title"><i class="el-icon-warning"></i> 异常信息</div>
|
||||||
|
<div class="error-body"><div class="error-msg">{{ form.exceptionInfo }}</div></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<!-- 任务配置 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-setting"></i> 任务配置</div>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">任务编号</span><span class="detail-value">{{ form.jobId }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">任务名称</span><span class="detail-value">{{ form.jobName }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item">
|
||||||
|
<span class="detail-label">任务分组</span>
|
||||||
|
<dict-tag :options="dict.type.sys_job_group" :value="form.jobGroup" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item">
|
||||||
|
<span class="detail-label">执行状态</span>
|
||||||
|
<el-tag v-if="form.status == 0" type="success" size="small">正常</el-tag>
|
||||||
|
<el-tag v-else type="info" size="small">暂停</el-tag>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 调度信息 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-date"></i> 调度信息</div>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">cron 表达式</span><span class="detail-value mono">{{ form.cronExpression }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">下次执行时间</span><span class="detail-value">{{ parseTime(form.nextValidTime) }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item">
|
||||||
|
<span class="detail-label">执行策略</span>
|
||||||
|
<el-tag v-if="form.misfirePolicy == 0" type="info" size="small">默认策略</el-tag>
|
||||||
|
<el-tag v-else-if="form.misfirePolicy == 1" type="warning" size="small">立即执行</el-tag>
|
||||||
|
<el-tag v-else-if="form.misfirePolicy == 2" type="primary" size="small">执行一次</el-tag>
|
||||||
|
<el-tag v-else-if="form.misfirePolicy == 3" type="danger" size="small">放弃执行</el-tag>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item">
|
||||||
|
<span class="detail-label">并发执行</span>
|
||||||
|
<el-tag v-if="form.concurrent == 0" type="success" size="small">允许</el-tag>
|
||||||
|
<el-tag v-else type="danger" size="small">禁止</el-tag>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 执行方法 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-s-operation"></i> 执行方法</div>
|
||||||
|
<div class="code-body">
|
||||||
|
<div class="code-wrap"><pre class="code-pre">{{ form.invokeTarget || '(无)' }}</pre></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 元信息 -->
|
||||||
|
<div class="detail-card">
|
||||||
|
<div class="detail-card-title"><i class="el-icon-document"></i> 元信息</div>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">创建人</span><span class="detail-value">{{ form.createBy || '-' }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">创建时间</span><span class="detail-value">{{ form.createTime }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">更新人</span><span class="detail-value">{{ form.updateBy || '-' }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="detail-item"><span class="detail-label">更新时间</span><span class="detail-value">{{ form.updateTime || '-' }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="detail-row" v-if="form.remark">
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="detail-item"><span class="detail-label">备注</span><span class="detail-value">{{ form.remark }}</span></div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
dicts: ['sys_job_group'],
|
||||||
|
props: {
|
||||||
|
visible: { type: Boolean, default: false },
|
||||||
|
row: { type: Object, default: () => ({}) },
|
||||||
|
// 'job' 任务详细 | 'log' 调度日志详细
|
||||||
|
type: { type: String, default: 'job' }
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
form() { return this.row || {} },
|
||||||
|
costTime() {
|
||||||
|
if (!this.form.startTime || !this.form.endTime) return 0
|
||||||
|
return new Date(this.form.endTime).getTime() - new Date(this.form.startTime).getTime()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.detail-label {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -241,61 +241,17 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 任务日志详细 -->
|
<!-- 任务日志详细 -->
|
||||||
<el-dialog title="任务详细" :visible.sync="openView" width="700px" append-to-body>
|
<job-detail :visible.sync="openView" :row="form" type="job" />
|
||||||
<el-form ref="form" :model="form" label-width="120px" size="mini">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="任务编号:">{{ form.jobId }}</el-form-item>
|
|
||||||
<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="任务分组:">{{ jobGroupFormat(form) }}</el-form-item>
|
|
||||||
<el-form-item label="创建时间:">{{ form.createTime }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="cron表达式:">{{ form.cronExpression }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="下次执行时间:">{{ parseTime(form.nextValidTime) }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="调用目标方法:">{{ form.invokeTarget }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="任务状态:">
|
|
||||||
<div v-if="form.status == 0">正常</div>
|
|
||||||
<div v-else-if="form.status == 1">暂停</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="是否并发:">
|
|
||||||
<div v-if="form.concurrent == 0">允许</div>
|
|
||||||
<div v-else-if="form.concurrent == 1">禁止</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="执行策略:">
|
|
||||||
<div v-if="form.misfirePolicy == 0">默认策略</div>
|
|
||||||
<div v-else-if="form.misfirePolicy == 1">立即执行</div>
|
|
||||||
<div v-else-if="form.misfirePolicy == 2">执行一次</div>
|
|
||||||
<div v-else-if="form.misfirePolicy == 3">放弃执行</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="openView = false">关 闭</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job"
|
import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job"
|
||||||
|
import JobDetail from './detail'
|
||||||
import Crontab from '@/components/Crontab'
|
import Crontab from '@/components/Crontab'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Crontab },
|
components: { Crontab, JobDetail },
|
||||||
name: "Job",
|
name: "Job",
|
||||||
dicts: ['sys_job_group', 'sys_job_status'],
|
dicts: ['sys_job_group', 'sys_job_status'],
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -143,48 +143,18 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 调度日志详细 -->
|
<job-log-detail :visible.sync="open" :row="form" type="log" />
|
||||||
<el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
|
|
||||||
<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="任务分组:">{{ form.jobGroup }}</el-form-item>
|
|
||||||
<el-form-item label="执行时间:">{{ form.createTime }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="调用方法:">{{ form.invokeTarget }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="日志信息:">{{ form.jobMessage }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="执行状态:">
|
|
||||||
<div v-if="form.status == 0">正常</div>
|
|
||||||
<div v-else-if="form.status == 1">失败</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="异常信息:" v-if="form.status == 1">{{ form.exceptionInfo }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="open = false">关 闭</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getJob} from "@/api/monitor/job"
|
import { getJob} from "@/api/monitor/job"
|
||||||
import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog"
|
import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog"
|
||||||
|
import JobLogDetail from './detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "JobLog",
|
name: "JobLog",
|
||||||
|
components: { JobLogDetail },
|
||||||
dicts: ['sys_common_status', 'sys_job_group'],
|
dicts: ['sys_common_status', 'sys_job_group'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -145,71 +145,3 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.method-tag {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 1px 7px;
|
|
||||||
border-radius: 3px;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-right: 6px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.mono { font-family: Consolas, 'SFMono-Regular', monospace; font-size: 12px; }
|
|
||||||
.code-body { padding: 14px; }
|
|
||||||
.code-wrap {
|
|
||||||
background: #f7f9fb;
|
|
||||||
border: 1px solid #e8ecf0;
|
|
||||||
border-radius: 4px;
|
|
||||||
overflow: hidden;
|
|
||||||
max-height: 260px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.code-action {
|
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
right: 8px;
|
|
||||||
z-index: 10;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.code-action .el-button {
|
|
||||||
height: 24px;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 4px 8px;
|
|
||||||
background: rgba(255, 255, 255, 0.9);
|
|
||||||
border: 1px solid #dcdcdc;
|
|
||||||
}
|
|
||||||
.code-action .el-button:hover {
|
|
||||||
background: #ffffff;
|
|
||||||
border-color: #409EFF;
|
|
||||||
}
|
|
||||||
.code-pre {
|
|
||||||
margin: 0;
|
|
||||||
padding: 12px 14px;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.6;
|
|
||||||
font-family: Consolas, 'SFMono-Regular', monospace;
|
|
||||||
color: #444;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-break: break-all;
|
|
||||||
overflow: auto;
|
|
||||||
max-height: 240px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.error-title { color: #c0392b !important; }
|
|
||||||
.error-title i { color: #c0392b !important; }
|
|
||||||
.error-body { padding: 12px 16px; }
|
|
||||||
.error-msg {
|
|
||||||
background: #fff8f8;
|
|
||||||
border-left: 3px solid #e74c3c;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 8px 12px;
|
|
||||||
color: #c0392b;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.7;
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -613,6 +613,8 @@ create table sys_job_log (
|
|||||||
job_message varchar(500) comment '日志信息',
|
job_message varchar(500) comment '日志信息',
|
||||||
status char(1) default '0' comment '执行状态(0正常 1失败)',
|
status char(1) default '0' comment '执行状态(0正常 1失败)',
|
||||||
exception_info varchar(2000) default '' comment '异常信息',
|
exception_info varchar(2000) default '' comment '异常信息',
|
||||||
|
start_time datetime comment '执行开始时间',
|
||||||
|
end_time datetime comment '执行结束时间',
|
||||||
create_time datetime comment '创建时间',
|
create_time datetime comment '创建时间',
|
||||||
primary key (job_log_id)
|
primary key (job_log_id)
|
||||||
) engine=innodb comment = '定时任务调度日志表';
|
) engine=innodb comment = '定时任务调度日志表';
|
||||||
|
|||||||
Reference in New Issue
Block a user