员工管理系统---SpringBoot

目录结构
在这里插入图片描述
全部代码

package com.kuang.config;import org.springframework.web.servlet.HandlerInterceptor;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;//拦截器
public class LoginHandlerInterceptor implements HandlerInterceptor {@Overridepublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {//登录成功之后,应该有用户的sessionObject loginuser = request.getSession().getAttribute("loginuser");if(loginuser==null){//没有登录,而是直接进入的首页,肯定是不让进的request.setAttribute("msg", "没有权限,请先登录");request.getRequestDispatcher("/index.html").forward(request, response);return false;}else {return true;}}
}
package com.kuang.config;import org.springframework.boot.autoconfigure.web.WebProperties;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.LocaleResolver;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Locale;//国际化
public class MyLocaleResolver implements LocaleResolver {//解析请求@Overridepublic Locale resolveLocale(HttpServletRequest request) {//获取请求中的语言参数String lan = request.getParameter("l");Locale locale = Locale.getDefault(); //如果没有就使用默认的//如果请求的链接携带了国际化的参数if (!StringUtils.isEmpty(lan)) {String[] split = lan.split("_");//国家,地区locale = new Locale(split[0], split[1]);}return locale;}@Overridepublic void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) {}
}
package com.kuang.config;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;@Configuration
public class MyMvcConfig implements WebMvcConfigurer {@Overridepublic void addViewControllers(ViewControllerRegistry registry) {registry.addViewController("/").setViewName("index");registry.addViewController("/index.html").setViewName("index");registry.addViewController("/main.html").setViewName("dashboard");}//自定义的国际化组件就生效了@Beanpublic LocaleResolver localeResolver(){return new MyLocaleResolver();}@Overridepublic void addInterceptors(InterceptorRegistry registry) {registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**").excludePathPatterns("/index.html","/","/user/login","/css/**","/js/**","/img/**");}}
package com.kuang.controller;import com.kuang.dao.DepartmentDao;
import com.kuang.dao.EmployeeDao;
import com.kuang.pojo.Department;
import com.kuang.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;import java.util.Collection;@Controller
public class EmployeeController {@AutowiredDepartmentDao departmentDao;@AutowiredEmployeeDao employeeDao;@RequestMapping("/emps")public String list(Model model) {Collection<Employee> employees = employeeDao.getAll();model.addAttribute("emps", employees);return "emp/list";}@GetMapping("/emp")public String toAdd(Model model) {//查出部门的所有信息Collection<Department> departments = departmentDao.getDepartment();model.addAttribute("departments", departments);return "emp/add";}@PostMapping("/emp")public String add(Employee employee) {System.out.println(employee);
//        添加的操作employeeDao.save(employee);return "redirect:/emps";}//去员工的修改页面@GetMapping("/upemp/{id}")public String toupdataEmp(@PathVariable("id") Integer id, Model model) {//查出原来的数据Employee employee = employeeDao.getEmployeeById(id);model.addAttribute("emp", employee);Collection<Department> departments = departmentDao.getDepartment();model.addAttribute("departments", departments);return "emp/update";}@PostMapping("/updateEmp")public String updataEmp(Employee employee) {employeeDao.save(employee);return "redirect:/emps";}//删除员工@GetMapping("/deleteEmp/{id}")public String deleteEmp(@PathVariable("id") int id) {employeeDao.delete(id);return "redirect:/emps";}}
package com.kuang.controller;import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;import javax.servlet.http.HttpSession;@Controller
public class LoginController {@RequestMapping("/user/login")public String login(@RequestParam("username") String username,@RequestParam("password") String password,Model model,HttpSession session) {//具体的业务if (!StringUtils.isEmpty(username) && "123456".equals(password)) {session.setAttribute("loginuser", username);return "redirect:/main.html";} else {//告诉用户你登录失败了model.addAttribute("msg", "用户名或者密码错误");return "index";}}@RequestMapping("/user/loginout")public String loginout(HttpSession session) {session.invalidate();return "redirect:/index/html";}}
package com.kuang.dao;import com.kuang.pojo.Department;
import org.springframework.stereotype.Repository;import java.util.Collection;
import java.util.HashMap;
import java.util.Map;@Repository
public class DepartmentDao {//模拟数据库的数据private static Map<Integer, Department> departments = null;static {//创建一个部门表departments = new HashMap<Integer, Department>();departments.put(101, new Department(101, "教学部"));departments.put(102, new Department(102, "市场部"));departments.put(103, new Department(103, "教研部"));departments.put(104, new Department(104, "运营部"));departments.put(105, new Department(105, "后勤部"));}//获得所有部门信息public Collection<Department> getDepartment(){return departments.values();}//通过ID的到部门public Department getDepartmentById(Integer id){return  departments.get(id);}}
package com.kuang.dao;import com.kuang.pojo.Department;
import com.kuang.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;import java.util.Collection;
import java.util.HashMap;
import java.util.Map;@Repository
//员工Dao
public class EmployeeDao {//模拟数据中的信息private static Map<Integer, Employee> employees = null;//员工有所属的部门@Autowiredprivate DepartmentDao departmentDao;static {//创建一个员工表employees = new HashMap<Integer, Employee>();employees.put(1001, new Employee(1001, "AA", "2921625927@qq.com", 1, new Department(101, "教学部")));employees.put(1002, new Employee(1002, "BB", "4534545434@qq.com", 0, new Department(102, "市场部")));employees.put(1003, new Employee(1003, "CC", "7767546755@qq.com", 1, new Department(103, "教研部")));employees.put(1004, new Employee(1004, "DD", "7654788797@qq.com", 0, new Department(104, "运营部")));employees.put(1005, new Employee(1005, "EE", "4343546768@qq.com", 1, new Department(105, "后勤部")));}//主键自增加private static Integer initId = 1006;//增加一个员工public void save(Employee employee) {if (employee.getId() == null) {employee.setId(initId++);}employee.setDepartment(departmentDao.getDepartmentById(employee.getDepartment().getId()));employees.put(employee.getId(), employee);}//查询全部的员工信息public Collection<Employee> getAll(){return employees.values();}//通过ID查询员工public Employee getEmployeeById(Integer id){return employees.get(id);}//通过ID删除员工public void delete(Integer id){employees.remove(id);}
}
package com.kuang.pojo;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {private  Integer id;private String departmentName;
}
package com.kuang.pojo;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;import java.util.Date;
@Data
@NoArgsConstructor
public class Employee {private Integer id;private String lastName;private String email;private Integer gender;private Department department;private Date birth;public Employee(Integer id, String lastName, String email, Integer gender, Department department) {this.id = id;this.lastName = lastName;this.email = email;this.gender = gender;this.department = department;this.birth=new Date();}
}
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"><!--头部导航栏-->
<!--顶部导航栏-->
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0" th:fragment="topbar"><a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">[[${session.loginuser}]]</a><input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search"><ul class="navbar-nav px-3"><li class="nav-item text-nowrap"><a class="nav-link" th:href="@{/user/loginout}">注销</a></li></ul>
</nav><!--侧边栏-->
<!--侧边栏-->
<nav class="col-md-2 d-none d-md-block bg-light sidebar" th:fragment="sidebar"><div class="sidebar-sticky"><ul class="nav flex-column"><li class="nav-item"><a th:class="${active=='main.html'?'nav-link active':'nav-link'}" th:href="@{/templates/index.html}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>首页 <span class="sr-only">(current)</span></a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>Orders</a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>Products</a></li><li class="nav-item"><a th:class="${active=='list.html'?'nav-link active':'nav-link'}"  th:href="@{/emps}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>员工管理</a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart-2"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg>Reports</a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-layers"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>Integrations</a></li></ul><h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"><span>Saved reports</span><a class="d-flex align-items-center text-muted" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></a></h6><ul class="nav flex-column mb-2"><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>Current month</a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>Last quarter</a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>Social engagement</a></li><li class="nav-item"><a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>Year-end sale</a></li></ul></div>
</nav></html>
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content=""><title>Dashboard Template for Bootstrap</title><!-- Bootstrap core CSS --><link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"><!-- Custom styles for this template --><link th:href="@{/css/dashboard.css}" rel="stylesheet"><style type="text/css">/* Chart.js */@-webkit-keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}@keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}.chartjs-render-monitor {-webkit-animation: chartjs-render-animation 0.001s;animation: chartjs-render-animation 0.001s;}</style>
</head><body>
<div th:replace="~{commons/commons::topbar}"></div><div class="container-fluid"><div class="row"><div th:replace="~{commons/commons::sidebar(active='list.html')}"></div><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="张三" 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="1234567456@qq.com" 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="birth"></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></div>
</div><!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script><!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>feather.replace()
</script><!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>var ctx = document.getElementById("myChart");var myChart = new Chart(ctx, {type: 'line',data: {labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],datasets: [{data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],lineTension: 0,backgroundColor: 'transparent',borderColor: '#007bff',borderWidth: 4,pointBackgroundColor: '#007bff'}]},options: {scales: {yAxes: [{ticks: {beginAtZero: false}}]},legend: {display: false,}}});
</script></body></html>
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content=""><title>Dashboard Template for Bootstrap</title><!-- Bootstrap core CSS --><link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"><!-- Custom styles for this template --><link th:href="@{/css/dashboard.css}" rel="stylesheet"><style type="text/css">/* Chart.js */@-webkit-keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}@keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}.chartjs-render-monitor {-webkit-animation: chartjs-render-animation 0.001s;animation: chartjs-render-animation 0.001s;}</style>
</head><body>
<div th:replace="~{commons/commons::topbar}"> </div><div class="container-fluid"><div class="row"><div th:replace="~{commons/commons::sidebar(active='list.html')}"></div><main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4"><form class="form-inline" style="float: left;"><h2>员工列表</h2><p style="width: 650px;"></p><a class="btn btn-sm btn-success" th:href="@{/emp}">添加</a></form><div class="table-responsive"><table class="table table-striped table-sm"><thead><tr><th>编号</th><th>姓名</th><th>邮箱</th><th>性别</th><th>部门</th><th>生日</th><th>操作</th></tr></thead><tbody><tr th:each="emp:${emps}"><td th:text="${emp.getId()}"></td><td th:text="${emp.getLastName()}"></td><td th:text="${emp.getEmail()}"></td><td th:text="${emp.getGender()==0?'':''}"></td><td th:text="${emp.getDepartment().getDepartmentName()}"></td><td th:text="${#dates.format(emp.getBirth(),'yyyy-MM-dd')}"></td><td><a class="btn btn-sm btn-primary" th:href="@{/upemp/}+${emp.getId()}">编辑</a><a class="btn btn-sm btn-danger"  th:href="@{/deleteEmp/}+${emp.getId()}">删除</a></td></tr></tbody></table></div></main></div>
</div><!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script><!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>feather.replace()
</script><!-- Graphs -->
<script type="text/javascript" src="asserts/js/Chart.min.js"></script>
<script>var ctx = document.getElementById("myChart");var myChart = new Chart(ctx, {type: 'line',data: {labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],datasets: [{data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],lineTension: 0,backgroundColor: 'transparent',borderColor: '#007bff',borderWidth: 4,pointBackgroundColor: '#007bff'}]},options: {scales: {yAxes: [{ticks: {beginAtZero: false}}]},legend: {display: false,}}});
</script></body></html>
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content=""><title>Dashboard Template for Bootstrap</title><!-- Bootstrap core CSS --><link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"><!-- Custom styles for this template --><link th:href="@{ /css/dashboard.css}" rel="stylesheet"><style type="text/css">/* Chart.js */@-webkit-keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}@keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}.chartjs-render-monitor {-webkit-animation: chartjs-render-animation 0.001s;animation: chartjs-render-animation 0.001s;}</style>
</head><body>
<div th:replace="~{commons/commons::topbar}"></div><div class="container-fluid"><div class="row"><div th:replace="~{commons/commons::sidebar(active='list.html')}"></div><main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4"><form class="form-horizontal" th:action="@{/updateEmp}" method="post"><input type="hidden" name="id" th:value="${emp.getId()}" ><div class="form-group"><label class="col-sm-2 control-label">名字</label><div class="col-sm-10"><input type="text" class="form-control"  name="lastName" th:value="${emp.getLastName()}"></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" th:value="${emp.getEmail()}" 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 th:checked="${emp.getGender()==1}" type="radio" name="gender" checked value="1">&nbsp;</label>&nbsp;&nbsp;&nbsp;<label><input th:checked="${emp.getGender()==0}" 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:selected="${emp.getDepartment().getId()==dept.getId()}" 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 th:value="${#dates.format(emp.getBirth(),'yyyy/MM/dd')}" type="text" class="form-control"  name="birth"></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></div>
</div><!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script><!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js"></script>
<script>feather.replace()
</script><!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js"></script>
<script>var ctx = document.getElementById("myChart");var myChart = new Chart(ctx, {type: 'line',data: {labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],datasets: [{data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],lineTension: 0,backgroundColor: 'transparent',borderColor: '#007bff',borderWidth: 4,pointBackgroundColor: '#007bff'}]},options: {scales: {yAxes: [{ticks: {beginAtZero: false}}]},legend: {display: false,}}});
</script></body></html>
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content=""><title>Dashboard Template for Bootstrap</title><!-- Bootstrap core CSS --><link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"><!-- Custom styles for this template --><link th:href="@{/css/dashboard.css}" rel="stylesheet"><style type="text/css">/* Chart.js */@-webkit-keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}@keyframes chartjs-render-animation {from {opacity: 0.99}to {opacity: 1}}.chartjs-render-monitor {-webkit-animation: chartjs-render-animation 0.001s;animation: chartjs-render-animation 0.001s;}</style>
</head><body>
<div th:replace="~{commons/commons::topbar}"> </div><div class="container-fluid"><div class="row"><!--侧边栏--><!--传递参数给组件--><div th:replace="~{commons/commons::sidebar(active='main.html')}"></div><main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4"><div class="chartjs-size-monitor" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;"><div class="chartjs-size-monitor-expand" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="chartjs-size-monitor-shrink" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div></div><div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom"><h1 class="h2">Dashboard</h1><div class="btn-toolbar mb-2 mb-md-0"><div class="btn-group mr-2"><button class="btn btn-sm btn-outline-secondary">Share</button><button class="btn btn-sm btn-outline-secondary">Export</button></div><button class="btn btn-sm btn-outline-secondary dropdown-toggle"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>This week</button></div></div><canvas class="my-4 chartjs-render-monitor" id="myChart" width="1076" height="454" style="display: block; width: 1076px; height: 454px;"></canvas></main></div>
</div><!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery-3.2.1.slim.min.js" ></script>
<script type="text/javascript" src="/js/popper.min.js" ></script>
<script type="text/javascript" src="/js/bootstrap.min.js" ></script><!-- Icons -->
<script type="text/javascript" src="/js/feather.min.js" ></script>
<script>feather.replace()
</script><!-- Graphs -->
<script type="text/javascript" src="/js/Chart.min.js" ></script>
<script>var ctx = document.getElementById("myChart");var myChart = new Chart(ctx, {type: 'line',data: {labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],datasets: [{data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],lineTension: 0,backgroundColor: 'transparent',borderColor: '#007bff',borderWidth: 4,pointBackgroundColor: '#007bff'}]},options: {scales: {yAxes: [{ticks: {beginAtZero: false}}]},legend: {display: false,}}});
</script></body></html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thmeleaf.org"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content=""><meta name="author" content=""><title>Signin Template for Bootstrap</title><!-- Bootstrap core CSS --><link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"><!-- Custom styles for this template --><link th:href="@{/css/signin.css}" rel="stylesheet"></head><body class="text-center"><form class="form-signin" th:action="@{/user/login}"><img class="mb-4" th:src="@{/img/bootstrap-solid.svg}" alt="" width="72" height="72"><h1 class="h3 mb-3 font-weight-normal" th:text="#{login.tip}">Please sign in</h1><!--如果msg的值为空则不显示消息--><p style="color: red" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></p><input type="text" name="username" class="form-control" th:placeholder="#{login.username}" required="" autofocus=""><input type="password" name="password" class="form-control" th:placeholder="#{login.password}" required=""><div class="checkbox mb-3"><label><input type="checkbox" value="remember-me" th:text="#{login.remember}"></label></div><button class="btn btn-lg btn-primary btn-block" type="submit">[[#{login.btn}]]</button><p class="mt-5 mb-3 text-muted">© 2017-2018</p><a class="btn btn-sm" th:href="@{/index.html(l='zh_CN')}">中文</a><a class="btn btn-sm" th:href="@{/index.html(l='en_US')}">English</a></form></body></html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/327602.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

深入Java集合系列之五:PriorityQueue

转载自 深入Java集合系列之五&#xff1a;PriorityQueue 前言 今天继续来分析一下PriorityQueue的源码实现&#xff0c;实际上在Java集合框架中&#xff0c;还有ArrayDeque&#xff08;一种双端队列&#xff09;&#xff0c;这里就来分析一下PriorityQueue的源码。PriorityQu…

抹掉所有内容和设置 连接到icloud时出错 iphone还原出厂设置

设置-》抹掉所有内容和设置 点击设置 在顶部输入框中 输入抹掉 2个子就可以找到 1&#xff0c;点通用&#xff0c;存储用量&#xff0c;如果icloud为不可用&#xff0c; 设置--蜂窝数据-网络为无线网和蜂窝数据&#xff0c;成功的点个赞吧~&#xff01;&#xff08;这个过…

微服务的前世今生

译者&#xff1a;周元昊 与许多人认为的不同&#xff0c;微服务的概念已有相当长的历史&#xff0c;SOA&#xff08;面向服务的体系架构&#xff09;也不是90年代才被提出的。在最近举办的伦敦微服务大会上&#xff0c;Greg Young就微服务核心概念的前世今生进行了演讲。其中他…

在idea 中添加和删除模块Module

在idea 中添加和删除模块Module ThinkPet 2018-12-22 10:12:50 4125 收藏 1 分类专栏&#xff1a; idea 版权 1.添加模块 2.删除模块 ———————————————— 版权声明&#xff1a;本文为CSDN博主「ThinkPet」的原创文章&#xff0c;遵循CC 4.0 BY-SA版权协议&am…

ASP.NET Core File Providers

ASP.NET Core通过对File Providers的使用实现了对文件系统访问的抽象。 查看或下载示例代码 File Provider 抽象 File Providers是文件系统之上的一层抽象。它的主要接口是IFileProvider。IFileProvider公开了相应方法用来获取文件信息&#xff08;IFileInfo&#xff09;&#…

IJ实现侧边栏单独搜索

第一步任意点击一个 第二步输入要搜索的单词

关于全局ID,雪花(snowflake)算法的说明

C#版本的国外朋友已经封装了&#xff0c;大家可以去看看&#xff1a;https://github.com/ccollie/snowflake-net 强大的网友出来个简化版本&#xff1a;http://blog.csdn.net/***/article/details/*** &#xff08;地址我就不贴了&#xff0c;对前辈需要最起码的尊敬&#xff0…

SecureCRT的下载、安装( 过程非常详细!!值得查看)

我自己百度联通主号有存储了 可以下下来 有视频加这个文档 就可以了 https://blog.csdn.net/qq_39052513/article/details/100272502 SecureCRT的下载、安装&#xff08; 过程非常详细&#xff01;&#xff01;值得查看&#xff09; 置顶 超Ren专属 2020-06-02 21:29:33 1…

整合Druid---SpringBoot

整合Druid(数据源) Druid简介 Java程序很大一部分要操作数据库&#xff0c;为了提高性能操作数据库的时候&#xff0c;又不得不使用数据库连接池。 Druid 是阿里巴巴开源平台上一个数据库连接池实现&#xff0c;结合了 C3P0、DBCP 等 DB 池的优点&#xff0c;同时加入了日志…

理想的互联网服务后台框架的九个要点

理想的互联网服务后台框架的九个要点对于互联网服务后台团队&#xff0c;开发框架的选择是非常关键的一个问题&#xff0c;多年的海量服务经验和教训使得我们团队深刻的认识到&#xff1a; 要尽早规范团队的开发服务框架&#xff0c;避免到了后期&#xff0c;各种开发语言混杂、…

虚拟机安装centeros7 无法连接网络 virsh命令找不到 删除多余的vir0 不然dubbo会有问题

进入linux ping www.baidu.com 无法访问 cd /etc/sysconfig/network-scripts vi ifcfg-ens33 修改这个文件 onbootyes 原来是on shutdown -h now 关机 然后重启虚拟机 再次ping ping www.baidu.com 就通了 https://www.zhihu.com/question/53708440 virsh命令找…

Azure 部署 Asp.NET Core Web App

在云计算大行其道的时代&#xff0c;当你在部署一个网站时&#xff0c;第一选择肯定是各式各样的云端服务。那么究竟使用什么样的云端服务才能够以最快捷的方式部署一个 ASP.NET Core 的网站呢&#xff1f;Azure 的 Web App 服务是个很好的选择。 下面我们会通过 Visual Studio…

联想linux笔记本评测,联想(lenovo)G460AL-ITH Linux笔记本电脑CPU测试评测-ZOL中关村在线...

这颗英特尔最新的Core i5 430M双核心处理器基于32nm工艺&#xff0c;核心代号为Arrandate&#xff0c;主频为2.27GHz&#xff0c;共享的三级缓存为3MB。在开启睿频加速时&#xff0c;单核心的主频最高为2.53GHz&#xff0c;并且支持同步超线程技术。同时除了支持上一代处理器所…

SecureCRT连接Linux的操作步骤

https://www.cnblogs.com/Koma-vv/p/11100565.html SecureCRT连接Linux的操作步骤 虚拟机待机&#xff1a;Ctrlg进入 ipconfig是Windows里面的操作 ifconfig是Linux里面的操作 解决方法&#xff1a;右键&#xff1a; 打开终端是&#xff1a;在桌面上&#xff0c;鼠标右键才可…

聊聊并发(四)深入分析ConcurrentHashMap

转载自 聊聊并发&#xff08;四&#xff09;深入分析ConcurrentHashMap 术语定义 术语英文解释哈希算法hash algorithm是一种将任意内容的输入转换成相同长度输出的加密方式&#xff0c;其输出被称为哈希值。 哈希表hash table根据设定的哈希函数H(key)和处理冲突方法将一组…

IDEA 底部工具栏没有 Version Control 解决办法

IDEA 底部工具栏没有 Version Control 解决办法 百度了半天 都说VCS配置不对 但是默认IDEA是配置好的 根本不需要修改 忽然看到 工具栏的快捷键 于是 Alt 9 就出现了 完美

一个基于Microsoft Azure、ASP.NET Core和Docker的博客系统

2008年11月&#xff0c;我在博客园开通了个人帐号&#xff0c;并在博客园发表了自己的第一篇博客。当然&#xff0c;我写博客也不是从2008年才开始的&#xff0c;在更早时候&#xff0c;也在CSDN和系统分析员协会&#xff08;之后名为“希赛网”&#xff09;个人空间发布过一些…

聊聊并发-Java中的Copy-On-Write容器

转载自 聊聊并发-Java中的Copy-On-Write容器 Copy-On-Write简称COW&#xff0c;是一种用于程序设计中的优化策略。其基本思路是&#xff0c;从一开始大家都在共享同一个内容&#xff0c;当某个人想要修改这个内容的时候&#xff0c;才会真正把内容Copy出去形成一个新的内容然后…

集成SpringSecurity---SpringBoot

集成SpringSecurity 安全简介 在 Web 开发中&#xff0c;安全一直是非常重要的一个方面。安全虽然属于应用的非功能性需求&#xff0c;但是应该在应用开发的初期就考虑进来。如果在应用开发的后期才考虑安全的问题&#xff0c;就可能陷入一个两难的境地&#xff1a;一方面&am…

大新闻!Magic Leap造假,HoloLens即将入华商用

昨天微软搞了大新闻&#xff0c;Terry和Alexi到了深圳&#xff0c;在WinHEC大会上宣布了2017上半年HoloLens正式入华商用。 而唯一竞争对手Magic Leap今天也被曝光其设备造假&#xff0c;各大科技媒体纷纷报道&#xff0c;部分相关报道如下&#xff1a; 【新浪科技】Magic Lea…