有一张配置表,参数有接口名称、接口id、接口路径,有效标志、创建时间、修改时间、操作人,请以bootstrap生成前端html配置页面
时间: 2023-08-16 10:07:02 浏览: 139
好的,以下是一个简单的示例代码,你可以根据需要进行修改和扩展:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>配置页面</title>
<!-- 引入Bootstrap框架 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>配置页面</h1>
<hr>
<!-- 添加配置按钮 -->
<button class="btn btn-primary" data-toggle="modal" data-target="#addModal">添加配置</button>
<hr>
<!-- 配置表格 -->
<table class="table table-striped">
<thead>
<tr>
<th>接口名称</th>
<th>接口ID</th>
<th>接口路径</th>
<th>有效标志</th>
<th>创建时间</th>
<th>修改时间</th>
<th>操作人</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<!-- 配置数据 -->
<tr>
<td>接口1</td>
<td>1001</td>
<td>/api/1</td>
<td>是</td>
<td>2019-01-01 10:00:00</td>
<td>2019-01-01 11:00:00</td>
<td>张三</td>
<td>
<!-- 修改按钮 -->
<button class="btn btn-info" data-toggle="modal" data-target="#editModal">修改</button>
<!-- 删除按钮 -->
<button class="btn btn-danger" data-toggle="modal" data-target="#deleteModal">删除</button>
</td>
</tr>
<!-- 更多配置数据 -->
</tbody>
</table>
</div>
<!-- 添加配置对话框 -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addModalLabel">添加配置</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- 添加配置表单 -->
<form>
<div class="form-group">
<label for="addName">接口名称</label>
<input type="text" class="form-control" id="addName" placeholder="请输入接口名称">
</div>
<div class="form-group">
<label for="addId">接口ID</label>
<input type="text" class="form-control" id="addId" placeholder="请输入接口ID">
</div>
<div class="form-group">
<label for="addPath">接口路径</label>
<input type="text" class="form-control" id="addPath" placeholder="请输入接口路径">
</div>
<div class="form-group">
<label for="addFlag">有效标志</label>
<select class="form-control" id="addFlag">
<option>是</option>
<option>否</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
<!-- 修改配置对话框 -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editModalLabel">修改配置</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- 修改配置表单 -->
<form>
<div class="form-group">
<label for="editName">接口名称</label>
<input type="text" class="form-control" id="editName" placeholder="请输入接口名称">
</div>
<div class="form-group">
<label for="editId">接口ID</label>
<input type="text" class="form-control" id="editId" placeholder="请输入接口ID">
</div>
<div class="form-group">
<label for="editPath">接口路径</label>
<input type="text" class="form-control" id="editPath" placeholder="请输入接口路径">
</div>
<div class="form-group">
<label for="editFlag">有效标志</label>
<select class="form-control" id="editFlag">
<option>是</option>
<option>否</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
<!-- 删除配置对话框 -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">删除配置</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>确认删除该配置吗?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-danger">删除</button>
</div>
</div>
</div>
</div>
<!-- 引入jQuery和Bootstrap.js -->
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>
</html>
```
这段代码生成了一个带有表格和添加、修改、删除对话框的配置页面,你可以将其中的数据和表单控件替换为你自己的配置数据和参数,然后在服务器端编写接口,实现对配置的增删改查操作。
阅读全文