137 lines
5.5 KiB
Plaintext
137 lines
5.5 KiB
Plaintext
|
|
<!DOCTYPE html
|
|||
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|||
|
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|||
|
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
|||
|
|
<%@page import="com.sipai.tools.CommString" %>
|
|||
|
|
<%request.setAttribute("Flag_Active", CommString.Flag_Active); %>
|
|||
|
|
<%request.setAttribute("Flag_Unactive", CommString.Flag_Unactive); %>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
$(function () {
|
|||
|
|
$("#active").select2({minimumResultsForSearch: 10}).val("${Flag_Active}").trigger("change");
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
function doSave() {
|
|||
|
|
// $("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/base/basicHomePage/update.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == "1") {
|
|||
|
|
initTreeView();
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
// }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// $("#subForm").bootstrapValidator({
|
|||
|
|
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
// fields: {
|
|||
|
|
// url: {
|
|||
|
|
// validators: {
|
|||
|
|
// notEmpty: {
|
|||
|
|
// message: '地址不能为空'
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
function del() {
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
classname: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
classname: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(willDelete => {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/base/basicHomePage/delete.do', $("#subForm").serialize(), function (data) {
|
|||
|
|
console.log(data)
|
|||
|
|
if (data.code > 0) {
|
|||
|
|
showAlert('s', '删除成功');
|
|||
|
|
initTreeView();
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '删除失败');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var showUser4SelectsFun = function () {
|
|||
|
|
var userIds = $("#unrolepeople").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "unrolepeople",
|
|||
|
|
textId: "unrolepeopleName",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="box box-primary">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">详情</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="doSave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
|||
|
|
class="glyphicon glyphicon-floppy-disk"></i></a>
|
|||
|
|
<a onclick="del()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
|||
|
|
class="glyphicon glyphicon-trash"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<form class="form-horizontal " id="subForm">
|
|||
|
|
<input id="id" name="id" type="hidden" value="${basicHomePage.id}"/>
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">启用</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="active" name="active" style="width:220px;">
|
|||
|
|
<option value="${Flag_Active}">启用</option>
|
|||
|
|
<option value="${Flag_Unactive}">禁用</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">地址</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input type="text" class="form-control" id="url" name="url" placeholder="地址"
|
|||
|
|
value="${basicHomePage.url}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<c:if test="${userId==emp01}">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">不可见用户</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea type="text" style="height: 80px;" class="form-control" id="unrolepeopleName"
|
|||
|
|
name="unrolepeopleName" placeholder="不可见用户" onclick="showUser4SelectsFun();"
|
|||
|
|
readonly>${basicHomePage.unrolepeopleName}</textarea>
|
|||
|
|
<input id="unrolepeople" name="unrolepeople" type="hidden"
|
|||
|
|
value="${basicHomePage.unrolepeople}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</c:if>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|