springboot (11)-employee management system to increase employees to achieve

1 Increase staff realization

Insert picture description here
Insert picture description here
add.html

<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<form class="form-horizontal" th:action="@{/emp}" method="post">
						<div class="form-group">
							<label class="col-sm-2 control-label">名字</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" placeholder="zs" name="lastName">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">邮件</label>
							<div class="col-sm-10">
								<input type="email" class="form-control" placeholder="[email protected]" name="email">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">性别</label>
							<div class="col-sm-offset-2 col-sm-10">
								<label>
									<input type="radio" name="gender" checked value="1">&nbsp;</label>
								&nbsp;&nbsp;&nbsp;
								<label>
									<input type="radio" name="gender" value="0">&nbsp;</label>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">部门</label>
							<div class="col-sm-10">
								<select class="form-control" name="department.id">
									<option th:each="dept:${departments}" th:text="${dept.getDepartmentName()}" th:value="${dept.getId()}"></option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">生日</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" placeholder="2000/11/11" name="brith">
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<button class="btn btn-sm btn-success" type="submit">添加</button>
							</div>
						</div>
					</form>
				</main>

Pay <form class="form-horizontal" th:action="@{/emp}" method="post">
Insert picture description here
special attention Pay special attention to add.html we accept an Employee in the controller, so what we need to submit is one of the attributes!

Insert picture description here

Guess you like

Origin blog.csdn.net/zs18753479279/article/details/112689305