myapp_sjy 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/Dockerfile +7 -0
  2. package/app.js +58 -0
  3. package/bin/www +92 -0
  4. package/package.json +100 -0
  5. package/pkg.zip +0 -0
  6. package/public/css/layui.css +1 -0
  7. package/public/css/modules/code.css +1 -0
  8. package/public/css/modules/laydate/default/laydate.css +1 -0
  9. package/public/css/modules/layer/default/icon-ext.png +0 -0
  10. package/public/css/modules/layer/default/icon.png +0 -0
  11. package/public/css/modules/layer/default/layer.css +1 -0
  12. package/public/css/modules/layer/default/loading-0.gif +0 -0
  13. package/public/css/modules/layer/default/loading-1.gif +0 -0
  14. package/public/css/modules/layer/default/loading-2.gif +0 -0
  15. package/public/font/iconfont.eot +0 -0
  16. package/public/font/iconfont.svg +554 -0
  17. package/public/font/iconfont.ttf +0 -0
  18. package/public/font/iconfont.woff +0 -0
  19. package/public/font/iconfont.woff2 +0 -0
  20. package/public/layui.js +5 -0
  21. package/public/stylesheets/style.css +8 -0
  22. package/routes/api.js +642 -0
  23. package/routes/datatime.js +16 -0
  24. package/routes/db.js +145 -0
  25. package/routes/index.js +28 -0
  26. package/routes/nppBackup/sql.js.2024-07-08_082213.bak +25 -0
  27. package/routes/nppBackup/sql.js.2024-07-08_082214.bak +25 -0
  28. package/routes/sql.js +25 -0
  29. package/routes/switch.js +33 -0
  30. package/routes/switch1.js +12 -0
  31. package/views/addroom.ejs +223 -0
  32. package/views/addstu.ejs +318 -0
  33. package/views/error.ejs +3 -0
  34. package/views/hisinfo.ejs +442 -0
  35. package/views/hisinfo1.ejs +291 -0
  36. package/views/login.ejs +227 -0
  37. package/views/modroom.ejs +365 -0
  38. package/views/modstu.ejs +375 -0
  39. package/views/rtinfo.ejs +342 -0
  40. package/views/rtinfo1.ejs +268 -0
