You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>导入学生照片ZIP压缩包</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="../../static/css/font.css">
<link rel="stylesheet" href="../../static/css/weadmin.css">
<link rel="stylesheet" href="../../lib/layui/css/layui.css">
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="weadmin-body">
<div class="layui-form-item template">
<button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
<div style="color: red;font-size:12px;margin-top: 50px;">温馨提示:导入<font class="import_module">学生照片</font>需要zip压缩包格式并且以考生号+.JPG对每个学生照片进行命名,如果已经存在本年度的学生照片,重新导入将清空原有的照片!!!
</div>
</div>
<div class="layui-form-item" style="margin-top: 68px">
<button type="button" class="layui-btn" id="test9">上传</button>
<button class="layui-btn" id="closeDialog">关闭</button>
</div>
</div>
<script src="../../lib/layui/layui.js"></script>
<script src="../../lib/base64.js"></script>
<script>
//获取url传参的办法
window.GetQueryString = function (name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
};
layui.extend({
admin: '{/}../../static/js/admin'
});
layui.use(['jquery', 'admin', 'upload', 'layer'], function () {
var $ = layui.jquery,
admin = layui.admin,
layer = layui.layer,
upload = layui.upload;
//选完文件后不自动上传
upload.render({
elem: '#test8'
, url: '/baseService/xueji/common_ImportPhotoZip?batch_id=' + GetQueryString("batch_id")
, auto: false
, accept: 'file' //普通文件
, bindAction: '#test9'
, before: function (obj) { //obj参数包含的信息跟 choose回调完全一致可参见上文。
layer.load(); //上传loading
}
, done: function (res, index, upload) {
layer.closeAll('loading'); //关闭loading
if (res.success) {
layer.msg("导入成功", {icon: 1}, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
parent.layui.table.reload('tableZZList',{page:{curr:1}});
parent.layui.table.reload('tableZZHuiZong',{page:{curr:1}});
})
} else {
layer.alert(res.message, function (index) {
})
}
}
, error: function (index, upload) {
layer.closeAll('loading'); //关闭loading
}
});
// 关闭页面
$("#closeDialog").click(function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
})
})
</script>
</body>
</html>