front page(usermanage)

Signed-off-by: Chenx221 <chenx221@yandex.com>
This commit is contained in:
Chenx221 2023-06-14 20:01:41 +08:00
parent 9f50b94ac4
commit d5f9f09a10
7 changed files with 61 additions and 254 deletions

View File

@ -0,0 +1,15 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="th:text" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
</profile>
</component>

View File

@ -15,6 +15,5 @@
<select id="getAllUsers" resultType="cyou.chenx221.pojo.User">
SELECT *
FROM user
where disabled = 0
</select>
</mapper>

View File

@ -136,7 +136,7 @@
<button type="button" class="btn btn-primary" onclick="location.href='../dashboard'">返回</button>
<div class="table-container rounded-4 shadow-3-strong"
style="background-color: rgba(255,255,255,0.9); overflow-y: auto; max-height: 400px">
<table class="table table-striped table-hover border-primary ">
<table class="table table-striped table-hover border-primary align-middle">
<thead>
<tr>
<th scope="col">用户ID</th>
@ -144,7 +144,7 @@
<th scope="col">身份</th>
<th scope="col">身份ID</th>
<th scope="col">禁用状态</th>
<th scope="col">操作</th>
<th scope="col" class="text-center">操作</th>
</tr>
</thead>
<tbody>
@ -154,12 +154,23 @@
<td>${user.username}</td>
<td>${user.roles}</td>
<td>${user.detail}</td>
<td>${user.disabled}</td>
<td class="pt-2 pb-2 d-flex align-items-center">
<td>${user.disabled_str}</td>
<td class="text-center">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary btn-sm">Left</button>
<button type="button" class="btn btn-primary btn-sm">Middle</button>
<button type="button" class="btn btn-primary btn-sm">Right</button>
<c:choose>
<c:when test="${user.disabled_str == false}">
<button type="button" class="btn btn-danger"><i class="fas fa-ban me-1"></i>禁用账户
</button>
</c:when>
<c:when test="${user.disabled_str == true}">
<button type="button" class="btn btn-success"><i
class="fas fa-circle-check me-1"></i>启用账户
</button>
</c:when>
</c:choose>
<button type="button" class="btn btn-primary"><i
class="fas fa-arrow-rotate-right me-1"></i>重设密码
</button>
</div>
</td>
</tr>
@ -175,24 +186,11 @@
<a class="nav-link active fs-6" id="ex1-tab-1" data-mdb-toggle="tab" href="#ex1-tabs-1"
role="tab" aria-controls="ex1-tabs-1" aria-selected="true">成绩查询</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-6" id="ex1-tab-2" data-mdb-toggle="tab" href="#ex1-tabs-2"
role="tab" aria-controls="ex1-tabs-2" aria-selected="true">成绩修改</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-6" id="ex1-tab-3" data-mdb-toggle="tab" href="#ex1-tabs-3"
role="tab" aria-controls="ex1-tabs-3" aria-selected="false">成绩删除</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-6" id="ex1-tab-4" data-mdb-toggle="tab" href="#ex1-tabs-4"
role="tab" aria-controls="ex1-tabs-4" aria-selected="false">成绩添加</a>
</li>
</ul>
<!-- Tabs navs -->
<hr class="hr" style="margin: 1px"/>
<!-- Tabs content -->
<div class="tab-content" id="ex1-content">
<%-- 查询--%>
<div class="tab-pane fade show active" id="ex1-tabs-1" role="tabpanel"
aria-labelledby="ex1-tab-1">
<div class="card-body" style="min-width: 175px">
@ -285,111 +283,6 @@
</form>
</div>
</div>
<%-- 修改--%>
<div class="tab-pane fade" id="ex1-tabs-2" role="tabpanel"
aria-labelledby="ex1-tab-2">
<div class="card-body" style="min-width: 175px">
<form action="modinfo" method="post">
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText6" class="form-control"
required name="id"/>
<label class="form-label" for="typeText6">成绩ID (必填)</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText7" class="form-control" required
name="score"/>
<label class="form-label" for="typeText7">成绩 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2 mt-4">
<div class="col-lg-6 text-center">
<button type="submit" class="btn btn-primary">更改
</button>
</div>
<div class="col-lg-6 text-center">
<button type="reset" class="btn btn-secondary">重置</button>
</div>
</div>
</form>
</div>
</div>
<%-- 删除--%>
<div class="tab-pane fade" id="ex1-tabs-3" role="tabpanel" aria-labelledby="ex1-tab-3">
<div class="card-body" style="min-width: 175px">
<form action="delinfo" method="post">
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText8" class="form-control"
required name="id"/>
<label class="form-label" for="typeText8">成绩ID (必填)</label>
</div>
</div>
</div>
<div class="row mb-2 mt-4">
<div class="col-lg-6 text-center">
<button type="submit" class="btn btn-primary">删除</button>
</div>
<div class="col-lg-6 text-center">
<button type="reset" class="btn btn-secondary">重置</button>
</div>
</div>
</form>
</div>
</div>
<%-- 添加--%>
<div class="tab-pane fade" id="ex1-tabs-4" role="tabpanel" aria-labelledby="ex1-tab-4">
<!-- <h5 class="card-header">信息添加</h5> -->
<div class="card-body" style="min-width: 175px">
<form action="addinfo" method="post">
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText9" class="form-control" required
name="studentid"/>
<label class="form-label" for="typeText9">学号 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText10" class="form-control" required
name="courseid"/>
<label class="form-label" for="typeText10">课程号 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText11" class="form-control" required
name="score"/>
<label class="form-label" for="typeText11">成绩 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2 mt-4">
<div class="col-lg-6 text-center">
<button type="submit" class="btn btn-primary">添加
</button>
</div>
<div class="col-lg-6 text-center">
<button type="reset" class="btn btn-secondary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Tabs content -->

