183 lines
8.3 KiB
Plaintext
183 lines
8.3 KiB
Plaintext
<%@ 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>
|