-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstudentImport.html
552 lines (523 loc) · 26.5 KB
/
studentImport.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<link rel="Bookmark" href="favicon.ico">
<link rel="Shortcut Icon" href="favicon.ico"/>
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
<link rel="stylesheet" href="static/h-ui.admin/js/webuploader/webuploader.css">
<link rel="stylesheet" href="lib/jqueryui/jquery-ui.css">
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js"></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->
<style>
#picker {
display: inline-block;
line-height: 1.428571429;
vertical-align: middle;
margin: 0 12px 0 0;
width: 156px;
}
#picker .webuploader-pick {
padding: 6px 12px;
display: block;
background-color: red;
}
.table>tbody>tr>td{
text-align:center;
}
</style>
<title>学生信息导入</title>
</head>
<body>
<!--_header 作为公共模版分离出去-->
<div id="header"></div>
<!--/_header 作为公共模版分离出去-->
<!--_menu 作为公共模版分离出去-->
<div id="menu"></div>
<!--/_menu 作为公共模版分离出去-->
<section class="Hui-article-box">
<nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页
<span class="c-gray en">></span>
数据管理
<span class="c-gray en">></span>
学生信息导入
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
</nav>
<div class="Hui-article">
<article class="cl pd-20">
<div class="text-c">
<!-- <select name="" class="select" style="width:70px;height: 30px;">-->
<!-- <option value="0">学号</option>-->
<!-- <option value="1">姓名</option>-->
<!-- <option value="2">班级</option>-->
<!-- <option value="3">身份证</option>-->
<!-- <option value="4">政治面貌</option>-->
<!-- </select>-->
<!-- <input type="text" name="txtCondition" id="txtCondition" placeholder=" 请输入条件" style="width:120px"-->
<!-- class="input-text">-->
<!-- 日期范围:-->
<!-- <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}'})" id="logmin"-->
<!-- class="input-text Wdate" style="width:120px;">-->
<!-- - -->
<!-- <input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d'})"-->
<!-- id="logmax" class="input-text Wdate" style="width:120px;">-->
<!-- <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 开搜-->
<!-- </button>-->
<!-- <ul id="Huifold1" class="Huifold">-->
<!-- <li class="item">-->
<!-- <h4>多条件查询<b>+</b></h4>-->
<!-- <div class="info" style="height: 140px;">-->
<!-- <div class="row cl">-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="studentNum">-->
<!-- <label for="studentNum">学号:</label>-->
<!-- <input class="input-text" name="studentNum" type="text"-->
<!-- style="width:120px;height: 25px;">-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="studentName">-->
<!-- <label for="studentName">姓名:</label>-->
<!-- <input class="input-text" name="studentName" type="text"-->
<!-- style="width:120px;height: 25px;">-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="gender">-->
<!-- <label for="gender">性别:</label>-->
<!-- <select name="gender" style="width:140px;height: 25px;">-->
<!-- <option value="男" selected>男</option>-->
<!-- <option value="女">女</option>-->
<!-- </select>-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="college">-->
<!-- <label for="college">系部:</label>-->
<!-- <input class="input-text" name="college" type="text"-->
<!-- style="width:120px;height: 25px;">-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="class">-->
<!-- <label for="class">班级:</label>-->
<!-- <input class="input-text" name="class" type="text"-->
<!-- style="width:120px;height: 25px;">-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="nation">-->
<!-- <label for="nation">民族:</label>-->
<!-- <input class="input-text" name="nation" type="text"-->
<!-- style="width:120px;height: 25px;">-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="politicCountenance">-->
<!-- <label for="politicCountenance">政治面貌:</label>-->
<!-- <select name="politicCountenance">-->
<!-- <option value="群众" selected>群众</option>-->
<!-- <option value="共青团员">共青团员</option>-->
<!-- <option value="中国预备党员">中国预备党员</option>-->
<!-- <option value="中共党员">中共党员</option>-->
<!-- <option value="民革会员">民革会员</option>-->
<!-- <option value="民盟盟员">民盟盟员</option>-->
<!-- <option value="民建会员">民建会员</option>-->
<!-- <option value="民进会员">民进会员</option>-->
<!-- <option value="农工党党员">农工党党员</option>-->
<!-- <option value="致公党党员">致公党党员</option>-->
<!-- <option value="九三学社社员">九三学社社员</option>-->
<!-- <option value="台盟盟员">台盟盟员</option>-->
<!-- <option value="无党派民主人士">无党派民主人士</option>-->
<!-- </select>-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="residentType">-->
<!-- <label for="residentType">户口性质:</label>-->
<!-- <select name="residentType" style="width:150px;">-->
<!-- <option value="农村" selected>农村</option>-->
<!-- <option value="城镇">城镇</option>-->
<!-- </select>-->
<!-- </div>-->
<!-- <div class="check-box" style="float:left;margin-top: 10px;">-->
<!-- <input type="checkbox" id="isLoan">-->
<!-- <label for="isLoan">是否贷款:</label>-->
<!-- <select name="isLoan">-->
<!-- <option value="是" selected>是</option>-->
<!-- <option value="否">否</option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row cl" style="margin-top: 15px;">-->
<!-- <div class="col-xs-12 col-sm-12">-->
<!-- <input class="btn btn-primary radius" style="width:80%;margin:0 auto;" type="button" value="开始搜索">-->
<!-- </div>-->
<!-- </div>-->
<!-- </li>-->
<!-- </ul>-->
<div class="cl pd-5 bg-1 bk-gray mt-20">
<span class="l">
<!-- <a href="javascript:;" onclick="importExcel()" class="btn btn-danger radius"><i class="Hui-iconfont"></i> Excel导入</a>-->
<div id="picker"><i class="Hui-iconfont"></i> 选择文件</div>
<!-- <a class="btn btn-primary radius" data-title="添加单个学生信息" _href="article-add.html"-->
<!-- onclick="article_add('添加资讯','article-add.html')" href="javascript:;"><i-->
<!-- class="Hui-iconfont"></i> 添加单个学生信息</a>-->
</span>
<span class="r">共有数据:<strong>54</strong> 条</span>
</div>
<div class="mt-20">
<table id="tb" class="table table-border table-bordered table-bg table-hover table-sort">
<thead>
<tr class="text-c">
<!-- <th width="25"><input type="checkbox" name="" value=""></th>-->
<!-- <th width="80">序号</th>-->
<th width="5">序号</th>
<th width="80">学号</th>
<th width="30">姓名</th>
<th width="50">系部</th>
<th width="40">班级</th>
<th width="40">籍贯</th>
<th width="40">民族</th>
<th width="80">政治面貌</th>
<th width="80">本人电话</th>
<th width="80">身份证</th>
<th width="80">家庭住址</th>
<th width="80">考生号</th>
<th width="80">父亲姓名</th>
<th width="80">母亲姓名</th>
<th width="80">父亲电话</th>
<th width="80">母亲电话</th>
<th width="80">衣服尺码</th>
<th width="80">鞋码</th>
<th width="80">职高\普高</th>
<th width="80">寝室号</th>
<th width="80">专业</th>
<th width="80">生日</th>
<th width="80">家庭电话</th>
<th width="80">入学年级</th>
<th width="80">入学方式</th>
<th width="80">邮箱</th>
<th width="80">学籍类别</th>
<th width="80">学籍状态</th>
<th width="80">证件类型</th>
<th width="80">户口性质</th>
<th width="80">开户银行</th>
<th width="80">银行卡号</th>
<th width="80">是否贷款</th>
<th width="120">id号</th>
</tr>
</thead>
</table>
</div>
</div>
</article>
</div>
</section>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.page.js"></script>
<!--/_footer /作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script src="static/h-ui.admin/js/webuploader/webuploader.js"></script>
<script type="text/javascript" src="lib/FunctionJS.js"></script>
<script type="text/javascript" src="lib/jqueryui/jquery-ui.js"></script>
<script type="text/javascript" src="lib/Config.js"></script>
<script type="text/javascript" src="lib/saveToken.js"></script>
<script type="text/javascript">
$(function() {
// 检查权限
// checkPermission();
$("#header").load("_header.html");
$("#menu").load("_menu.html");
// 侧边导航
setTimeout(function () {
var info = getUrlParam('info');
$(".Hui-aside").Huifold({
titCell: '.menu_dropdown dl dt',
mainCell: '.menu_dropdown dl dd',
});
$("#menu-import dt").addClass('selected');
$("#menu-import dd").css('display', 'block');
if (info == "1") {
$("#menu-import ul li:eq(0)").addClass('current');
} else {
$("#menu-import ul li:eq(1)").addClass('current');
}
}, 500);
jQuery.Huifold22 = function (obj, obj_c, speed, obj_type, Event) {
if (obj_type == 2) {
$(obj + ":first").find("b").html("-");
$(obj_c + ":first").show()
}
$(obj).bind(Event, function () {
if ($(this).next().is(":visible")) {
if (obj_type == 2) {
return false
} else {
$(this).next().slideUp(speed).end().removeClass("selected");
$(this).find("b").html("+")
}
} else {
if (obj_type == 3) {
$(this).next().slideDown(speed).end().addClass("selected");
$(this).find("b").html("-")
} else {
$(obj_c).slideUp(speed);
$(obj).removeClass("selected");
$(obj).find("b").html("+");
$(this).next().slideDown(speed).end().addClass("selected");
$(this).find("b").html("-")
}
}
})
};
var BASE_URL = "static/h-ui.admin/js/webuploader/";
var uploader = WebUploader.create({
// swf文件路径
swf: BASE_URL + 'Uploader.swf',
auto: true,
// 文件接收服务端。
server: serverUrl+'/jkxsys/student-info/insert',
timeout: 0,
headers: {
token: localStorage.getItem("token")
},
// 选择文件的按钮。可选。
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
pick: '#picker',
accept: {
extensions: 'xls,xlsx', // 允许的文件后缀,不带点,多个用逗号分割,这里支持老版的Excel和新版的
mimeTypes: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
},
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
resize: false,
fileVal:'multipartFile', // [默认值:'file'] 设置文件上传域的name。
});
// 上传成功
uploader.on( 'uploadSuccess', function( file ) {
window.location.reload()
});
// 文件上传失败,显示上传出错。
uploader.on( 'uploadError', function( file ) {
alert("上传失败")
});
var setHeader = function (object, data, headers) {
headers['Access-Control-Allow-Origin'] = '*';
headers['Access-Control-Request-Headers'] = 'content-type';
headers['Access-Control-Request-Method'] = 'POST';
};
uploader.on('uploadBeforeSend ', setHeader);
uploader.on('uploadSuccess', function (file, response) {
var r = response._raw;
r = JSON.parse(r);
console.log(r);
layer.open({
type: 2,
title: '导入操作',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['893px', '600px'],
content: '//fly.layui.com/'
});
})
uploader.on('uploadError', function (file, reason) {
if (reason == "server") {
$("body").Huimodalalert({
content: 'Excel内容有问题,请刷新后重新调整,再上传',
speed: 2000
});
} else {
$("body").Huimodalalert({
content: '上传失败',
speed: 2000
});
}
});
$.Huifold22("#Huifold1 .item h4", "#Huifold1 .item .info", "fast", 1, "click"); /*5个参数顺序不可打乱,分别是:相应区,隐藏显示的内容,速度,类型,事件*/
// 处理为空后的弹窗
$.fn.dataTable.ext.errMode = function(s,h,m){};
$('.table-sort').dataTable({
"aaSorting": [[1, "desc"]],//默认第几个排序
"bStateSave": true,//状态保存
"ordering":false,
//"ajax":"/tp5/student_info/getStudentInfo",
ajax:{
url: serverUrl+"/jkxsys/student-info/list",
type:"get",
timeout: 0,
headers: {
token: localStorage.getItem("token")
},
dataSrc:function(json){
if(json.code == 200){
return json.data;
}else{
location.href="/jkx/jkx/login.html";
}
}
},
columns: [
{"data": null, defaultContent: ''},
{"data": "studentNum", defaultContent: ''},
{"data": "studentName", defaultContent: ''},
{"data": "college", defaultContent: ''},
{"data": "stuClass", defaultContent: ''},
{"data": "nativePlace", defaultContent: ''},
{"data": "nation", defaultContent: ''},
{"data": "politicCountenance", defaultContent: ''},
{"data": "selfTel", defaultContent: ''},
{"data": "identityID", defaultContent: ''},
{"data": "address", defaultContent: ''},
{"data": "examNum", defaultContent: 0},
{"data": "fatherName", defaultContent: ''},
{"data": "motherName", defaultContent: ''},
{"data": "fatherTel", defaultContent: 0},
{"data": "motherTel", defaultContent: 0},
{"data": "clothesSize", defaultContent: ''},
{"data": "shoeSize", defaultContent: 0},
{"data": "educationType", defaultContent: ''},
{"data": "dormNum", defaultContent: 0},
{"data": "major", defaultContent: ''},
{"data": "birthday", defaultContent: ''},
{"data": "familyTel", defaultContent: ''},
{"data": "inGrade", defaultContent: ''},
{"data": "inType", defaultContent: ''},
{"data": "email", defaultContent: ''},
{"data": "studyCategory", defaultContent: ''},
{"data": "studyStatus", defaultContent: ''},
{"data": "identityType", defaultContent: ''},
{"data": "residentType", defaultContent: ''},
{"data": "bank", defaultContent: ''},
{"data": "bankCardID", defaultContent: ''},
{"data": "isLoan", defaultContent: ''},
{"data": "Id", defaultContent: ''}
],
"pageLength":15,
"fnDrawCallback": function(){
this.api().column(0).nodes().each(function(cell, i) {
cell.innerHTML = i + 1;
});
}
});
var needHiddenColumns=new Array(11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33)
var table = $('.table-sort').DataTable();
for(x in needHiddenColumns){
table.column( needHiddenColumns[x] ).visible( false, false );
}
table.columns.adjust().draw( false );
function showTable() {
var url="/tp5/student_info/getStudentInfo";
var param="";
}
// /*资讯-添加*/
// function article_add(title, url, w, h) {
// var index = layer.open({
// type: 2,
// title: title,
// content: url
// });
// layer.full(index);
// }
//
// /*资讯-编辑*/
// function article_edit(title, url, id, w, h) {
// var index = layer.open({
// type: 2,
// title: title,
// content: url
// });
// layer.full(index);
// }
//
// /*资讯-删除*/
// function article_del(obj, id) {
// layer.confirm('确认要删除吗?', function (index) {
// $.ajax({
// type: 'POST',
// url: '',
// dataType: 'json',
// success: function (data) {
// $(obj).parents("tr").remove();
// layer.msg('已删除!', {icon: 1, time: 1000});
// },
// error: function (data) {
// console.log(data.msg);
// },
// });
// });
// }
//
// /*资讯-审核*/
// function article_shenhe(obj, id) {
// layer.confirm('审核文章?', {
// btn: ['通过', '不通过', '取消'],
// shade: false,
// closeBtn: 0
// },
// function () {
// $(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
// $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
// $(obj).remove();
// layer.msg('已发布', {icon: 6, time: 1000});
// },
// function () {
// $(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_shenqing(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
// $(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
// $(obj).remove();
// layer.msg('未通过', {icon: 5, time: 1000});
// });
// }
//
// /*资讯-下架*/
// function article_stop(obj, id) {
// layer.confirm('确认要下架吗?', function (index) {
// $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_start(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont"></i></a>');
// $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
// $(obj).remove();
// layer.msg('已下架!', {icon: 5, time: 1000});
// });
// }
//
// /*资讯-发布*/
// function article_start(obj, id) {
// layer.confirm('确认要发布吗?', function (index) {
// $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_stop(this,id)" href="javascript:;" title="下架"><i class="Hui-iconfont"></i></a>');
// $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
// $(obj).remove();
// layer.msg('已发布!', {icon: 6, time: 1000});
// });
// }
//
// /*资讯-申请上线*/
// function article_shenqing(obj, id) {
// $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">待审核</span>');
// $(obj).parents("tr").find(".td-manage").html("");
// layer.msg('已提交申请,耐心等待审核!', {icon: 1, time: 2000});
// }
})
</script>
<script type="text/javascript">
// $(function () {
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>