@{
|
Layout = "~/Views/Shared/_Layout_Content.cshtml";
|
}
|
|
<div class="wrapper wrapper-content" style="padding: 15px;">
|
<div class="row" name="rowSysCode0" label="修改密码" item="SysCode" control="panel">
|
<div class="ibox float-e-margins">
|
<div class="ibox-title">
|
<h5><i class="fa fa-list"></i> 修改密码</h5>
|
<div class="ibox-tools"> <a class="collapse-link" onclick="collapseBox(this);"><i class="fa fa-chevron-up" title="折叠/展开明细"></i></a> </div>
|
</div>
|
<div id="div_content" class="ibox-content">
|
<div class="row">
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-2 col-md-2 col-sm-offset-1 col-md-offset-1 control-label">原密码<i class="red" style="color:Red;">*</i></label> <div class="col-sm-4 col-md-4" style="padding-left: 0px;"><input id="txtOldPwd" class="form-control" label="" name="txtOldPwd" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="password" value="" onblur="validateOldPwd(this);" onkeyup="validateOldPwd(this);"><label onmouseover="activeLab(this);" onmouseout="deactiveLab(this);" onmousedown="showPwd(event, this);" onmouseup="hidePwd(event, this);"><i1></i1><i2 style="display:none;"></i2></label></div><div class="col-sm-5 col-md-5" style="padding-left: 0px; margin-top: 8px; color: red;"><label id="oldPwdPromptText"></label></div>
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-2 col-md-2 col-sm-offset-1 col-md-offset-1 control-label">新密码<i class="red" style="color:Red;">*</i></label> <div class="col-sm-4 col-md-4" style="padding-left: 0px;"><input id="txtNewPwd" class="form-control" label="" name="txtNewPwd" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="password" value="" onkeyup="validateNewPwd(this);"><label onmouseover="activeLab(this);" onmouseout="deactiveLab(this);" onmousedown="showPwd(event, this);" onmouseup="hidePwd(event, this);"><i1></i1><i2 style="display:none;"></i2></label></div><div id="newPwdPromptText" class="col-sm-5 col-md-5" style="padding-left: 0px;">
|
<div id="lowStronge" class="prompt-bar prompt-bar-default">低</div>
|
<div id="middleStronge" class="prompt-bar prompt-bar-default">中</div>
|
<div id="higeStronge" class="prompt-bar prompt-bar-default">高</div>
|
</div>
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:10px;">
|
<label class="text-right col-sm-2 col-md-2 col-sm-offset-1 col-md-offset-1 control-label">确认密码<i class="red" style="color:Red;">*</i></label> <div class="col-sm-4 col-md-4" style="padding-left: 0px;"><input id="txtReNewPwd" class="form-control" label="" name="txtReNewPwd" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="password" value="" onkeyup="validateNewPwd(this);"><label onmouseover="activeLab(this);" onmouseout="deactiveLab(this);" onmousedown="showPwd(event, this);" onmouseup="hidePwd(event, this);"><i1></i1><i2 style="display:none;"></i2></label></div><div class="col-sm-5 col-md-5" style="padding-left: 0px; margin-top: 8px; color: red;"><label id="reNewPwdPromptText"></label></div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%; left: 0; bottom:0;text-align: right; padding-top:8px ">
|
<div id="divButtonsPanel" class="" style="float:right;" data-bootstro-width="500px">
|
<a id="linkSave" style="" class="btn btn-success" href="javascript:void(0)" onclick="savePassword();"><i class="glyphicon glyphicon-ok"></i> <span class="bold">提交</span></a>
|
</div>
|
<div class="bootstro" style="float:left; width:400px;height:40px" id="divexam" data-bootstro-width="500px" data-bootstro-content="当前业务单据基础信息:单据类型,申请人,单据状态,当前节点,当前节点审批人">
|
</div>
|
<div class="bootstro" style="float:left; margin-left:50px; height:40px;width:200px; border:0px solid aquamarine ; overflow:auto" id="divcomment" data-bootstro-content="当前业务单据操作说明"></div>
|
</div>
|
|
@section headerStyle{
|
<style type="text/css">
|
div.clearfix > label {
|
padding-top: 8px;
|
}
|
|
input[type="password"] {
|
padding-right: 40px;
|
}
|
|
i1:before {
|
content: "\f070";
|
color: #aaa;
|
font-size: 22px;
|
font-family: FontAwesome;
|
position: absolute;
|
right: 25px;
|
top: 2px;
|
}
|
|
i2:before {
|
content: "\f070";
|
color: #000;
|
font-size: 22px;
|
font-family: FontAwesome;
|
position: absolute;
|
right: 25px;
|
top: 2px;
|
}
|
|
.prompt-bar {
|
width: 20%;
|
height: 25px;
|
margin: 5px 2px;
|
padding-top: 4px;
|
float: left;
|
text-align: center;
|
}
|
|
.prompt-bar-default {
|
background-color: #F6F6FA;
|
color: #AAAAAA;
|
}
|
|
.prompt-bar-low {
|
background-color: #FF4B47;
|
color: #FFF;
|
}
|
|
.prompt-bar-middle {
|
background-color: #F9AE35;
|
color: #FFF;
|
}
|
|
.prompt-bar-high {
|
background-color: #2DAF7D;
|
color: #FFF;
|
}
|
</style>
|
}
|
|
@section footerScripts {
|
<script type="text/javascript">
|
$(function () {
|
var hh = document.body.clientHeight - $("#top").height() - 142;
|
$(".tree, #div_content").height(hh);
|
});
|
|
// 保存密码
|
var savePassword = function () {
|
var oldPwd = $('#txtOldPwd').val();
|
var newPwd = $('#txtNewPwd').val();
|
var reNewPwd = $('#txtReNewPwd').val();
|
if (oldPwd == "") {
|
toastr.warning("请填写原密码");
|
return;
|
}
|
if (Verify.strShortLength(oldPwd)) {
|
msg.warn("原密码超长");
|
return;
|
}
|
if (newPwd == "") {
|
toastr.warning("请填写新密码");
|
return;
|
}
|
if (Verify.strShortLength(newPwd)) {
|
msg.warn("新密码超长");
|
return;
|
}
|
if (reNewPwd == "") {
|
msg.warn("请填写确认密码");
|
return;
|
}
|
if (Verify.strShortLength(reNewPwd)) {
|
msg.warn("确认密码超长");
|
return;
|
}
|
if (newPwd != reNewPwd) {
|
msg.warn("两次密码不一致");
|
return;
|
}
|
$.ajax({
|
type: "POST",
|
url: "/Home/ChangePassword",
|
dataType: "json",
|
data: { oldPwd: oldPwd, newPwd: newPwd },
|
success: function (data) {
|
if (data) {
|
if (data.Result) {
|
toastr.success(data.Message);
|
} else {
|
toastr.warning(data.Message);
|
}
|
}
|
},
|
error: function () {
|
toastr.error("保存失败");
|
}
|
});
|
}
|
|
// 激活查看密码
|
var activeLab = function (dom) {
|
$(dom).children('i1').hide();
|
$(dom).children('i2').show();
|
}
|
|
// 取消查看密码
|
var deactiveLab = function (dom) {
|
$(dom).children('i1').show();
|
$(dom).children('i2').hide();
|
$(dom).siblings('input').attr('type', 'password');
|
}
|
|
// 显示密码
|
var showPwd = function (e, dom) {
|
if (e.button == 0)
|
$(dom).siblings('input').attr('type', 'text');
|
}
|
|
// 隐藏密码
|
var hidePwd = function (e, dom) {
|
if (e.button == 0)
|
$(dom).siblings('input').attr('type', 'password');
|
}
|
|
// 验证原密码
|
var validateOldPwd = function (dom) {
|
var oldPwd = $(dom).val();
|
if (oldPwd == "") {
|
$('#oldPwdPromptText').text("请填写原密码");
|
} else {
|
$('#oldPwdPromptText').text('');
|
}
|
}
|
|
// 验证新密码
|
var validateNewPwd = function (dom) {
|
var newPwd = $('#txtNewPwd').val();
|
var reNewPwd = $('#txtReNewPwd').val();
|
if (newPwd == "" && reNewPwd == "") {
|
$('#reNewPwdPromptText').text('');
|
} else {
|
if (newPwd !== reNewPwd) {
|
$('#reNewPwdPromptText').text('两次密码不一致');
|
} else {
|
$('#reNewPwdPromptText').text('');
|
}
|
}
|
if ($(dom).attr('id') == 'txtNewPwd') {
|
validateNewPwdStronge(newPwd);
|
}
|
}
|
|
// 验证密码强度
|
var validateNewPwdStronge = function (newPwd) {
|
if (newPwd.length == 0) {
|
$('#lowStronge').removeClass('prompt-bar-low').addClass('prompt-bar-default');
|
$('#middleStronge').removeClass('prompt-bar-middle').addClass('prompt-bar-default');
|
$('#higeStronge').removeClass('prompt-bar-high').addClass('prompt-bar-default');
|
} else if (newPwd.length > 0 && newPwd.length < 6) {
|
$('#lowStronge').removeClass('prompt-bar-default').addClass('prompt-bar-low');
|
$('#middleStronge').removeClass('prompt-bar-middle').addClass('prompt-bar-default');
|
$('#higeStronge').removeClass('prompt-bar-high').addClass('prompt-bar-default');
|
} else {
|
$('#lowStronge').removeClass('prompt-bar-default').addClass('prompt-bar-low');
|
$('#middleStronge').removeClass('prompt-bar-default').addClass('prompt-bar-middle');
|
var reg = /\W/;
|
var count = 0;
|
for (var i = 0, len = newPwd.length; i < len; i++) {
|
if (reg.test(newPwd[i])) {
|
if (++count >= 2) {
|
break;
|
}
|
}
|
}
|
if (count >= 2) {
|
$('#higeStronge').removeClass('prompt-bar-default').addClass('prompt-bar-high');
|
} else {
|
$('#higeStronge').removeClass('prompt-bar-high').addClass('prompt-bar-default');
|
}
|
}
|
}
|
</script>
|
}
|