first commit
This commit is contained in:
40
WebRoot/jsp/security/areaManage4select.jsp
Normal file
40
WebRoot/jsp/security/areaManage4select.jsp
Normal file
@ -0,0 +1,40 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/work/areaManage/getAreaManageJson.do', {ng:''} , function(data) {
|
||||
//console.info(data)
|
||||
if(data.length>0){
|
||||
$('#fault_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#fault_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
// $('#${param.formId} #${param.textId}').val(data.code);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("fault4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="fault4SelectModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">选择区域</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="fault_select_tree" style="height:430px;overflow:auto;width:100%"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!-- <button type="button" class="btn btn-primary" onclick="selectMenu()">保存</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
180
WebRoot/jsp/security/areaManageAdd.jsp
Normal file
180
WebRoot/jsp/security/areaManageAdd.jsp
Normal file
@ -0,0 +1,180 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function saveUserFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/user/saveUser.do", $("#addForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
//保存权限
|
||||
var val = $('#_roles').val();
|
||||
console.log("val", val);
|
||||
var rolestr = "";
|
||||
if (val != null) {
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
});
|
||||
$.post(ext.contextPath + "/user/updateRoleUser.do", { rolestr: rolestr, userid: data.id }, function (data1) {
|
||||
if (data1 < 0) {
|
||||
showAlert('d', '权限保存失败');
|
||||
} else {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '登陆名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_pname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '公司/部门不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_roles: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '权限不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUnit4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', { formId: "addForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited");
|
||||
});
|
||||
};
|
||||
|
||||
function loadUser() {
|
||||
$.post(ext.contextPath + "/user/selectUserForMsgAlarmlevel.do", function (data) {
|
||||
var select = $("#_powers").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: true,
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
$(function () {
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function () { }
|
||||
$.get(ext.contextPath + "/process/dataVisualFrame/getJson.do",function(data){
|
||||
var select = $("#pid").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//数据超过十个启用搜索框
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {console.log(repo); return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
},'json');
|
||||
loadUser();
|
||||
});
|
||||
|
||||
/*function showPositionSystemUsers(){
|
||||
|
||||
}*/
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="id" value="${user.id }" />
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*区域名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="区域名称" value="" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*所属画面</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="pid" name="pid" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">权限</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="_powers" name="powerids" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="备注...">${areaManage.remarks}</textarea> </select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="saveUserFun()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
140
WebRoot/jsp/security/areaManageAddnew.jsp
Normal file
140
WebRoot/jsp/security/areaManageAddnew.jsp
Normal file
@ -0,0 +1,140 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showAreaManage4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/areaManage/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
$.post(ext.contextPath + "/work/areaManage/save.do", $("#subForm").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
initTreeView();
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/process/dataVisualFrame/getJson.do", {}, function(data) {
|
||||
var selelct =$("#fid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
if(data.length>=1){
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
|
||||
}else{
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#powerids").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', { formId: "subForm", hiddenId: "powerids", textId: "_powers", 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>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<form class="form-horizontal " id="subForm">
|
||||
<input id="id" name="id" type="hidden" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">区域名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" ">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级区域" onclick="showAreaManage4SelectFun();" value="${pname}"></input>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属画面</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" name="fid" id="fid"></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="coordinatesPic" name="coordinatesPic" placeholder="输入格式为:X1,Y1;X2,Y2"
|
||||
value="">
|
||||
</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="coordinatesPosition" name="coordinatesPosition" placeholder="输入格式为:X1,Y1;X2,Y2"
|
||||
value="" onclick="coordinatesPicDiv()">
|
||||
</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="_powers" name="_powers" placeholder="有权限进入的人员,未配置表示所有人都可以进入"
|
||||
value="" onclick="showUser4SelectsFun();">
|
||||
<input id="powerids" name="powerids" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否启用人员进出记录</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="recordStatus" name="recordStatus" style="width: 100%;">
|
||||
<option value="0">禁用</option>
|
||||
<option value="1" selected>启用</option>
|
||||
</select>
|
||||
</div><label class="col-sm-2 control-label">图层类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="layer" name="layer" style="width: 100%;">
|
||||
<option value="0">无</option>
|
||||
<option value="1">上层</option>
|
||||
<option value="2">下层</option>
|
||||
<option value="3" selected>全部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="备注..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
182
WebRoot/jsp/security/areaManageEdit.jsp
Normal file
182
WebRoot/jsp/security/areaManageEdit.jsp
Normal file
@ -0,0 +1,182 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var showAreaManage4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/areaManage/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
function doupdate() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||||
$.post(ext.contextPath + "/work/areaManage/update.do", $("#subForm").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
showAlert('s','保存成功');
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function dodel() {
|
||||
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(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/areaManage/delete.do', $("#subForm").serialize(), function(data) {
|
||||
if(data>0){
|
||||
initTreeView();
|
||||
}else{
|
||||
showAlert('d','删除失败');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$.post(ext.contextPath + "/process/dataVisualFrame/getJson.do", {}, function(data) {
|
||||
var selelct =$("#fid").select2({
|
||||
data: data,
|
||||
placeholder:'请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: -1,//禁用搜索框
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
if(data.length>=1){
|
||||
selelct.val('${areaManage.fid}').trigger("change");
|
||||
|
||||
}else{
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#powerids").val();
|
||||
// $.post(ext.contextPath + '/user/userForSelect4FirstActiviti.do', { formId: "subForm", hiddenId: "powerids", textId: "_powers", userIds: userIds }, function (data) {
|
||||
$.post(ext.contextPath + '/user/userForSelect4FirstActiviti.do', { formId: "subForm", hiddenId: "powerids", textId: "_powers", 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="doupdate()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i class="glyphicon glyphicon-floppy-disk"></i></a>
|
||||
<a onclick="dodel()" 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="${areaManage.id}"/>--%>
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">区域名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${areaManage.name}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级区域" onclick="showAreaManage4SelectFun();" value="${areaManage.pname}"></input>
|
||||
<input id="pid" name="pid" type="hidden" value="${areaManage.pid}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属画面</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" name="fid" id="fid"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">编号</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control select2" name="id" id="id" value="${areaManage.id}" readonly></input>
|
||||
</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="coordinatesPic" name="coordinatesPic" placeholder="输入格式为:X1,Y1;X2,Y2"
|
||||
value="${areaManage.coordinatesPic}">
|
||||
</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="coordinatesPosition" name="coordinatesPosition" placeholder="输入格式为:X1,Y1;X2,Y2"
|
||||
value="${areaManage.coordinatesPosition}" onclick="coordinatesPicDiv()">
|
||||
</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="_powers" name="_powers" placeholder="有权限进入的人员,未配置表示所有人都可以进入"
|
||||
value="${areaManage._powers}" onclick="showUser4SelectsFun();">
|
||||
<input id="powerids" name="powerids" type="hidden" value="${areaManage.powerids}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否启用人员进出记录</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="recordStatus" name="recordStatus" style="width: 100%;">
|
||||
<option value="0" <c:if test="${areaManage.recordStatus=='0'}">selected</c:if>>禁用</option>
|
||||
<option value="1" <c:if test="${areaManage.recordStatus=='1'}">selected</c:if>>启用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">图层类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="layer" name="layer" style="width: 100%;">
|
||||
<option value="0" <c:if test="${areaManage.layer=='0'}">selected</c:if>>无</option>
|
||||
<option value="1" <c:if test="${areaManage.layer=='1'}">selected</c:if>>上层</option>
|
||||
<option value="2" <c:if test="${areaManage.layer=='2'}">selected</c:if>>下层</option>
|
||||
<option value="3" <c:if test="${areaManage.layer=='3'}">selected</c:if>>全部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remarks" name ="remarks" placeholder="备注..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
282
WebRoot/jsp/security/areaManageList.jsp
Normal file
282
WebRoot/jsp/security/areaManageList.jsp
Normal file
@ -0,0 +1,282 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCommStr"%>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Trade", EquipmentCommStr.EquipmentLife_Standard_Trade); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Supplier", EquipmentCommStr.EquipmentLife_Standard_Supplier); %>
|
||||
<%request.setAttribute("EquipmentLife_Standard_Enterprise", EquipmentCommStr.EquipmentLife_Standard_Enterprise); %>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" />
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
//新增设备类型
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/areaManage/doadd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//编辑设备类型
|
||||
var editFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doedit.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//查看设备等级
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doview.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
//删除一条设备类型数据
|
||||
var deleteFun = function (id) {
|
||||
stopBubbleDefaultEvent();
|
||||
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 + '/equipment/equipmentClass/doDeleteProp.do', { id: id }, function (data) {
|
||||
if (data >= 0) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/dodelete.do', { id: id }, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
//删除多条设备类型数据
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
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(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/doDeletesProp.do', { ids: datas }, function (data) {
|
||||
if (data >= 0) {
|
||||
$.post(ext.contextPath + '/equipment/equipmentClass/dodeletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/areaManage/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '区域名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'dataVisualFrame', // 返回json数据中的name
|
||||
title: '所属画面', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.name;
|
||||
}
|
||||
}, {
|
||||
field: 'coordinates', // 返回json数据中的name
|
||||
title: '顶点坐标', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'// 上下居中
|
||||
}, {
|
||||
field: '_powers', // 返回json数据中的name
|
||||
title: '权限人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="work/areaManage/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts += '<security:authorize buttonUrl="work/areaManage/delete.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||
buts += '</security:authorize>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%--<jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="head_title"></h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||
<!-- <li class="active">Here</li> -->
|
||||
</ol>
|
||||
</section>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="work/areaManage/add.do">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||
class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||
placeholder="区域名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
103
WebRoot/jsp/security/areaManageListnew.jsp
Normal file
103
WebRoot/jsp/security/areaManageListnew.jsp
Normal file
@ -0,0 +1,103 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="-1";
|
||||
console.info(node)
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
console.log("pid is = ", pid)
|
||||
$.post(ext.contextPath + '/work/areaManage/add.do', {pid:pid} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/areaManage/edit.do', {id:id} , function(data) {
|
||||
$("#faultBox").html(data);
|
||||
});
|
||||
};
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/work/areaManage/getAreaManageJson.do', function(data) {
|
||||
$('#tree').treeview({data: data});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
editFun(data.id);
|
||||
});
|
||||
},'json');
|
||||
$("#faultBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
initTreeView();
|
||||
});
|
||||
|
||||
// 画面坐标
|
||||
var coordinatesPicDiv = function() {
|
||||
var layer = $("#subForm #layer").val();
|
||||
$.post(ext.contextPath + '/work/areaManage/getCoordinate4Areas.do', {
|
||||
layer: layer,
|
||||
}, function (data) {
|
||||
$("#coordinatesPicDiv").html(data);
|
||||
openModal('coordinatesPicModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<!-- 引用top -->
|
||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||
<!-- 菜单栏 -->
|
||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<%-- <section class="content-header">--%>
|
||||
<%-- <h1 id ="head_title"></h1>--%>
|
||||
<%-- <ol class="breadcrumb">--%>
|
||||
<%-- <li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>--%>
|
||||
<%-- <!-- <li class="active">Here</li> -->--%>
|
||||
<%-- </ol>--%>
|
||||
<%-- </section>--%>
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="coordinatesPicDiv"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">区域</h3>
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFun();"><i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="tree" style="height:550px;overflow:auto; "></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9" id="faultBox"></div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user