@@ -0,0 +1,318 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
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
+ <style>
12
+ .layui-header {
13
+ height: 60px;
14
+ background-color: #10081a !important; /* 深蓝色 */
15
+ }
16
+ .layui-layout-left {
17
+ margin-left: 0 !important;
18
+ }
19
+
20
+ .layui-layout-right {
21
+ margin-right: 0 !important;
22
+ }
23
+
24
+ body {
25
+ font-size: 16px;
26
+ /*字体大小*/
27
+ color: #010704;
28
+ /*字体颜色*/
29
+ }
30
+
31
+ .footer-bg {
32
+ background-image: url('https://p2.ssl.qhimgs1.com/t017677196113fc982c.jpg');
33
+ background-size: cover;
34
+ background-position: center;
35
+ height: 200px;
36
+ }
37
+
38
+ .layui-table {
39
+ width: 100%;
40
+ /* 表格占满整个页面 */
41
+ }
42
+ .layui-side {
43
+ background-color: #9ca58d !important;
44
+ }
45
+ </style>
46
+ </head>
47
+
48
+ <body style="background-image: url('https://p2.ssl.qhimgs1.com/t017677196113fc982c.jpg'); background-size: cover; background-repeat: no-repeat; background-position: center; background-attachment: fixed;">
49
+ <div class="layui-layout layui-layout-admin">
50
+ <div class="header-bg">
51
+ <!-- 顶部导航栏 -->
52
+ <div class="layui-header">
53
+ <div class="layui-logo layui-hide-xs layui-bg-black">签到管理系统</div>
54
+
55
+ <!-- 导航菜单 -->
56
+ <ul class="layui-nav layui-layout-left">
57
+ <li class="layui-nav-item">
58
+ <a href="javascript:;"><i class="layui-icon layui-icon-user"></i> 学生信息管理</a>
59
+ <dl class="layui-nav-child">
60
+ <dd><a href="modstu"><i class="layui-icon layui-icon-edit"></i> 查询与更新</a></dd>
61
+ <dd><a href="addstu"><i class="layui-icon layui-icon-add-1"></i> 新增学生信息</a></dd>
62
+ </dl>
63
+ </li>
64
+ <li class="layui-nav-item">
65
+ <a href="javascript:;"><i class="layui-icon layui-icon-set"></i> 设备标识管理</a>
66
+ <dl class="layui-nav-child">
67
+ <dd><a href="modroom"><i class="layui-icon layui-icon-edit"></i> 查询与更新</a></dd>
68
+ <dd><a href="addroom"><i class="layui-icon layui-icon-add-1"></i> 新增设备信息</a></dd>
69
+ </dl>
70
+ </li>
71
+ </ul>
72
+
73
+ <!-- 右侧用户菜单 -->
74
+ <ul class="layui-nav layui-layout-right">
75
+ <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
76
+ <a href="javascript:;">
77
+ <img src="https://pic.rmb.bdstatic.com/359341f4f00ad8453f6eb04b433c35ad.jpeg" class="layui-nav-img">
78
+ <!-- tester -->
79
+ </a>
80
+ <dl class="layui-nav-child">
81
+ <!-- <dd><a href="javascript:;">修改登录密码</a></dd>
82
+ <dd><a href="javascript:;">修改绑定手机</a></dd> -->
83
+ <dd><a href="/">登出</a></dd>
84
+ </dl>
85
+ </li>
86
+ <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
87
+ <a href="javascript:;">
88
+ <i class="layui-icon layui-icon-more-vertical"></i>
89
+ </a>
90
+ </li>
91
+ </ul>
92
+ </div>
93
+ </div>
94
+
95
+ <!-- 左侧导航栏 -->
96
+ <div class="layui-side layui-bg-black">
97
+ <ul class="layui-nav layui-nav-tree" lay-filter="test">
98
+ <li class="layui-nav-item">
99
+ <a href="/switch"><i class="layui-icon layui-icon-ok"></i> 实时签到信息</a>
100
+ </li>
101
+ <li class="layui-nav-item">
102
+ <a href="hisinfo"><i class="layui-icon layui-icon-chart"></i> 历史签到信息</a>
103
+ </li>
104
+ </ul>
105
+ </div>
106
+
107
+ <div class="layui-body" style="height: 100%; display: flex; justify-content: center; align-items: center;">
108
+ <div class="layui-row" id="insert_stu">
109
+ <div class="layui-col-md11">
110
+ <form class="layui-form" id="insertstu" name="insertstu" action="">
111
+ <div class="layui-form-item layui-row" style="margin-top: 40px;">
112
+ <label class="layui-form-label">学号:</label>
113
+ <div class="layui-input-inline">
114
+ <input type="text" id="insertstuid" name="insertstuid" class="layui-input"
115
+ lay-verify="required|number|stuid" autocomplete="off" style="width: 350px">
116
+ </div>
117
+ </div>
118
+ <div class="layui-form-item layui-row">
119
+ <label class="layui-form-label">姓名:</label>
120
+ <div class="layui-input-inline">
121
+ <input type="text" id="insertname" name="insertname" class="layui-input" autocomplete="off" style="width: 350px">
122
+ </div>
123
+ </div>
124
+ <div class="layui-form-item layui-row">
125
+ <label class="layui-form-label">卡号:</label>
126
+ <div class="layui-input-inline">
127
+ <input type="text" id="insertcardid" name="insertcardid" class="layui-input"
128
+ lay-verify="number|cardid" autocomplete="off" style="width: 350px">
129
+ </div>
130
+ </div>
131
+ <div class="layui-form-item layui-row">
132
+ <label class="layui-form-label">类型:</label>
133
+ <div class="layui-input-block" style="width: 350px">
134
+ <select name="inserttype" lay-verify="required">
135
+ <option value=201>本科生</option>
136
+ <option value=204>教职工</option>
137
+ </select>
138
+ </div>
139
+ </div>
140
+ <div class="layui-form-item layui-row">
141
+ <div class="layui-input-block">
142
+ <button class="layui-btn" lay-submit lay-filter="formDemo1">提交</button>
143
+ <button type="reset" class="layui-btn layui-btn-primary">重置</button>
144
+ </div>
145
+ </div>
146
+ </form>
147
+ </div>
148
+ </div>
149
+ </div>
150
+
151
+ <div class="layui-footer">
152
+ 不积跬步,无以至千里。
153
+ </div>
154
+ </div>
155
+
156
+ <script src="/layui.js"></script>
157
+ <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
158
+ </body>
159
+
160
+ <script>
161
+ //JS
162
+ layui.use(['element', 'layer', 'util', 'table', 'laydate', 'form'], function () {
163
+ var element = layui.element;
164
+ var layer = layui.layer;
165
+ var util = layui.util;
166
+ var table = layui.table;
167
+ var laydate = layui.laydate;
168
+ var $ = layui.$;
169
+ var form = layui.form;
170
+
171
+ $(function () {
172
+ $('#idinput').val(sessionStorage.getItem("stuidsearch"));
173
+ });
174
+
175
+ table.render({
176
+ elem: '#numbers',
177
+ url: '/api/list',
178
+ id: 'def',
179
+ toolbar: true,
180
+ title: '个人信息',
181
+ totalRow: true,
182
+ page: true,
183
+ limit: 10,
184
+ limits: [5, 10, 20, 30],
185
+ parseData: function (res) {
186
+ console.log(res);
187
+ var current_pages;
188
+ if (this.page === true) current_pages = 1;
189
+ else current_pages = this.page.curr;
190
+ var data = res.data.slice(this.limit * (current_pages - 1), this.limit * current_pages);
191
+ return {
192
+ "code": res.code,
193
+ "msg": res.msg,
194
+ "count": res.data.length,
195
+ "data": data
196
+ }
197
+ },
198
+ cols: [
199
+ [{
200
+ field: 'stuid',
201
+ title: '学号',
202
+ width: 200,
203
+ sort: true
204
+ }, {
205
+ field: 'name',
206
+ title: '姓名',
207
+ width: 200,
208
+ edit: true
209
+ }, {
210
+ field: 'cardid',
211
+ title: '卡号',
212
+ width: 350,
213
+ edit: true,
214
+ sort: true
215
+ }, {
216
+ field: 'type',
217
+ title: '类型',
218
+ width: 200,
219
+ sort: true
220
+ }, {
221
+ title: '操作',
222
+ toolbar: '#barDemo',
223
+ fixed: 'right'
224
+ }]
225
+ ]
226
+ });
227
+
228
+ form.verify({
229
+ stuid: function (value, item) { //value:表单的值、item:表单的DOM对象
230
+ var checkResult = "";
231
+ $.ajax({
232
+ url: "/api/inputcheck0",
233
+ type: "POST",
234
+ data: {
235
+ n: 0,
236
+ idinput: value
237
+ },
238
+ async: false,
239
+ success: function (result) {
240
+ if ((result.sign == 0) && (value != "")) {
241
+ checkResult = "该学号已存在";
242
+ }
243
+ },
244
+ error: function () {
245
+ }
246
+ });
247
+ if (checkResult != '')
248
+ return checkResult;
249
+ }
250
+ , cardid: function (value, item) { //value:表单的值、item:表单的DOM对象
251
+ var checkResult = "";
252
+ $.ajax({
253
+ url: "/api/inputcheck1",
254
+ type: "POST",
255
+ data: {
256
+ n: 1,
257
+ idinput: value
258
+ },
259
+ async: false,
260
+ success: function (result) {
261
+ if (result.sign == 0) {
262
+ checkResult = "该卡号已存在";
263
+ }
264
+ }
265
+ });
266
+ if (checkResult != '')
267
+ return checkResult;
268
+ }
269
+ });
270
+
271
+
272
+
273
+ //头部事件
274
+ util.event('lay-header-event', {
275
+ menuLeft: function (othis) { // 左侧菜单事件
276
+ layer.msg('展开左侧菜单的操作', { icon: 0 });
277
+ },
278
+ menuRight: function () { // 右侧菜单事件
279
+ layer.open({
280
+ type: 1,
281
+ title: '作者',
282
+ content: '<div style="padding: 15px;">信息工程学院<br/>王璐、孙佳雨</div>',
283
+ area: ['150px', '100%'],
284
+ offset: 'rt', // 右上角
285
+ anim: 'slideLeft', // 从右侧抽屉滑出
286
+ shadeClose: true,
287
+ scrollbar: false
288
+ });
289
+ }
290
+ });
291
+
292
+ form.on('submit(formDemo1)', function (data) {
293
+ if (data.field.inserttype === '201') {
294
+ data.field.inserttype = '本科生';
295
+ }
296
+ else if (data.field.inserttype === '204') {
297
+ data.field.inserttype = '教职工';
298
+ }
299
+ $.ajax({
300
+ type: 'post',
301
+ url: '/db/insert_user',
302
+ data: data.field,
303
+ success: function (data) {
304
+ if (data.status == 'ok') {
305
+ layer.msg('添加成功!');
306
+ } else if (data.status == 'error') {
307
+ layer.msg('添加失败! 原因是:' + data.err);
308
+ }
309
+ }
310
+ });
311
+ return false;
312
+ });
313
+ });
314
+ </script>
315
+
316
+ </body>
317
+
318
+ </html>
@@ -0,0 +1,3 @@
1
+ <h1><%= message %></h1>
2
+ <h2><%= error.status %></h2>
3
+ <pre><%= error.stack %></pre>