首页
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>任务列表</title>
<script src="../static/bootstrap-5.1.0-dist/js/bootstrap.bundle.min.js"></script>
<script src="../static/js/jquery-3.7.1.min.js"></script>
<script src="../static/js/tempfile.js"></script> <!-- 引用新的 JS 文件 -->
<link rel="stylesheet" href="../static/bootstrap-5.1.0-dist/css/bootstrap.min.css">
<style>
.container {
margin-top: 50px;
}
</style>
</head>
<body>
<div class="container">
<h1>任务列表</h1>
<!-- 添加搜索框 -->
<div class="input-group mb-3">
<input type="text" class="form-control" id="search-txt" placeholder="搜索任务名称...">
<button class="btn btn-primary" type="button" id="search-btn">搜索</button>
<button class="btn btn-primary" type="button" id="add-btn">添加</button>
<button class="btn btn-primary" type="button" id="delete-btn">删除</button>
</div>
<table class="table">
<thead>
<tr>
<th>选项</th>
<th>ID</th>
<th>名称</th>
<th>分组</th>
<th>内容</th>
<th>表达式</th>
<th>状态</th>
<th>日期</th>
<th>操作</th>
<th>操作</th>
</tr>
</thead>
<tbody id="taskTableBody">
</tbody>
</table>
<button class="btn btn-primary" onclick="loadTasks()">加载任务</button>
</div>
</body>
</html>
添加页面
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>新增</title>
<script src="../static/js/jquery-3.7.1.min.js"></script>
<script src="../static/js/tempfileadd.js"></script>
<link href="../static/bootstrap-5.1.0-dist/css/bootstrap.css" rel="stylesheet">
<script src="../static/bootstrap-5.1.0-dist/js/bootstrap.bundle.js"></script>
</head>
<body>
<div class="container mt-5">
<form>
<h1 class="mb-4">新增任务</h1>
<div class="row mb-3">
<div class="col-md-2 col-form-label">任务编号</div>
<div class="col-md-10">
<!-- 这里假设任务编号是只读的 -->
<input type="text" class="form-control" id="task_id" readonly>
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 col-form-label">任务名称</div>
<div class="col-md-10">
<input type="text" class="form-control" id="task_name">
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 col-form-label">任务分组</div>
<div class="col-md-10">
<input type="text" class="form-control" id="task_group">
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 col-form-label">调用目标字符串</div>
<div class="col-md-10">
<input type="text" class="form-control" id="task_content">
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 col-form-label">执行表达式</div>
<div class="col-md-10">
<input type="text" class="form-control" id="task_expression">
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 col-form-label">任务状态</div>
<div class="col-md-10">
<input type="text" class="form-control" id="task_state">
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 col-form-label">创建时间</div>
<div class="col-md-10">
<input type="date" class="form-control" id="task_date">
</div>
</div>
<div class="row">
<div class="col text-center">
<button type="button" class="btn btn-primary me-2" id="btn-save">保存</button>
<button type="button" class="btn btn-secondary" id="btn-cancel">取消</button>
</div>
</div>
</form>
</div>
</body>
</html>
修改页面
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>修改</title>
<script src="../static/js/jquery-3.7.1.min.js"></script>
<script src="../static/js/tempfileupdeat.js"></script>
<link href="../static/bootstrap-5.1.0-dist/css/bootstrap.css" rel="stylesheet">
<script src="../static/bootstrap-5.1.0-dist/js/bootstrap.bundle.js"></script>
<style>
body {
background-color: #f8f9fa;
}
.form-container {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="form-container">
<h1 class="mb-4">修改任务</h1>
<form>
<div class="mb-3 row">
<label for="task_id" class="col-md-3 col-form-label">任务编号</label>
<div class="col-md-9">
<span id="task_id" class="form-control-plaintext">${task.taskId}</span>
</div>
</div>
<div class="mb-3 row">
<label for="task_name" class="col-md-3 col-form-label">任务名称</label>
<div class="col-md-9">
<input type="text" class="form-control" id="task_name" value="${task.taskName}">
</div>
</div>
<div class="mb-3 row">
<label for="task_group" class="col-md-3 col-form-label">任务分组</label>
<div class="col-md-9">
<input type="text" class="form-control" id="task_group" value="${task.taskGroup}">
</div>
</div>
<div class="mb-3 row">
<label for="task_content" class="col-md-3 col-form-label">调用目标字符串</label>
<div class="col-md-9">
<input type="text" class="form-control" id="task_content" value="${task.taskContent}">
</div>
</div>
<div class="mb-3 row">
<label for="task_expression" class="col-md-3 col-form-label">执行表达式</label>
<div class="col-md-9">
<input type="text" class="form-control" id="task_expression" value="${task.taskExpression}">
</div>
</div>
<div class="mb-3 row">
<label for="task_state" class="col-md-3 col-form-label">任务状态</label>
<div class="col-md-9">
<input type="text" class="form-control" id="task_state" value="${task.taskState}">
</div>
</div>
<div class="mb-3 row">
<label for="task_date" class="col-md-3 col-form-label">创建时间</label>
<div class="col-md-9">
<input type="date" class="form-control" id="task_date" value="${task.taskDate}">
</div>
</div>
<div class="row">
<div class="col text-center">
<button type="button" class="btn btn-primary me-2" id="btn-enter">保存</button>
<button type="button" class="btn btn-secondary" id="btn-cancel">取消</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>