Examination_system/Examination_system-1/.svn/pristine/e3/e354695996d84b2cc10b48f2572...

316 lines
9.6 KiB
Plaintext

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<!DOCTYPE html >
<html lang="en">
<head>
<%@include file="../baseset.jsp" %>
<%@include file="../systemset.jsp" %>
<style type="text/css">
.widget-toolbar a{
vertical-align:middle;
}
.exp{
postion:absolute;
max-hight: 36px;
line-height: 25px;
background-color:#1761c1;
border-radius:5px;
text-align:center;
padding:0.3%;
color:white;
border:none;
margin-top:-5%;
font-size: smaller;
}
</style>
</head>
<body>
<div class="page-content">
<div class="row-fluid">
<div class="col-xs-12">
<form id="baseForm" class="form-inline" method="POST" onsubmit="return false;">
<div class="widget-header widget-header-large" style="padding:10px;">
<div class="widget-main customBtn" >
<!-- <span>字典类型名称:</span> -->
<input id="keyWord" type="text" name="keyWord" placeholder="请输入关键词..." />
<button class="btn btn-success btn-sm" onclick="getbaseList(1)" id="search" title="查询" type="button">查询</button>
<input id="articleImageFile" type="file" class="form-control" style="width: 200px; display: inline;" />
<button type="button" class="exp" onclick="importData();">批量导入</button>
<button type="button" class="exp" onclick="importTemplate();" style="width:90px;">导入模板下载</button>
</div>
<div class="widget-toolbar customBtn">
<shiro:hasPermission name="user:add">
<a title="新增" onclick="add()" class="lrspace3" ><i class='icon-plus-sign color bigger-180'></i></a>
</shiro:hasPermission>
<shiro:hasPermission name="user:view">
<a title="查看" onclick="view()" class="lrspace3" ><i class='icon-info-sign color bigger-180'></i></a>
</shiro:hasPermission>
<shiro:hasPermission name="user:edit">
<a title="修改" onclick="edit()" class="lrspace3" ><i class='icon-edit-sign color bigger-180'></i></a>
</shiro:hasPermission>
<%-- <shiro:hasPermission name="user:reset">
<a title="重置密码" onclick="resetPassword()" class="lrspace3" ><i class='icon-lock color bigger-180'></i></a>
</shiro:hasPermission> --%>
<%-- <shiro:hasPermission name="user:del">
<a title="删除" onclick="del()" class="lrspace3" ><i class='icon-remove-sign color color-red bigger-180'></i></a>
</shiro:hasPermission> --%>
<a title="打印" id="printBtns" onclick="print()" class="lrspace3" ><i class='icon-print color-green bigger-180'></i></a>
<a title="刷新" id="searchBtn" onclick="getbaseList()" class="lrspace3" ><i class='icon-refresh bigger-180 orange'></i></a>
</div>
</div>
</form>
<table id="baseTable" class="table table-striped table-bordered table-hover" >
<thead>
<tr>
<th style="width:5%" class="center">
选择<!-- <label><input type="checkbox" class="ace" ><span class="lbl"></span></label> -->
</th>
<th style="width:5%" class='center'>序号</th>
<th style="width:12%" class="center">身份证号</th>
<th style="width:8%" class="center">姓名</th>
<th style="width:5%" class="center">性别</th>
<th style="width:8%" class="center">联系电话</th>
<th style="width:17%" class="center">所属部门</th>
<th style="width:10%" class="center">系统角色</th>
<th style="width:10%" class="center">创建日期</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<!-- #orUpdateFrom -->
<%@include file="userform.jsp" %>
<!-- #dialog-confirm -->
<%@include file="../dialog.jsp" %>
<script type="text/javascript">
var obj = {};
/**
* @author 无畏
* @date 2019-05-24
* @function 启动执行
* @returns
*/
$(function () {
$.fn.modal.Constructor.prototype.enforceFocus = function(){};
$(".js-example-basic-single").select2({
"language": "zh-CN"
});
$("#baseForm").keydown(function(e) {
keycode = e.which || e.keyCode;
if (keycode == 13) {
search();
}
});
getbaseList(1);
});
/**
* @author 无畏
* @date 2019-05-26
* @function 条件查询
* @returns
*/
function search(){
$("#search").trigger("click")
}
/**
* @author 无畏
* @date 2019-05-24
* @function 初始化页面ajax请求 返回html页面
* @returns
*/
function getbaseList(init){
obj = {};
if(!JY.Object.notNull(init)){
init = $("#pageNum").val();
}
var size = $("#pageSize").val();
var data = {pageNum:init,pageSize:size};
data.obj = getObjParam("baseForm");
var idx = layer.msg('正在加载数据,请稍等...', {
icon: 16
,shade: 0.01
,time:'-1'
});
$.ajax({
type:"POST",
url:bonuspath +'/backstage/user/findByPageOfNew',
data: JSON.stringify(data),
dataType:"html",
contentType:"application/json",
success:function(data){
$("#baseTable tbody").html(data);
layer.close(idx);
}
})
}
/**
* @author 无畏
* @date 2019-08-05
* @function 批量删除
* @returns
*/
function del(){
deving();
}
/**
* @author 无畏
* @date 2019-12-31
* @function
* @returns
*/
function add(){
var index = layer.open({
type: 2,
title: "新增员工",
btn:["保存","取消"],
shade: [0],
area: ['60%', '65%'],
anim: 2,
yes: function(index,layero){
var obj = $(layero).find("iframe")[0].contentWindow;
obj.addUser();
},
content: [bonuspath +'/backstage/user/userAddPage']
});
}
function edit(){
if(validCheckboxCheckedNum(1)){
var oo = $(".cb:checkbox:checked:eq(0)");
var id = oo.val();
var index = layer.open({
type: 2,
title: "员工信息修改",
btn:["保存","取消"],
shade: [0],
area: ['60%', '65%'],
anim: 2,
yes: function(index,layero){
var page = $(layero).find("iframe")[0].contentWindow;
page.updateUser();
},
content: [bonuspath +'/backstage/user/toEditUser?id='+id]
});
}
}
function view(){
if(validCheckboxCheckedNum(1)){
var oo = $(".cb:checkbox:checked:eq(0)");
var id = oo.val();
var index = layer.open({
type: 2,
title: "员工信息查看",
btn:["关闭"],
shade: [0],
area: ['60%', '65%'],
anim: 2,
yes: function(index,layero){
layer.close(index);
},
content: [bonuspath +'/backstage/user/toViewUser?id='+id]
});
}
}
function resetPassword(){
if(validCheckboxCheckedNum(1)){
var oo = $(".cb:checkbox:checked:eq(0)");
var accountId = oo.val();
$("#resetPwdFrom input[name$='id']").val(accountId);//类型
$("#resetPwdFrom input[name$='pwd']").val('');//类型
$("#resetPwdDiv").removeClass('hide').dialog({resizable: false,modal:true,title:"<div class='widget-header'><h4 class='smaller'>密码重置</h4></div>",title_html: true,
buttons: [
{
html: "<i class='icon-ok bigger-110'></i>&nbsp;保存","class" : "btn btn-primary btn-xs",
click: function() {
if(JY.Validate.form("resetPwdFrom")){
var that =$(this);
JY.Ajax.doRequest("resetPwdFrom",bonuspath +'/backstage/user/resetPwd',null,function(data){
that.dialog("close");
JY.Model.info(data.resMsg,function(){search();});
});
}
}
},
{
html: "<i class='icon-remove bigger-110'></i>&nbsp;取消","class":"btn btn-xs",
click: function() {
$(this).dialog("close");
}
}
]
});
}
}
function importData() {
var formData = new FormData($('form')[0]);
var name = $("#articleImageFile").val();
if(name==null|| name == "") {
return;
}
if(!(name.endsWith(".xls") || name.endsWith(".xlsx") || name.endsWith(".xlsm"))) {
alert("请上传正确的Excel表格!");
$("#articleImageFile").val("");
return;
}
formData.append("file", $("#articleImageFile")[0].files[0]);
var idx = layer.msg('正在提交数据,请稍等...', {
icon: 16
,shade: 0.01
,time:'-1'
});
$.ajax({
url : bonuspath + "/backstage/user/import",
type : 'POST',
async : true,
data : formData,
timeout:20000,
// 告诉jQuery不要去处理发送的数据
processData : false,
// 告诉jQuery不要去设置Content-Type请求头
contentType : false,
success : function(data) {
layer.close(idx);
var datas = JSON.parse(data);
var indexMsg = layer.confirm("<h3 style='color:red'>"+datas.resMsg+"</h3>", {btn: ['关闭']},function(){
layer.close(indexMsg);
getbaseList();
});
},
error:function(XMLHttpRequest, textStatus, errorThrown) {
console.log(JSON.stringify(errorThrown));
layer.close(idx);
var datas = JSON.parse(data);
var indexMsg = layer.confirm("<h3 style='color:red'>"+datas.resMsg+"</h3>", {btn: ['关闭']},function(){
layer.close(indexMsg);
});
}
});
$("#articleImageFile").val("");
}
function importTemplate() {
//document.location= bonuspath+"/static/js/model/人员信息导入模板.xls";
//$(location).attr("href",bonuspath +'/backstage/user/downloadExcel?type=1');
document.location= bonuspath+"/static/js/model/人员管理模板.xls"
}
</script>
</body>
</html>