初始化

This commit is contained in:
zgw
2025-11-17 16:51:34 +08:00
parent ab588c0ea1
commit 03c551b060
999 changed files with 219887 additions and 1 deletions

View File

@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增定时任务')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-job-add">
<input type="hidden" name="createBy" th:value="${@permission.getPrincipalProperty('loginName')}">
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="jobName" id="jobName" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务分组:</label>
<div class="col-sm-8">
<select name="jobGroup" class="form-control m-b" th:with="type=${@dict.getType('sys_job_group')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">调用目标字符串:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="invokeTarget" id="invokeTarget" required>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> Bean调用示例:ryTask.ryParams('ry')</span>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> Class类调用示例:com.ruoyi.quartz.task.RyTask.ryParams('ry')</span>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 参数说明:支持字符串,布尔类型,长整型,浮点型,整型</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">cron表达式:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="cronExpression" id="cronExpression" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行策略:</label>
<div class="col-sm-8">
<label class="radio-box"> <input type="radio" name="misfirePolicy" value="1" th:checked="true"/> 立即执行 </label>
<label class="radio-box"> <input type="radio" name="misfirePolicy" value="2" /> 执行一次 </label>
<label class="radio-box"> <input type="radio" name="misfirePolicy" value="3" /> 放弃执行 </label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">并发执行:</label>
<div class="col-sm-8">
<label class="radio-box"> <input type="radio" name="concurrent" value="0"/> 允许 </label>
<label class="radio-box"> <input type="radio" name="concurrent" value="1" th:checked="true"/> 禁止 </label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea id="remark" name="remark" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
var prefix = ctx + "monitor/job";
$("#form-job-add").validate({
onkeyup: false,
rules:{
cronExpression:{
remote: {
url: prefix + "/checkCronExpressionIsValid",
type: "post",
dataType: "json",
data: {
"cronExpression": function() {
return $.common.trim($("#cronExpression").val());
}
},
dataFilter: function(data, type) {
return data;
}
}
},
},
messages: {
"cronExpression": {
remote: "表达式不正确"
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-job-add').serialize());
}
}
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('定时任务详细')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m-t" id="jobLogForm" th:if="${name == 'jobLog'}">
<div class="form-group">
<label class="col-sm-3 control-label">日志序号:</label>
<div class="form-control-static" th:text="${jobLog.jobLogId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务名称:</label>
<div class="form-control-static" th:text="${jobLog.jobName}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务分组:</label>
<div class="form-control-static" th:text="${@dict.getLabel('sys_job_group', jobLog.jobGroup)}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">调用目标字符串:</label>
<div class="form-control-static" th:text="${jobLog.invokeTarget}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">日志信息:</label>
<div class="form-control-static" th:text="${jobLog.jobMessage}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行状态:</label>
<div class="form-control-static" th:class="${jobLog.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${jobLog.status == '0' ? '正常' : '失败'}">
</div>
</div>
<div class="form-group" th:style="'display:' + ${jobLog.status == '0' ? 'none' : 'block'}">
<label class="col-sm-3 control-label">异常信息:</label>
<div class="form-control-static" th:text="${jobLog.exceptionInfo}">
</div>
</div>
</form>
<form class="form-horizontal m-t" id="jobForm" th:if="${name == 'job'}">
<div class="form-group">
<label class="col-sm-3 control-label">任务序号:</label>
<div class="form-control-static" th:text="${job.jobId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务名称:</label>
<div class="form-control-static" th:text="${job.jobName}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务分组:</label>
<div class="form-control-static" th:text="${job.jobGroup}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">调用目标字符串:</label>
<div class="form-control-static" th:text="${job.invokeTarget}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行表达式:</label>
<div class="form-control-static" th:text="${job.cronExpression}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">下次执行时间:</label>
<div class="form-control-static" th:text="${#dates.format(job.nextValidTime, 'yyyy-MM-dd HH:mm:ss')}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行策略:</label>
<div class="form-control-static" th:if="${job.misfirePolicy == '0'}">默认策略</div>
<div class="form-control-static" th:if="${job.misfirePolicy == '1'}">立即执行</div>
<div class="form-control-static" th:if="${job.misfirePolicy == '2'}">执行一次</div>
<div class="form-control-static" th:if="${job.misfirePolicy == '3'}">放弃执行</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">并发执行:</label>
<div class="form-control-static" th:class="${job.concurrent == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${job.concurrent == '0' ? '允许' : '禁止'}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行状态:</label>
<div class="form-control-static" th:class="${job.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${job.status == '0' ? '正常' : '暂停'}">
</div>
</div>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改定时任务')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-job-edit" th:object="${job}">
<input id="jobId" name="jobId" type="hidden" th:field="*{jobId}"/>
<input type="hidden" name="updateBy" th:value="${@permission.getPrincipalProperty('loginName')}">
<div class="form-group">
<label class="col-sm-3 control-label is-required">任务名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="jobName" id="jobName" th:field="*{jobName}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务分组:</label>
<div class="col-sm-8">
<select name="jobGroup" class="form-control m-b" th:with="type=${@dict.getType('sys_job_group')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{jobGroup}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">调用目标字符串:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="invokeTarget" id="invokeTarget" th:field="*{invokeTarget}" required>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> Bean调用示例:ryTask.ryParams('ry')</span>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> Class类调用示例:com.ruoyi.quartz.task.RyTask.ryParams('ry')</span>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 参数说明:支持字符串,布尔类型,长整型,浮点型,整型</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">cron表达式:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="cronExpression" id="cronExpression" th:field="*{cronExpression}" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">执行策略:</label>
<div class="col-sm-8">
<label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="1" /> 立即执行 </label>
<label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="2" /> 执行一次 </label>
<label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="3" /> 放弃执行 </label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">并发执行:</label>
<div class="col-sm-8">
<label class="radio-box"> <input type="radio" th:field="*{concurrent}" name="concurrent" value="0"/> 允许 </label>
<label class="radio-box"> <input type="radio" th:field="*{concurrent}" name="concurrent" value="1"/> 禁止 </label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
var prefix = ctx + "monitor/job";
$("#form-job-edit").validate({
onkeyup: false,
rules:{
cronExpression:{
required:true,
remote: {
url: prefix + "/checkCronExpressionIsValid",
type: "post",
dataType: "json",
data: {
"cronExpression": function() {
return $.common.trim($("#cronExpression").val());
}
},
dataFilter: function(data, type) {
return data;
}
}
},
},
messages: {
"cronExpression": {
remote: "表达式不正确"
}
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-job-edit').serialize());
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,198 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('定时任务列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="job-form">
<div class="select-list">
<ul>
<li>
任务名称:<input type="text" name="jobName"/>
</li>
<li>
任务分组:<select name="jobGroup" th:with="type=${@dict.getType('sys_job_group')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
任务状态:<select name="status" th:with="type=${@dict.getType('sys_job_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="monitor:job:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="monitor:job:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:job:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-primary" onclick="javascript:cron()">
<i class="fa fa-code"></i> 生成表达式
</a>
<a class="btn btn-info" onclick="javascript:jobLog()" shiro:hasPermission="monitor:job:detail">
<i class="fa fa-list"></i> 日志
</a>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('monitor:job:detail')}]];
var editFlag = [[${@permission.hasPermi('monitor:job:edit')}]];
var removeFlag = [[${@permission.hasPermi('monitor:job:remove')}]];
var statusFlag = [[${@permission.hasPermi('monitor:job:changeStatus')}]];
var datas = [[${@dict.getType('sys_job_group')}]];
var prefix = ctx + "monitor/job";
$(function() {
var options = {
url: prefix + "/list",
detailUrl: prefix + "/detail/{id}",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
sortName: "createTime",
sortOrder: "desc",
modalName: "任务",
columns: [{
checkbox: true
},
{
field: 'jobId',
title: '任务编号'
},
{
field: 'jobName',
title: '任务名称',
},
{
field: 'jobGroup',
title: '任务分组',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
},
{
field: 'invokeTarget',
title: '调用目标字符串',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
},
{
field: 'cronExpression',
title: '执行表达式'
},
{
visible: statusFlag == 'hidden' ? false : true,
title: '任务状态',
align: 'center',
formatter: function (value, row, index) {
return statusTools(row);
}
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.jobId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.jobId + '\')"><i class="fa fa-remove"></i>删除</a> ');
var more = [];
more.push("<a class='btn btn-default btn-xs " + statusFlag + "' href='javascript:void(0)' onclick='run(" + row.jobId + ")'><i class='fa fa-play-circle-o'></i> 执行一次</a> ");
more.push("<a class='btn btn-default btn-xs " + detailFlag + "' href='javascript:void(0)' onclick='$.operate.detail(" + row.jobId + ")'><i class='fa fa-search'></i>任务详细</a> ");
more.push("<a class='btn btn-default btn-xs " + detailFlag + "' href='javascript:void(0)' onclick='jobLog(" + row.jobId + ")'><i class='fa fa-list'></i>调度日志</a>");
actions.push('<a class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
/* 调度任务状态显示 */
function statusTools(row) {
if (row.status == 1) {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="start(\'' + row.jobId + '\', \'' + row.jobGroup + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="stop(\'' + row.jobId + '\', \'' + row.jobGroup + '\')"></i> ';
}
}
/* 立即执行一次 */
function run(jobId) {
$.modal.confirm("确认要立即执行一次任务吗?", function() {
$.operate.post(prefix + "/run", { "jobId": jobId});
})
}
/* 调度任务-停用 */
function stop(jobId, jobGroup) {
$.modal.confirm("确认要停用任务吗?", function() {
$.operate.post(prefix + "/changeStatus", { "jobId": jobId, "jobGroup": jobGroup, "status": 1 });
})
}
/* 调度任务-启用 */
function start(jobId, jobGroup) {
$.modal.confirm("确认要启用任务吗?", function() {
$.operate.post(prefix + "/changeStatus", { "jobId": jobId, "jobGroup": jobGroup, "status": 0 });
})
}
/* 调度日志查询 */
function jobLog(jobId) {
var url = ctx + 'monitor/jobLog';
if ($.common.isNotEmpty(jobId)) {
url += '?jobId=' + jobId;
}
$.modal.openTab("调度日志", url);
}
/* cron表达式生成 */
function cron() {
var url = prefix + '/cron';
var height = $(window).height() - 50;
top.layer.open({
maxmin: true,
title: "Cron表达式生成器",
type: 2,
area: ['800px', height + "px" ], //宽高
shadeClose: true,
content: url
});
}
</script>
</body>
</html>

View File

@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('定时任务日志列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="jobLog-form">
<div class="select-list">
<ul>
<li>
任务名称:<input type="text" name="jobName" th:value="${job!=null?job.jobName:''}"/>
</li>
<li>
任务分组:<select name="jobGroup" th:with="type=${@dict.getType('sys_job_group')}">
<option value="">所有</option>
<th:block th:if="${job==null}"><option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option></th:block>
<th:block th:if="${job!=null}"><option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{job.jobGroup}"></option></th:block>
</select>
</li>
<li>
执行状态:<select name="status" th:with="type=${@dict.getType('sys_common_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>执行时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:job:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-danger" onclick="$.operate.clean()" shiro:hasPermission="monitor:job:remove">
<i class="fa fa-trash"></i> 清空
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-danger" onclick="closeItem()">
<i class="fa fa-reply-all"></i> 关闭
</a>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('monitor:job:detail')}]];
var statusDatas = [[${@dict.getType('sys_common_status')}]];
var groupDatas = [[${@dict.getType('sys_job_group')}]];
var prefix = ctx + "monitor/jobLog";
$(function() {
var options = {
url: prefix + "/list",
cleanUrl: prefix + "/clean",
detailUrl: prefix + "/detail/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
sortName: "createTime",
sortOrder: "desc",
modalName: "调度日志",
columns: [{
checkbox: true
},
{
field: 'jobLogId',
title: '日志编号'
},
{
field: 'jobName',
title: '任务名称'
},
{
field: 'jobGroup',
title: '任务分组',
formatter: function(value, row, index) {
return $.table.selectDictLabel(groupDatas, value);
}
},
{
field: 'invokeTarget',
title: '调用目标字符串',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
},
{
field: 'jobMessage',
title: '日志信息'
},
{
field: 'status',
title: '状态',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(statusDatas, value);
}
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.jobLogId + '\')"><i class="fa fa-search"></i>详细</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>