赞
踩
基于javaweb+jsp的实验室管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Layui Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.io.Serializable; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @Controller @RequestMapping public class UserController { @Autowired private UserService userService; /** * 增加用户 * * @param response * @param request
<if test ='id != null'>#{id},</if>
<if test ='shebeiName != null'>#{shebeiName},</if>
<if test ='shebeiShiyanshi != null'>#{shebeiShiyanshi},</if>
<if test ='shebeiShuliang != null'>#{shebeiShuliang},</if>
<if test ='shebeiZhuangtai != null'>#{shebeiZhuangtai},</if>
<if test ='shebeiText != null'>#{shebeiText}</if>
</trim>
</insert>
<!--批量删除-->
<delete id="doRemoveBatch" parameterType="java.util.Collection">
DELETE FROM `t_shebei` WHERE `id` IN
<foreach collection="list" item="id" separator="," open="(" close=")">
#{id}
*/ @RequestMapping({"weixiuGet", "weixiuEditPre"}) public void get(HttpServletResponse response, HttpServletRequest request) throws IOException { Serializable id = Util.decode(request, "id");//取出主键id Weixiu vo = weixiuService.get(id); request.getSession().setAttribute("vo", vo); String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面 response.sendRedirect("weixiu_" + to + ".jsp"); } /** * 根据条件查询维修的列表并跳转回页面 * * @param response * @param request * @throws IOException */
let element = layui.element; }); </script> <script type="text/html" id="myToolbar"> <div class="layui-btn-container"> <c:if test="${loginUser.userType == '管理员'}"><button class='layui-btn layui-btn-sm' lay-event='add'>添加</button></c:if> </div> </script> <script> function arrayBufferToBase64(buffer) { let binary = ''; let bytes = new Uint8Array(buffer); let len = bytes.byteLength; for (let i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } return window.btoa(binary); } layui.use('table', function () {
}); //头工具栏事件 table.on('toolbar(myTable)', function (obj) { if ('add' == obj.event) { layer.msg('添加'); layer.open({ type: 2, area: ['800px', '550px'], fixed: false, //不固定 maxmin: true, content: 'shebei_add.jsp' }); } else { //layer.alert('这是工具栏右侧自定义的一个图标按钮'); } }); //搜索 let $ = layui.$, active = { reload: function () { let url = 'shebeiList?keyword=' + $('#search_keyword').val() + '&searchColumn=' + $('#searchColumn').val(); //执行重载 table.reload('myTable', { url: url, page: { curr: 1 //重新从第 1 页开始 }
*/ @RequestMapping("noticeList") public void list(HttpServletResponse response, HttpServletRequest request) throws IOException { this.redirectList(request, response); } /** * 跳转到列表页面 * * @param request * @param response */ private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException { //查询列和关键字 String searchColumn = Util.decode(request, "searchColumn"); String keyword = Util.decode(request, "keyword"); Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件) params.put("searchColumn", searchColumn);//要查询的列 params.put("keyword", keyword);//查询的关键字 response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(noticeService.list(params).get("list"))); } } package com.demo.util;
private String userType;//类型:管理员/普通用户 public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; }
return { "code": 0, //解析接口状态 "msg": '', //解析提示文本 "count": res.length, //解析数据长度(集合个数) "data": result //解析数据列表 }; }, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档 layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'], //自定义分页布局 groups: 1, //只显示 1 个连续页码 first: false, //不显示首页 last: false, //不显示尾页 }, toolbar: '#myToolbar', //开启头部工具栏,并为其绑定左侧模板 defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可 title: '提示', layEvent: 'LAYTABLE_TIPS',
this.redirectList(request, response); } /** * 删除用户 * * @param response * @param request * @throws IOException */ @RequestMapping("userDelete") public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException { Serializable id = Util.decode(request, "id"); userService.delete(Arrays.asList(id)); this.redirectList(request, response); } /** * 编辑用户 * * @param response * @param request * @throws IOException
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>实验室管理系统</title>
<link rel="stylesheet" href="js/layui/css/layui.css">
<script src="js/jquery.js"></script>
<script src="js/layer.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo" style="font-weight: bold;font-size: 19px">实验室管理系统</div>
<ul class="layui-nav layui-layout-left"></ul>
<c:if test="${loginUser==null}">
<ul class="layui-nav layui-layout-right">
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、设备模块、实验室模块、维修模块的增删改查管理
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。