<!DOCTYPE HTML>
|
<html xmlns:th="http://www.thymeleaf.org">
|
<head>
|
<meta charset="utf-8">
|
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport"
|
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
<!-- 本框架基本脚本和样式 -->
|
<script type="text/javascript"
|
th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
|
<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
|
<title>定时任务管理</title>
|
</head>
|
<body class=" container-fluid">
|
<div class="pd-10">
|
<!-- 搜索框部分start -->
|
<div class="row form-head">
|
<div class="col-md-4 col-xs-12">
|
<button onclick="myGrid.delItems('jdId')" type="button"
|
class="btn btn-danger btn-sm">
|
<i class="fa fa-trash"></i>批量删除
|
</button>
|
<button onclick="openAdd()" type="button"
|
class="btn btn-success btn-sm">
|
<i class="fa fa-plus"></i> 新增
|
</button>
|
</div>
|
<!-- 搜索框部分start -->
|
<div class="col-md-8 col-xs-12">
|
<div class="row">
|
<div class="col-md-11 col-xs-12" style="text-align: right">
|
<form class="form-inline" id="serchform">
|
<div class="form-group mr-20">
|
<input autocomplete="off" placeholder="请输入关键词" name="" type="text"
|
class="form-control">
|
</div>
|
<button onclick="myGrid.serchData()" type="button"
|
class="btn btn-info btn-sm">
|
<i class="fa fa-search "></i> 搜索
|
</button>
|
<button onclick="MForm.reset('#serchform');" type="button"
|
class="btn btn-info btn-sm">
|
<i class="fa fa-refresh "></i> 重置
|
</button>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<!-- 搜索框部分en -->
|
<table id="mgrid">
|
<thead>
|
<tr>
|
<th data-checkbox="true"></th>
|
<th data-formatter="MGrid.indexfn" data-align="center"
|
data-width="30px">序号
|
</th>
|
<th data-field="jdName" data-sortable="true">名称</th>
|
<th data-align="center" data-width="195px" data-field="jdId"
|
data-formatter="buidOperate">操作
|
</th>
|
</tr>
|
</thead>
|
</table>
|
</div>
|
</div>
|
|
|
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
|
<script type="text/javascript">
|
var myGrid;
|
$(function () {
|
var delUrl = "";
|
delUrl = basePath + "/developer/quartzJobDefinition/del";
|
myGrid = MGrid.initGrid({
|
url: basePath + "/developer/quartzJobDefinition/showList",
|
delUrl: delUrl,
|
});
|
|
|
});
|
|
function buidOperate(value, row, index) {
|
var html = [];
|
html[0] = '<a onClick="openEdit(\'' + value
|
+ '\')" title="编辑" class="fa fa-edit option"></a>';
|
html[1] = '<a onClick="myGrid.delItem(\''
|
+ value
|
+ '\')" title="删除" class="fa fa-trash option"></a>';
|
html[2] = '<a onClick="showHistory(\''
|
+ value
|
+ '\')" title="执行历史" class="fa fa-history option"></a>';
|
// 根据当前状态展示是暂停还是恢复
|
if (row.jdStatus == '1') {
|
html[3] = '<a onClick="pauseJob(\''
|
+ value
|
+ '\')" title="暂停" class="fa fa-stop option"></a>';
|
} else {
|
html[3] = '<a onClick="resumeJob(\''
|
+ value
|
+ '\')" title="恢复" class="fa fa-backward option"></a>';
|
}
|
|
return html.join("");
|
}
|
|
//打开添加界面
|
function openAdd() {
|
layer.open({
|
type: 2,
|
title: "添加(定时任务主表)",
|
area: [MUI.SIZE_L, '400px'],
|
maxmin: true,
|
content: [basePath + '/developer/quartzJobDefinition/editForm']
|
});
|
}
|
|
//打开编辑界面
|
function openEdit(id) {
|
layer.open({
|
type: 2,
|
title: "编辑(定时任务主表)",
|
area: [MUI.SIZE_L, '400px'],
|
maxmin: true,
|
content: [basePath
|
+ '/developer/quartzJobDefinition/editForm?id=' + id]
|
});
|
}
|
|
// 打开历史
|
function showHistory(id) {
|
layer.full(layer.open({
|
type: 2,
|
title: "执行历史",
|
area: [MUI.SIZE_L, '400px'],
|
maxmin: true,
|
content: [basePath
|
+ '/developer/quartzJobDefinition/showHistory?jdId=' + id]
|
}));
|
}
|
|
function pauseJob(id) {
|
layer.confirm('确认暂停该任务吗?', {
|
icon: 3,
|
title: '提示'
|
}, function (index) {
|
layer.close(index);
|
$.AjaxProxy({}).invoke(
|
basePath + "/developer/quartzJobDefinition/pauseJob?jdId="
|
+ id, function (loj) {
|
layer.msg('暂停成功!', {
|
icon: 1,
|
time: 1000
|
}, function (index) {
|
myGrid.serchData();
|
});
|
});
|
});
|
}
|
|
function resumeJob(id) {
|
layer.confirm('确认恢复该任务吗?', {
|
icon: 3,
|
title: '提示'
|
}, function (index) {
|
layer.close(index);
|
$.AjaxProxy({}).invoke(
|
basePath + "/developer/quartzJobDefinition/resumeJob?jdId="
|
+ id, function (loj) {
|
layer.msg('恢复成功!', {
|
icon: 1,
|
time: 1000
|
}, function (index) {
|
myGrid.serchData();
|
});
|
});
|
});
|
}
|
</script>
|
</body>
|
</html>
|