<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
%>
|
<%@ taglib uri="/struts-tags" prefix="s"%>
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<title>用户密码重置</title>
|
<link rel="stylesheet" type="text/css" href="css/basic.css">
|
<link rel="stylesheet" type="text/css" href="css/query.css">
|
<link rel="stylesheet" type="text/css" href="css/confirm.css">
|
<link rel="stylesheet" type="text/css" href="css/nocontent.css">
|
<link rel="stylesheet" type="text/css" href="jqueryui/jquery-ui.css">
|
|
<style type="text/css" media="screen">
|
.search-user {
|
position: fixed;
|
width: 30px;
|
right: 20px;
|
bottom: 60px;
|
z-index: 99;
|
background-color: #FFFFFF;
|
border: 1px solid #aaa;
|
border-radius: 16px;
|
}
|
|
.search-user:hover {
|
width: 235px;
|
}
|
.search-user .search-input {
|
float: left;
|
display: none;
|
margin-left: 20px;
|
}
|
.search-user:hover .search-input {
|
display: block;
|
}
|
.search-user .search-input input {
|
width: 180px;
|
height: 30px;
|
outline: none;
|
}
|
.search-user .search-btn {
|
float: left;
|
}
|
.search-user .search-btn a{
|
display: block;
|
width: 30px;
|
height: 30px;
|
background-image: url('image/user-search.gif');
|
background-position: 4px;
|
background-repeat: no-repeat;
|
}
|
.reset-pwd {
|
cursor: pointer;
|
}
|
</style>
|
</head>
|
<body>
|
<!--头部内容开始-->
|
<jsp:include page="Top.jsp" flush="true"/>
|
<!--头部内容结束-->
|
<!--导航开始-->
|
<jsp:include page="nav.jsp" flush="true"/>
|
|
<!--头部内容结束-->
|
<div id="main">
|
<div class="tbl-header"></div>
|
<div class="tbl-body"></div>
|
<!-- 分页内容 -->
|
<div id="paging">
|
当前<span id="current">1/1</span>
|
<span>每页<input type="text" id="number" value="10"/>条</span>
|
数据总量<span id="total">10</span>
|
<a href="javascript:" id="home">首页</a>
|
<a href="javascript:" id="pre">上一页</a>
|
<a href="javascript:" id="next_p">下一页</a>
|
<a href="javascript:" id="last">尾页</a>
|
</div>
|
</div>
|
<!-- 用户查询 -->
|
<div class="search-user">
|
<div class="search-input"><input type="text" id="keyword" placeholder="请输入关键字"></div>
|
<div class="search-btn"><a href="javascript:searchUser();" title="查询"></a></div>
|
</div>
|
<script type="text/javascript" src="js/buildNav.js"></script>
|
<script type="text/javascript" src="js/createTab.js"></script>
|
<script type="text/javascript" src="js/query.js"></script>
|
<script type="text/javascript" src="js/myConfirm.js"></script>
|
<script type="text/javascript" src="js/nocontent.js"></script>
|
<script type="text/javascript" src="js/pageUtil.js"></script>
|
<script type="text/javascript">
|
var Page = {
|
pageCurr:1,
|
pageSize:10,
|
pageAll:0
|
};
|
var alluser = new Array();
|
var arrTh = new Array();
|
var arrTd = new Array();
|
arrTh = [
|
'员工编号', '员工姓名', '性别', '身份证号', '职称', '手机号码', '密码重置'
|
];
|
|
$(function () {
|
/* arrTd = [
|
'10001', '张三', '男', '463485228455895', '软件工程师', '12456243247', '<img src="image/reset-pwd.gif" class="reset-pwd" title="重置密码"/>',
|
'10001', '张三', '男', '463485228455895', '软件工程师', '12456243247', '<img src="image/reset-pwd.gif" class="reset-pwd" title="重置密码"/>'
|
]; */
|
//createFullTbl($('.tbl-header'), $('.tbl-body'), arrTh, arrTd);
|
});
|
|
$(function() {
|
$('.tbl-body').on('click', '.reset-pwd', function() {
|
var trIndex= $(this).parent().parent().index();
|
var obj = alluser[trIndex];
|
var cont = "是否重置'"+obj.UName+"'的密码?<input type='hidden' kk='"+obj.UName+"' id='user-uid' value='"+obj.UId+"'>";
|
myConfirm.show({content: cont, class: 'reset-pwd-btn'});
|
});
|
|
myConfirm.confirm.on('click','.reset-pwd-btn',function() {
|
//myConfirm.hide();
|
//noContent.showNoContent('重置成功!!!');
|
resetPass({
|
UId:$('#user-uid').val(),
|
UName:$('#user-uid').attr('kk')
|
});
|
});
|
});
|
|
//重置用户密码
|
function resetPass(temp){
|
$.ajax({
|
type: "post",
|
url: "User_infAction!resetPassword",
|
async:true,
|
dataType:'text',
|
data:"upjson="+JSON.stringify(temp),
|
success: function(data){
|
data = eval("("+data+")");
|
var model = eval("("+data.result+")");
|
console.info(model);
|
if(model.code==1){
|
noContent.showNoContent("密码重置成功!");
|
}else{
|
noContent.showNoContent("密码重置失败!");
|
}
|
myConfirm.hide();
|
},
|
error:function(){
|
myConfirm.hide();
|
noContent.showNoContent("密码重置失败,请检查网络连接!");
|
}
|
});
|
}
|
|
searchUser();
|
//模糊查询用户
|
function searchUser(){
|
loading.showLoading($('#main'));
|
var temp = {
|
uinf:{
|
UName:$('#keyword').val(),
|
UEmployeeId:$('#keyword').val(),
|
},
|
page:Page
|
};
|
arrTd = new Array();
|
alluser = new Array();
|
$.ajax({
|
type: "post",
|
url: "User_infAction!searchByNameOrId",
|
async:true,
|
dataType:'text',
|
data:"upjson="+JSON.stringify(temp),
|
success: function(data){
|
data = eval("("+data+")");
|
var model = eval("("+data.result+")");
|
console.info(model);
|
alluser = model.data;
|
if(model.code==1){
|
for(var i=0;i<model.data.length;i++){
|
arrTd.push(model.data[i].UEmployeeId);
|
arrTd.push(model.data[i].UName);
|
arrTd.push(model.data[i].USex);
|
arrTd.push(model.data[i].UShenFenId);
|
arrTd.push(model.data[i].UAuthority);
|
arrTd.push(model.data[i].UMobilephone);
|
arrTd.push('<img src="image/reset-pwd.gif" class="reset-pwd" title="重置密码"/>');
|
Page.pageAll = parseInt(model.data[i].UNote);
|
}
|
}else{
|
Page.pageAll = 0;
|
Page.pageCurr = 1;
|
noContent.showNoContent("暂无查询数据");
|
}
|
var pagenum = Math.ceil(Page.pageAll/Page.pageSize);
|
$('#current').text(Page.pageCurr+'/'+pagenum);
|
$('#total').text(Page.pageAll);
|
loading.hideLoading($('#main'));
|
createFullTbl($('.tbl-header'), $('.tbl-body'), arrTh, arrTd);
|
},
|
error:function(){
|
loading.hideLoading($('#main'));
|
}
|
});
|
}
|
|
//当用户按回车时相当于查询
|
$(window).keypress(function(){
|
if(event.keyCode==13)
|
searchUser();
|
});
|
|
|
$(function(){
|
//跳转到首页
|
$('#home').click(function(){
|
GotoFirstPage(Page,searchUser);
|
});
|
|
//跳转到上一页
|
$('#pre').click(function(){
|
GotoPrePage(Page,searchUser);
|
});
|
|
//跳转到下一页
|
$('#next_p').click(function(){
|
GotoNextPage(Page,searchUser);
|
});
|
|
//跳转到尾页
|
$('#last').click(function(){
|
GotoLastPage(Page,searchUser);
|
});
|
|
$('#number').blur(function(){
|
var pagesize = $(this).val();
|
if(pagesize>0){
|
Page.pageSize = parseInt(pagesize);
|
}else{
|
noContent.showNoContent("请输入规范的整数");
|
$(this).val(Page.pageSize);
|
}
|
});
|
});
|
</script>
|
</body>
|
</html>
|