于javaweb+jsp的停车场信息管理系统
Posted javayms
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了于javaweb+jsp的停车场信息管理系统相关的知识,希望对你有一定的参考价值。
基于javaweb+jsp的停车场信息管理系统
JavaWeb JavaBean JSP MVC mysql Tomcat javascript
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架…均可
开发工具:idea或eclipse或myeclipse
部分代码实现JSP
);
</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]);
]
],
);
//监听工具条
table.on('tool(myTable)', function (obj) //注:tool 是工具条事件名,myTable 是 table 原始容器的属性 lay-filter="对应的值"
let data = obj.data; //获得当前行数据
let layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
if (layEvent === 'del') //删除
// layer.confirm('删除' + data.cheweiName + "?", function (index)
$.ajax(
type: "GET",
dataType: "text",
url: "cheweiDelete?id=" + data.id,
success: function ()
field: 'cheweiText',
title: '备注',
,
align: 'center',
fixed: 'right',
title: '操作',
width: 130,
templet: vo =>
let flag = $loginUser.userType == '管理员';
return flag ? '<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>' : '';
<title>修改车位</title>
<script src="js/jquery.js"></script>
<link rel="stylesheet" href="js/layui/css/layui.css">
</head>
<body style="padding: 20px">
<form class="layui-form" action="">
<input type="hidden" name="id" class="layui-input" value="$vo.id">
<div class="layui-form-item">
<label class="layui-form-label">车位号:</label>
<div class="layui-input-block">
<input type="text" name="cheweiName" lay-verify="required|cheweiName" class="layui-input" value="$vo.cheweiName">
</div>
</div>
<div class="layui-form-item">
layer.msg('添加');
layer.open(
type: 2,
area: ['800px', '550px'],
fixed: false, //不固定
maxmin: true,
content: 'chewei_add.jsp'
);
else
//layer.alert('这是工具栏右侧自定义的一个图标按钮');
);
//搜索
let $ = layui.$, active =
reload: function ()
let url = 'cheweiList?keyword=' + $('#search_keyword').val() + '&searchColumn=' + $('#searchColumn').val();
field: 'cheweiName',
title: '车位号',
templet: vo => (vo = vo.cheweiName) ? '<a href="#" style="color: #009688;">' + vo + '</a>' : '',
event: 'info',
,
field: 'cheweiArea',
title: '区域',
,
field: 'cheweiStatus',
title: '状态',
templet: vo => vo.cheweiStatus ? vo.cheweiStatus : "",
content: function (value)
layedit.sync(editIndex);
);
//监听提交
form.on('submit(submit-button)', function (data)
$.post("cheweiEdit", data.field, function ()
let index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
parent.layer.close(index); //再执行关闭
parent.location.reload();//刷新父级页面
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item"><a>$loginUser.username</a></li>
<li class="layui-nav-item"><a href="authLogout">退出登录</a></li>
</ul>
</c:if>
</div>
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<ul class="layui-nav layui-nav-tree" lay-filter="test">
<!-- 侧边栏 -->
<jsp:include page="menu.jsp">
<jsp:param value="active" name="Chewei_active"/>
</jsp:include>
</ul>
</div>
</div>
<div class="layui-body">
<div class="search_style" style="padding-top: 10px;padding-left: 15px;">
"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',
icon: 'layui-icon-tips'
],
title: '车位列表',
cols: [
搜索:
<div class="layui-inline">
<input class="layui-input" name="search_keyword" id="search_keyword" autocomplete="off" placeholder="车位号">
<input type="hidden" class="layui-input" name="searchColumn" id="searchColumn" autocomplete="off" value="chewei_name">
</div>
<button class="layui-btn" data-type="reload">搜索</button>
</div>
</div>
<!-- 内容主体区域 -->
<table class="layui-hide" id="myData" lay-filter="myTable"></table>
</div>
</div>
<script src="js/layui/layui.js"/>
<script>
//JavaScript代码区域
layui.use('element', function ()
return false;
);
);
</script>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>车位详情</title>
<script src="js/jquery.js"></script>
<link rel="stylesheet" href="js/layui/css/layui.css">
</head>
<body style="padding: 20px">
<form class="layui-form" action="">
table.reload('myTable',
url: url,
page:
curr: 1 //重新从第 1 页开始
);
;
$('.searchTable .layui-btn').on('click', function ()
let type = $(this).data('type');
active[type] ? active[type].call(this) : '';
);
);
</script>
);
obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
//parent.location.reload();//刷新父级页面
// layer.close(index);
//parent.location.reload();//刷新父级页面
layer.msg(data.cheweiName + ' 删除成功!');
// );
else if (layEvent === 'edit') //编辑
layer.open(
type: 2,
area: ['800px', '550px'],
fixed: false, //不固定
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备注:</label>
<div class="layui-input-block">
<textarea type="text" name="cheweiText" class="layui-input" style="height: 100px;padding-left: 10px;" placeholder="请输入内容......"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="submit" class="layui-btn" lay-submit="" lay-filter="submit-button">添加</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
content: 'cheweiEditPre?id=' + data.id
);
obj.update();//同步更新缓存对应的值
else if (layEvent === 'info') //详情
layer.open(
type: 2,
area: ['800px', '650px'],
fixed: false, //不固定
maxmin: true,
content: 'cheweiGet?id=' + data.id
);
obj.update();//同步更新缓存对应的值
else if (layEvent === 'LAYTABLE_TIPS')
layer.alert('Hi,头部工具栏扩展的右侧图标。');
);
//头工具栏事件
table.on('toolbar(myTable)', function (obj)
<form class="layui-form" action="">
<div class="layui-form-item">
<label class="layui-form-label">车位号:</label>
<div class="layui-input-block">
<input type="text" name="cheweiName" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区域:</label>
<div class="layui-input-block">
<input type="text" name="cheweiArea" lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态:</label>
<div class="layui-input-block">
<input name="cheweiStatus" type="radio" value="占用中" checked="checked" class="layui-input" title="占用中"/>
<div class="layui-input-block">
<input type="text" name="cheweiArea" lay-verify="required|cheweiArea" class="layui-input" value="$vo.cheweiArea">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态:</label>
<div class="layui-input-block">
<input name="cheweiStatus" type="radio" value="占用中" $vo.cheweiStatus=='占用中'?'checked':'' class="layui-input" title="占用中"/>
<input name="cheweiStatus" type="radio" value="空闲" $vo.cheweiStatus=='空闲'?'checked':'' class="layui-input" title="空闲"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">车位号:</label>
<div class="layui-input-block" style="padding: 9px 15px;">
$vo.cheweiName
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区域:</label>
<div class="layui-input-block" style="padding: 9px 15px;">
$vo.cheweiArea
</div>
</div>
<div 于javaweb+jsp的驾校信息管理系统
jsp+servlet+mysql实现的停车场管理系统(分为普通用户和管理员,实现注册登录留言管理停车信息管理IC卡管理用户管理出入场管理等)