View File

@ -1,7 +1,5 @@
package cyou.chenx221.pojo;
import java.util.List;
public class User {
private Integer id;
private String username;
@ -9,6 +7,15 @@ public class User {
private String roles;
private int detail;//对应身份的id
private int disabled;//是否被禁用
private boolean disabled_str;
public boolean getDisabled_str() {
return disabled_str;
}
public void setDisabled_str(boolean disabled_str) {
this.disabled_str = disabled_str;
}
public int getDisabled() {
return disabled;
@ -16,6 +23,7 @@ public class User {
public void setDisabled(int disabled) {
this.disabled = disabled;
this.disabled_str = (disabled != 0);
}
public User(String username, String password, String roles, int detail) {

View File

@ -15,6 +15,5 @@
<select id="getAllUsers" resultType="cyou.chenx221.pojo.User">
SELECT *
FROM user
where disabled = 0
</select>
</mapper>

View File

@ -136,7 +136,7 @@
<button type="button" class="btn btn-primary" onclick="location.href='../dashboard'">返回</button>
<div class="table-container rounded-4 shadow-3-strong"
style="background-color: rgba(255,255,255,0.9); overflow-y: auto; max-height: 400px">
<table class="table table-striped table-hover border-primary ">
<table class="table table-striped table-hover border-primary align-middle">
<thead>
<tr>
<th scope="col">用户ID</th>
@ -144,7 +144,7 @@
<th scope="col">身份</th>
<th scope="col">身份ID</th>
<th scope="col">禁用状态</th>
<th scope="col">操作</th>
<th scope="col" class="text-center">操作</th>
</tr>
</thead>
<tbody>
@ -154,12 +154,23 @@
<td>${user.username}</td>
<td>${user.roles}</td>
<td>${user.detail}</td>
<td>${user.disabled}</td>
<td class="pt-2 pb-2 d-flex align-items-center">
<td>${user.disabled_str}</td>
<td class="text-center">
<div class="btn-group" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary btn-sm">Left</button>
<button type="button" class="btn btn-primary btn-sm">Middle</button>
<button type="button" class="btn btn-primary btn-sm">Right</button>
<c:choose>
<c:when test="${user.disabled_str == false}">
<button type="button" class="btn btn-danger"><i class="fas fa-ban me-1"></i>禁用账户
</button>
</c:when>
<c:when test="${user.disabled_str == true}">
<button type="button" class="btn btn-success"><i
class="fas fa-circle-check me-1"></i>启用账户
</button>
</c:when>
</c:choose>
<button type="button" class="btn btn-primary"><i
class="fas fa-arrow-rotate-right me-1"></i>重设密码
</button>
</div>
</td>
</tr>
@ -175,24 +186,11 @@
<a class="nav-link active fs-6" id="ex1-tab-1" data-mdb-toggle="tab" href="#ex1-tabs-1"
role="tab" aria-controls="ex1-tabs-1" aria-selected="true">成绩查询</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-6" id="ex1-tab-2" data-mdb-toggle="tab" href="#ex1-tabs-2"
role="tab" aria-controls="ex1-tabs-2" aria-selected="true">成绩修改</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-6" id="ex1-tab-3" data-mdb-toggle="tab" href="#ex1-tabs-3"
role="tab" aria-controls="ex1-tabs-3" aria-selected="false">成绩删除</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-6" id="ex1-tab-4" data-mdb-toggle="tab" href="#ex1-tabs-4"
role="tab" aria-controls="ex1-tabs-4" aria-selected="false">成绩添加</a>
</li>
</ul>
<!-- Tabs navs -->
<hr class="hr" style="margin: 1px"/>
<!-- Tabs content -->
<div class="tab-content" id="ex1-content">
<%-- 查询--%>
<div class="tab-pane fade show active" id="ex1-tabs-1" role="tabpanel"
aria-labelledby="ex1-tab-1">
<div class="card-body" style="min-width: 175px">
@ -285,111 +283,6 @@
</form>
</div>
</div>
<%-- 修改--%>
<div class="tab-pane fade" id="ex1-tabs-2" role="tabpanel"
aria-labelledby="ex1-tab-2">
<div class="card-body" style="min-width: 175px">
<form action="modinfo" method="post">
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText6" class="form-control"
required name="id"/>
<label class="form-label" for="typeText6">成绩ID (必填)</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText7" class="form-control" required
name="score"/>
<label class="form-label" for="typeText7">成绩 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2 mt-4">
<div class="col-lg-6 text-center">
<button type="submit" class="btn btn-primary">更改
</button>
</div>
<div class="col-lg-6 text-center">
<button type="reset" class="btn btn-secondary">重置</button>
</div>
</div>
</form>
</div>
</div>
<%-- 删除--%>
<div class="tab-pane fade" id="ex1-tabs-3" role="tabpanel" aria-labelledby="ex1-tab-3">
<div class="card-body" style="min-width: 175px">
<form action="delinfo" method="post">
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText8" class="form-control"
required name="id"/>
<label class="form-label" for="typeText8">成绩ID (必填)</label>
</div>
</div>
</div>
<div class="row mb-2 mt-4">
<div class="col-lg-6 text-center">
<button type="submit" class="btn btn-primary">删除</button>
</div>
<div class="col-lg-6 text-center">
<button type="reset" class="btn btn-secondary">重置</button>
</div>
</div>
</form>
</div>
</div>
<%-- 添加--%>
<div class="tab-pane fade" id="ex1-tabs-4" role="tabpanel" aria-labelledby="ex1-tab-4">
<!-- <h5 class="card-header">信息添加</h5> -->
<div class="card-body" style="min-width: 175px">
<form action="addinfo" method="post">
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText9" class="form-control" required
name="studentid"/>
<label class="form-label" for="typeText9">学号 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText10" class="form-control" required
name="courseid"/>
<label class="form-label" for="typeText10">课程号 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<div class="form-outline">
<input type="number" id="typeText11" class="form-control" required
name="score"/>
<label class="form-label" for="typeText11">成绩 (必填)</label>
</div>
</div>
</div>
<div class="row mb-2 mt-4">
<div class="col-lg-6 text-center">
<button type="submit" class="btn btn-primary">添加
</button>
</div>
<div class="col-lg-6 text-center">
<button type="reset" class="btn btn-secondary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Tabs content -->