myapp_evenfuture 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Dockerfile +7 -0
- package/app.js +58 -0
- package/bin/www +91 -0
- package/package.json +20 -0
- package/public/css/layui.css +1 -0
- package/public/css/lizhi.webp +0 -0
- package/public/css/modules/code.css +1 -0
- package/public/css/modules/laydate/default/laydate.css +1 -0
- package/public/css/modules/layer/default/icon-ext.png +0 -0
- package/public/css/modules/layer/default/icon.png +0 -0
- package/public/css/modules/layer/default/layer.css +1 -0
- package/public/css/modules/layer/default/loading-0.gif +0 -0
- package/public/css/modules/layer/default/loading-1.gif +0 -0
- package/public/css/modules/layer/default/loading-2.gif +0 -0
- package/public/font/iconfont.eot +0 -0
- package/public/font/iconfont.svg +554 -0
- package/public/font/iconfont.ttf +0 -0
- package/public/font/iconfont.woff +0 -0
- package/public/font/iconfont.woff2 +0 -0
- package/public/layui.js +5 -0
- package/public/stylesheets/style.css +8 -0
- package/routes/api.js +505 -0
- package/routes/datatime.js +17 -0
- package/routes/db.js +158 -0
- package/routes/index.js +28 -0
- package/routes/nppBackup/sql.js.2024-07-08_082213.bak +25 -0
- package/routes/nppBackup/sql.js.2024-07-08_082214.bak +25 -0
- package/routes/sql.js +25 -0
- package/routes/switch.js +28 -0
- package/routes/switch1.js +12 -0
- package/views/addstu.ejs +276 -0
- package/views/error.ejs +4 -0
- package/views/hisinfo.ejs +301 -0
- package/views/hisinfo1.ejs +301 -0
- package/views/login.ejs +203 -0
- package/views/modroom.ejs +405 -0
- package/views/modstu.ejs +327 -0
- package/views/rtinfo.ejs +234 -0
- package/views/rtinfo1.ejs +234 -0
package/views/login.ejs
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<title>欢迎使用首都师范大学刷卡签到系统!</title>
|
7
|
+
<meta name="renderer" content="webkit">
|
8
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
10
|
+
<link rel="stylesheet" href="/css/layui.css" media="all">
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body
|
14
|
+
style="background-image: url('https://img1.baidu.com/it/u=1842285442,3167939739&fm=253&fmt=auto&app=138&f=JPEG?w=1200&h=500'); background-size: cover; background-repeat: no-repeat; background-position: center; background-attachment: fixed;">
|
15
|
+
</body>
|
16
|
+
<!--<body style="background-color: #f0f2f5;">-->
|
17
|
+
<!-- 容器 div,使用Flexbox居中内容 -->
|
18
|
+
<div style="display: flex; justify-content: center; align-items: center; height: 600px; width: 1024px; ">
|
19
|
+
<!-- 图片容器 -->
|
20
|
+
<div style="text-align: center;">
|
21
|
+
<!-- 图片,设置高度并添加外边距 -->
|
22
|
+
<img src="https://appimg.dzwww.com/dzcloud/20190521/b2bd143870e629f939d37d1a13c712c3.png" alt="Logo"
|
23
|
+
style="height: 100px; margin-bottom: 20px;">
|
24
|
+
<div>
|
25
|
+
|
26
|
+
<h1>首都师范大学刷卡签到系统欢迎您!</h1>
|
27
|
+
</div>
|
28
|
+
<br />
|
29
|
+
<div>
|
30
|
+
<form class="layui-form" style="margin-top: 40px;" action="/user/logincheck">
|
31
|
+
<div class="layui-form-item">
|
32
|
+
<div class="layui-inline">
|
33
|
+
<label class="layui-form-label"
|
34
|
+
style="width: 120px;background-color: #9de1eb; color: rgb(12, 0, 0);text-align: center; padding: 8px 0; ">用户名:</label>
|
35
|
+
<div class="layui-input-inline">
|
36
|
+
<input type="text" name="usernameinput" id="usernameinput" required value=""
|
37
|
+
style="width: 240px;" lay-verify="required" placeholder="请输入用户名" autocomplete="off"
|
38
|
+
class="layui-input">
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class="layui-form-item">
|
45
|
+
<div class="layui-inline">
|
46
|
+
<label class="layui-form-label"
|
47
|
+
style="width: 120px;background-color: #9de1eb; color: rgb(12, 0, 0);text-align: center; padding: 8px 0;">密
|
48
|
+
码:</label>
|
49
|
+
<div class="layui-input-inline">
|
50
|
+
<input type="password" name="passwordinput" id="passwordinput" required value=""
|
51
|
+
style="width: 240px" lay-verify="required" placeholder="请输入密码" autocomplete="off"
|
52
|
+
class="layui-input">
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div class="layui-form-item">
|
58
|
+
<div class="layui-input-block">
|
59
|
+
<button class="layui-btn" id="formDemo4" name="formDemo4" lay-submit lay-filter="formDemo4"
|
60
|
+
style="background-color: #9de1eb; color: rgb(12, 0, 0);">登录</button>
|
61
|
+
<button class="layui-btn" id="registerBtn"
|
62
|
+
style="background-color: #9de1eb; color: rgb(12, 0, 0);">注册新用户</button>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
</form>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<!-- 注册窗口 -->
|
71
|
+
<div id="registerWindow"
|
72
|
+
style="display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,0.5);">
|
73
|
+
<h3>注册</h3>
|
74
|
+
<button class="layui-btn layui-btn-primary" style="float: right;" id="closeRegisterBtn">取消</button>
|
75
|
+
<form class="layui-form" id="registerForm">
|
76
|
+
<div class="layui-form-item">
|
77
|
+
<label class="layui-form-label">用户名:</label>
|
78
|
+
<div class="layui-input-block">
|
79
|
+
<input type="text" name="username" required lay-verify="required" placeholder="请输入用户名"
|
80
|
+
autocomplete="off" class="layui-input">
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
<div class="layui-form-item">
|
84
|
+
<label class="layui-form-label">密码:</label>
|
85
|
+
<div class="layui-input-block">
|
86
|
+
<input type="password" name="password" required lay-verify="required" placeholder="请输入密码"
|
87
|
+
autocomplete="off" class="layui-input">
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
<div class="layui-form-item">
|
91
|
+
<label class="layui-form-label">确认密码:</label>
|
92
|
+
<div class="layui-input-block">
|
93
|
+
<input type="password" name="confirmPassword" required lay-verify="required" placeholder="请再次输入密码"
|
94
|
+
autocomplete="off" class="layui-input">
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div class="layui-form-item">
|
99
|
+
<div class="layui-input-block">
|
100
|
+
<button class="layui-btn" lay-submit lay-filter="registerForm" style="width: 120px;background-color: #9de1eb; color: rgb(12, 0, 0);text-align: center; padding: 0px 0; ">注册</button>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
</form>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<script src="/layui.js"></script>
|
107
|
+
<script>
|
108
|
+
layui.use(['form', 'layer', 'element', 'table', 'laypage', 'jquery'], function () {
|
109
|
+
var layer = layui.layer,
|
110
|
+
form = layui.form,
|
111
|
+
element = layui.element,
|
112
|
+
table = layui.table,
|
113
|
+
laypage = layui.laypage,
|
114
|
+
$ = layui.jquery;
|
115
|
+
|
116
|
+
$('#registerBtn').on('click', function () {
|
117
|
+
$('#registerWindow').show();
|
118
|
+
});
|
119
|
+
|
120
|
+
// 监听关闭按钮
|
121
|
+
$('#closeRegisterBtn').on('click', function () {
|
122
|
+
$('#registerWindow').hide();
|
123
|
+
});
|
124
|
+
|
125
|
+
form.on('submit(registerForm)', function (data) {
|
126
|
+
var username = data.field.username;
|
127
|
+
var password = data.field.password;
|
128
|
+
var confirmPassword = data.field.confirmPassword;
|
129
|
+
|
130
|
+
if (password !== confirmPassword) {
|
131
|
+
layer.msg('密码和确认密码不一致!');
|
132
|
+
return false;
|
133
|
+
}
|
134
|
+
|
135
|
+
$.ajax({
|
136
|
+
type: 'post',
|
137
|
+
url: '/api/inputcheck4',
|
138
|
+
data: { usernameinput: username },
|
139
|
+
success: function (result) {
|
140
|
+
if (result.sign === 0) {
|
141
|
+
layer.msg('用户名已存在!');
|
142
|
+
return false;
|
143
|
+
}
|
144
|
+
|
145
|
+
$.ajax({
|
146
|
+
type: 'post',
|
147
|
+
url: '/db/register',
|
148
|
+
data: { username: username, password: password},
|
149
|
+
success: function (result) {
|
150
|
+
if (result.status === 'success') {
|
151
|
+
layer.msg('注册成功!');
|
152
|
+
$('#registerWindow').hide();
|
153
|
+
} else {
|
154
|
+
layer.msg('注册失败:' + result.message);
|
155
|
+
}
|
156
|
+
},
|
157
|
+
error: function () {
|
158
|
+
layer.msg('注册失败!');
|
159
|
+
}
|
160
|
+
});
|
161
|
+
},
|
162
|
+
error: function () {
|
163
|
+
layer.msg('检查用户名时发生错误!');
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
return false;
|
168
|
+
});
|
169
|
+
form.on('submit(formDemo4)', function (data) {
|
170
|
+
$.ajax({
|
171
|
+
type: 'post',
|
172
|
+
url: '/api/login',
|
173
|
+
data: data.field,
|
174
|
+
success: function (result) {
|
175
|
+
if (result.sign == 0) {
|
176
|
+
sessionStorage.setItem("username", data.field.usernameinput);
|
177
|
+
$('#username').html("您好,管理员 " + data.field.usernameinput + " !");
|
178
|
+
top.location.href = '/switch';
|
179
|
+
// top.location.reload();
|
180
|
+
}
|
181
|
+
|
182
|
+
else if (result.sign == 1) {
|
183
|
+
layer.msg('密码错误!');
|
184
|
+
}
|
185
|
+
else if (result.sign == 2) {
|
186
|
+
layer.msg('用户名错误!');
|
187
|
+
}
|
188
|
+
else if (result.sign == 3) {
|
189
|
+
layer.msg('普通用户登录!');
|
190
|
+
sessionStorage.setItem("username", '');
|
191
|
+
$('#username').html("您好,普通用户" + data.field.usernameinput + " !");
|
192
|
+
top.location.href = '/switch1';
|
193
|
+
}s
|
194
|
+
}
|
195
|
+
});
|
196
|
+
return false;
|
197
|
+
});
|
198
|
+
|
199
|
+
});
|
200
|
+
</script>
|
201
|
+
</body>
|
202
|
+
|
203
|
+
</html>
|
@@ -0,0 +1,405 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<title>签到管理系统</title>
|
7
|
+
<meta name="renderer" content="webkit">
|
8
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
10
|
+
<link href="/css/layui.css" rel="stylesheet">
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body>
|
14
|
+
<div class="layui-layout layui-layout-admin">
|
15
|
+
<div class="layui-header">
|
16
|
+
<div class="layui-logo layui-hide-xs " style = "background-color:rgb(146, 151, 209); color: black";>签到管理系统</div>
|
17
|
+
|
18
|
+
<!-- 添加水平导航 -->
|
19
|
+
<ul class="layui-nav layui-layout-left">
|
20
|
+
<li class="layui-nav-item">
|
21
|
+
<a href="javascript:;">新增设备信息</a>
|
22
|
+
<dl class="layui-nav-child">
|
23
|
+
<!-- 移动来的表单内容 -->
|
24
|
+
<div class="layui-form" style="width: 500px; padding: 10px;">
|
25
|
+
<div class="layui-form-item">
|
26
|
+
<label class="layui-form-label"style="margin-top: 25px; background-color: rgb(100, 109, 214); color:white;text-align: center;">房间号:</label>
|
27
|
+
<div class="layui-input-inline"style="width: 300px; margin-top: 25px;">
|
28
|
+
<input type="text" id="insertnum" name="insertnum" class="layui-input" lay-verify="required|number|roomnum" style="width: 100%">
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<div class="layui-form-item">
|
32
|
+
<label class="layui-form-label"style="margin-top: 25px; background-color: rgb(100, 109, 214); color: white;text-align: center;">mac:</label>
|
33
|
+
<div class="layui-input-inline"style="width: 300px; margin-top: 25px;">
|
34
|
+
<input type="text" id="insertmac" name="insertmac" class="layui-input" lay-verify="mac" style="width: 100%">
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<div class="layui-form-item">
|
38
|
+
<!-- 确保按钮容器有一定的高度,这里假设至少50px -->
|
39
|
+
<div class="layui-input-block" style="display: flex; justify-content: 100px; align-items: center; ">
|
40
|
+
<button class="layui-btn" lay-submit lay-filter="formDemo2" style="background-color: rgb(100, 109, 214);margin: auto;color :white;">提交</button>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</dl>
|
45
|
+
|
46
|
+
</li>
|
47
|
+
<!-- 导航项 3 -->
|
48
|
+
<li class="layui-nav-item">
|
49
|
+
<a href="javascript:;">提示</a>
|
50
|
+
<dl class="layui-nav-child">
|
51
|
+
<!-- 移动来的表单内容 -->
|
52
|
+
<div class="layui-form" style="width: 500px; padding: 10px;">
|
53
|
+
<div class="layui-form-item">
|
54
|
+
<label class="layui-form-label"style="margin-top: center; color: black;text-align: center;">新增完设备信息后请刷新页面</label>
|
55
|
+
</div>
|
56
|
+
</dl>
|
57
|
+
</li>
|
58
|
+
<!-- 可以继续添加更多的导航项 -->
|
59
|
+
</ul>
|
60
|
+
<ul class="layui-nav layui-layout-right">
|
61
|
+
<li class="layui-nav-item layui-hide layui-show-sm-inline-block">
|
62
|
+
<a href="javascript:;">
|
63
|
+
<img src="/css/lizhi.webp" class="layui-nav-img">
|
64
|
+
</a>
|
65
|
+
<dl class="layui-nav-child">
|
66
|
+
<dd><a href="/">退出登录</a></dd>
|
67
|
+
</dl>
|
68
|
+
</li>
|
69
|
+
<li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
|
70
|
+
<a href="javascript:;">
|
71
|
+
<i class="layui-icon layui-icon-more-vertical"></i>
|
72
|
+
</a>
|
73
|
+
</li>
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<div class="layui-side " style="background-color: rgb(146, 151, 209)">
|
78
|
+
<div class="layui-side-scroll">
|
79
|
+
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
|
80
|
+
|
81
|
+
<ul class="layui-nav layui-nav-tree" lay-filter="test" style="background-color:rgb(146, 151, 209) ">
|
82
|
+
<!-- Swipe -->
|
83
|
+
<li class="layui-nav-item"><a href="/switch" style="color:rgb(0, 0, 0)">实时签到信息</a></li>
|
84
|
+
<!-- 实时签到信息只统计当天的 -->
|
85
|
+
<li class="layui-nav-item "><a href="hisinfo" style="color:rgb(0, 0, 0)">历史签到信息</a></li>
|
86
|
+
|
87
|
+
<li class="layui-nav-item "><a href="modstu" style="color:rgb(0, 0, 0)">用户管理</a></li>
|
88
|
+
<li class="layui-nav-item layui-this" ><a href="modroom" style = "color: black;">房间管理</a></li>
|
89
|
+
</ul>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div class="layui-body" style="height: 100%">
|
94
|
+
<!-- 刷卡机管理 -->
|
95
|
+
<form class="layui-form" action="" id="roomsearch_form" name="roomsearch_form">
|
96
|
+
<label class="layui-form-label" style="margin-top: 25px;">房间号查找</label>
|
97
|
+
<div class="layui-input-inline" style="width: 300px; margin-top: 25px;">
|
98
|
+
<input type="text" class="layui-input" id="roominput" name="roominput">
|
99
|
+
</div>
|
100
|
+
<div class="layui-inline">
|
101
|
+
<button class="layui-btn" lay-submit lay-filter="roomsearch" style="background-color:rgb(100, 109, 214);margin-top: 25px;">
|
102
|
+
<i class="layui-icon layui-icon-search"
|
103
|
+
style="font-size: 15px; color: #ffffff;"></i>
|
104
|
+
搜索
|
105
|
+
</button>
|
106
|
+
<button class="layui-btn" lay-submit lay-filter="allroomsearch" style="background-color:rgb(100, 109, 214);margin-top: 25px;">
|
107
|
+
显示全部
|
108
|
+
</button>
|
109
|
+
</div>
|
110
|
+
<table class="layui-table" id="rooms" lay-filter="demot3">
|
111
|
+
</table>
|
112
|
+
</form>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="layui-footer">
|
116
|
+
学习是一种信仰。
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
<div id='barDemo' style='display:none'>
|
122
|
+
<a class="layui-btn layui-btn-xs" id="mod_btn" lay-event="fix" style="background-color:rgb(100, 109, 214);">修改</a>
|
123
|
+
<a class="layui-btn layui-btn-danger layui-btn-xs" id="delete_btn" name="delete_btn" lay-event="del"
|
124
|
+
style="display:inline-block">删除</a>
|
125
|
+
</div>
|
126
|
+
<div id='barDemo1' style='display:none'>
|
127
|
+
<a class="layui-btn layui-btn-xs" lay-event="passwordchange">编辑</a>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<script src="/layui.js"></script>
|
131
|
+
<script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
|
132
|
+
|
133
|
+
<script>
|
134
|
+
//JS
|
135
|
+
|
136
|
+
layui.use(['element', 'layer', 'util', 'table', 'laydate', 'form'], function () {
|
137
|
+
var element = layui.element;
|
138
|
+
var layer = layui.layer;
|
139
|
+
var util = layui.util;
|
140
|
+
var table = layui.table;
|
141
|
+
var laydate = layui.laydate;
|
142
|
+
var $ = layui.$;
|
143
|
+
var form = layui.form;
|
144
|
+
|
145
|
+
$(function () {
|
146
|
+
$('#idinput').val(sessionStorage.getItem("stuidsearch"));
|
147
|
+
if ((sessionStorage.getItem("username") == null) || (sessionStorage.getItem("username") == "")) {
|
148
|
+
$("#delete_btn").hide();
|
149
|
+
$("#mod_btn").hide();
|
150
|
+
sessionStorage.setItem("editaccess", false);
|
151
|
+
}
|
152
|
+
else {
|
153
|
+
$("#delete_btn").show();
|
154
|
+
$("#mod_btn").show();
|
155
|
+
sessionStorage.setItem("editaccess", true);
|
156
|
+
}
|
157
|
+
});
|
158
|
+
|
159
|
+
table.render({
|
160
|
+
elem: '#rooms',
|
161
|
+
//height: 300,
|
162
|
+
url: '/api/roomslist',
|
163
|
+
id: 'def3',
|
164
|
+
toolbar: true,
|
165
|
+
title: '刷卡机房间信息',
|
166
|
+
totalRow: true,
|
167
|
+
page: true,
|
168
|
+
limit: 10,
|
169
|
+
limits: [5, 10, 20, 30],
|
170
|
+
initSort: {
|
171
|
+
field: 'num'
|
172
|
+
},
|
173
|
+
parseData: function (res) { //res 即为原始返回的数据
|
174
|
+
var current_pages;
|
175
|
+
if (this.page === true) current_pages = 1;
|
176
|
+
else current_pages = this.page.curr;
|
177
|
+
var data = res.data.slice(this.limit * (current_pages - 1), this.limit * current_pages);
|
178
|
+
return {
|
179
|
+
"code": res.code,
|
180
|
+
"msg": res.msg,
|
181
|
+
"count": res.data.length,
|
182
|
+
"data": data
|
183
|
+
}
|
184
|
+
},
|
185
|
+
sort: true,
|
186
|
+
cols: [
|
187
|
+
[{
|
188
|
+
field: 'num',
|
189
|
+
title: '房间号',
|
190
|
+
width: 130,
|
191
|
+
sort: true
|
192
|
+
},
|
193
|
+
{
|
194
|
+
field: 'mac',
|
195
|
+
title: '刷卡机',
|
196
|
+
width: 500,
|
197
|
+
edit: sessionStorage.getItem("editaccess")
|
198
|
+
},
|
199
|
+
{
|
200
|
+
toolbar: '#barDemo',
|
201
|
+
fixed: 'right'
|
202
|
+
}]
|
203
|
+
]
|
204
|
+
});
|
205
|
+
|
206
|
+
table.on('edit(demot3)', function (obj) {
|
207
|
+
console.log(obj.data);
|
208
|
+
$.ajax({
|
209
|
+
url: '/db/update_rooms',
|
210
|
+
method: 'post',
|
211
|
+
data: obj.data,
|
212
|
+
success: function (data) {
|
213
|
+
if (data.status == 'ok') {
|
214
|
+
layer.msg('更新成功!');
|
215
|
+
setTimeout(function () {
|
216
|
+
top.location.reload();
|
217
|
+
}, 1500);
|
218
|
+
} else if (data.status == 'error') {
|
219
|
+
layer.msg('更新失败! 原因是:' + data.err);
|
220
|
+
setTimeout(function () {
|
221
|
+
top.location.reload();
|
222
|
+
}, 1500);
|
223
|
+
}
|
224
|
+
}
|
225
|
+
});
|
226
|
+
return false;
|
227
|
+
});
|
228
|
+
|
229
|
+
table.on('tool(demot3)', function (obj) {
|
230
|
+
var data = obj.data; //当前行的数据
|
231
|
+
var layEvent = obj.event; //当前行的具体的哪个event
|
232
|
+
|
233
|
+
if (layEvent === 'fix') {
|
234
|
+
layer.msg("请在对应表格中直接修改即可!");
|
235
|
+
}
|
236
|
+
else if (layEvent === 'del') {
|
237
|
+
layer.confirm('真的要删除吗?', function (index) {
|
238
|
+
obj.del();
|
239
|
+
layer.close(index);
|
240
|
+
$.ajax({
|
241
|
+
url: '/db/delete_rooms',
|
242
|
+
method: 'post',
|
243
|
+
data: {
|
244
|
+
id: data.id,
|
245
|
+
stuid: data.stuid
|
246
|
+
},
|
247
|
+
success: function (data) {
|
248
|
+
table.reload('def3');
|
249
|
+
layer.msg('删除成功!');
|
250
|
+
}
|
251
|
+
});
|
252
|
+
})
|
253
|
+
}
|
254
|
+
});
|
255
|
+
|
256
|
+
form.verify({
|
257
|
+
roomnum: function (value, item) { //value:表单的值、item:表单的DOM对象
|
258
|
+
var checkResult = "";
|
259
|
+
$.ajax({
|
260
|
+
url: "/api/inputcheck2",
|
261
|
+
type: "POST",
|
262
|
+
data: {
|
263
|
+
idinput: value
|
264
|
+
},
|
265
|
+
async: false,
|
266
|
+
success: function (result) {
|
267
|
+
if (result.sign == 0) {
|
268
|
+
checkResult = "该房间已存在";
|
269
|
+
}
|
270
|
+
}
|
271
|
+
});
|
272
|
+
if (checkResult != '')
|
273
|
+
return checkResult;
|
274
|
+
}
|
275
|
+
, mac: function (value, item) { //value:表单的值、item:表单的DOM对象
|
276
|
+
var checkResult = "";
|
277
|
+
$.ajax({
|
278
|
+
url: "/api/inputcheck3",
|
279
|
+
type: "POST",
|
280
|
+
data: {
|
281
|
+
idinput: value
|
282
|
+
},
|
283
|
+
async: false,
|
284
|
+
success: function (result) {
|
285
|
+
if ((result.sign == 0) && (value != "")) {
|
286
|
+
checkResult = "该机器已存在于其他房间中";
|
287
|
+
}
|
288
|
+
}
|
289
|
+
});
|
290
|
+
if (checkResult != '')
|
291
|
+
return checkResult;
|
292
|
+
}
|
293
|
+
});
|
294
|
+
|
295
|
+
form.on('submit(formDemo2)', function (data) {
|
296
|
+
$.ajax({
|
297
|
+
type: 'post',
|
298
|
+
url: '/db/insert_room',
|
299
|
+
data: data.field,
|
300
|
+
success: function (data) {
|
301
|
+
if (data.status == 'ok') {
|
302
|
+
layer.msg('添加成功!');
|
303
|
+
} else if (data.status == 'error') {
|
304
|
+
layer.msg('添加失败! 原因是:' + data.err);
|
305
|
+
}
|
306
|
+
}
|
307
|
+
});
|
308
|
+
return false;
|
309
|
+
});
|
310
|
+
|
311
|
+
|
312
|
+
//头部事件
|
313
|
+
util.event('lay-header-event', {
|
314
|
+
menuLeft: function (othis) { // 左侧菜单事件
|
315
|
+
layer.msg('展开左侧菜单的操作', { icon: 0 });
|
316
|
+
},
|
317
|
+
menuRight: function () { // 右侧菜单事件
|
318
|
+
layer.open({
|
319
|
+
type: 1,
|
320
|
+
title: '作者',
|
321
|
+
content: '<div style="padding: 15px;">信息工程学院<br/>祝乙文,姜莱</div>',
|
322
|
+
area: ['150px', '100%'],
|
323
|
+
offset: 'rt', // 右上角
|
324
|
+
anim: 'slideLeft', // 从右侧抽屉滑出
|
325
|
+
shadeClose: true,
|
326
|
+
scrollbar: false
|
327
|
+
});
|
328
|
+
}
|
329
|
+
});
|
330
|
+
|
331
|
+
form.on('submit(roomsearch)', function (data) {
|
332
|
+
$.ajax({
|
333
|
+
type: 'post',
|
334
|
+
url: '/api/roomsearch',
|
335
|
+
data: {
|
336
|
+
sign: 1,
|
337
|
+
id: data.field.roominput
|
338
|
+
},
|
339
|
+
success: function (data) {
|
340
|
+
top.location.href = '';
|
341
|
+
top.location.reload();
|
342
|
+
}
|
343
|
+
});
|
344
|
+
return false;
|
345
|
+
});
|
346
|
+
|
347
|
+
form.on('submit(allroomsearch)', function (data) {
|
348
|
+
$.ajax({
|
349
|
+
type: 'post',
|
350
|
+
url: '/api/roomsearch',
|
351
|
+
data: {
|
352
|
+
sign: 0
|
353
|
+
},
|
354
|
+
success: function (data) {
|
355
|
+
top.location.href = '';
|
356
|
+
top.location.reload();
|
357
|
+
}
|
358
|
+
});
|
359
|
+
return false;
|
360
|
+
});
|
361
|
+
|
362
|
+
form.verify({
|
363
|
+
roomnum: function (value, item) { //value:表单的值、item:表单的DOM对象
|
364
|
+
var checkResult = "";
|
365
|
+
$.ajax({
|
366
|
+
url: "/api/inputcheck2",
|
367
|
+
type: "POST",
|
368
|
+
data: {
|
369
|
+
idinput: value
|
370
|
+
},
|
371
|
+
async: false,
|
372
|
+
success: function (result) {
|
373
|
+
if (result.sign == 0) {
|
374
|
+
checkResult = "该房间已存在";
|
375
|
+
}
|
376
|
+
}
|
377
|
+
});
|
378
|
+
if (checkResult != '')
|
379
|
+
return checkResult;
|
380
|
+
}
|
381
|
+
, mac: function (value, item) { //value:表单的值、item:表单的DOM对象
|
382
|
+
var checkResult = "";
|
383
|
+
$.ajax({
|
384
|
+
url: "/api/inputcheck3",
|
385
|
+
type: "POST",
|
386
|
+
data: {
|
387
|
+
idinput: value
|
388
|
+
},
|
389
|
+
async: false,
|
390
|
+
success: function (result) {
|
391
|
+
if ((result.sign == 0) && (value != "")) {
|
392
|
+
checkResult = "该机器已存在于其他房间中";
|
393
|
+
}
|
394
|
+
}
|
395
|
+
});
|
396
|
+
if (checkResult != '')
|
397
|
+
return checkResult;
|
398
|
+
}
|
399
|
+
});
|
400
|
+
});
|
401
|
+
</script>
|
402
|
+
|
403
|
+
</body>
|
404
|
+
|
405
|
+
</html>
|