定时任务&角色管理添加更多操作按钮
This commit is contained in:
@ -179,12 +179,11 @@ public class SysJobServiceImpl implements ISysJobService
|
||||
public void run(SysJob job) throws SchedulerException
|
||||
{
|
||||
Long jobId = job.getJobId();
|
||||
String jobGroup = job.getJobGroup();
|
||||
SysJob properties = selectJobById(job.getJobId());
|
||||
SysJob tmpObj = selectJobById(job.getJobId());
|
||||
// 参数
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties);
|
||||
scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap);
|
||||
dataMap.put(ScheduleConstants.TASK_PROPERTIES, tmpObj);
|
||||
scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, tmpObj.getJobGroup()), dataMap);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,8 +124,12 @@
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-primary btn-xs ' + statusFlag + '" href="javascript:void(0)" onclick="run(\'' + row.jobId + '\', \'' + row.jobGroup + '\')"><i class="fa fa-play-circle-o"></i> 执行一次</a> ');
|
||||
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.jobId + '\')"><i class="fa fa-search"></i>详细</a> ');
|
||||
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> ");
|
||||
actions.push('<a class="btn btn-info btn-xs" data-toggle="popover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
@ -143,9 +147,9 @@
|
||||
}
|
||||
|
||||
/* 立即执行一次 */
|
||||
function run(jobId, jobGroup) {
|
||||
function run(jobId) {
|
||||
$.modal.confirm("确认要立即执行一次任务吗?", function() {
|
||||
$.operate.post(prefix + "/run", { "jobId": jobId, "jobGroup": jobGroup});
|
||||
$.operate.post(prefix + "/run", { "jobId": jobId});
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user