191 lines
8.4 KiB
Plaintext
191 lines
8.4 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"%>
|
||
<%@ 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">
|
||
function dosave() {
|
||
if ($("#iAreasType").val() == 1 && $("#identifyAreas").val() == "") {
|
||
$("#identifyAreas").val("1")
|
||
}
|
||
if ($("#vAreasType").val() == 1 && $("#visionAreas").val() == "") {
|
||
$("#visionAreas").val("1")
|
||
}
|
||
// $("#subForm").bootstrapValidator('validate');//提交验证
|
||
// if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/work/cameraDetail/dosave.do", $("#subForm2").serialize(), function(data) {
|
||
if (data == 1){
|
||
$("#table_Detail").bootstrapTable('refresh');
|
||
document.getElementById("subDetailModal").setAttribute("class", "modal hidden fade");
|
||
$(".modal-backdrop").remove();
|
||
}else if(data == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
// }
|
||
}
|
||
|
||
function doclose() {
|
||
closeModal('subDetailModal');
|
||
}
|
||
//输入框验证
|
||
// $("#subForm2").bootstrapValidator({
|
||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
// fields: {
|
||
// project: {
|
||
// validators: {
|
||
// notEmpty: {
|
||
// message: '名称不能为空'
|
||
// }
|
||
// }
|
||
// }
|
||
// }
|
||
// });
|
||
|
||
$.post(ext.contextPath + "/hqconfig/workModel/getJson.do", {}, function(data) {
|
||
var selelct =$("#algorithmid").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 selectMPint = function () {
|
||
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {
|
||
formId: 'subForm2',
|
||
hiddenId: 'pointid',
|
||
textId: 'alarmPointName'
|
||
}, function (data) {
|
||
$("#mpSubDiv").html(data);
|
||
openModal('mpSubModal');
|
||
});
|
||
};
|
||
|
||
$(function () {
|
||
document.getElementById('iDiv').style.visibility = 'hidden';
|
||
document.getElementById('vDiv').style.visibility = 'hidden';
|
||
$("#iAreasType").change(function () {
|
||
let iAreasType = $("#iAreasType").val();
|
||
if (iAreasType == '1') {
|
||
console.log(1)
|
||
document.getElementById('iDiv').style.visibility = 'visible';
|
||
} else {
|
||
console.log(2)
|
||
document.getElementById('iDiv').style.visibility = 'hidden';
|
||
}
|
||
});
|
||
$("#vAreasType").change(function () {
|
||
let vAreasType = $("#vAreasType").val();
|
||
if (vAreasType == '1') {
|
||
console.log(3)
|
||
document.getElementById('vDiv').style.visibility = 'visible';
|
||
} else {
|
||
console.log(4)
|
||
document.getElementById('vDiv').style.visibility = 'hidden';
|
||
}
|
||
});
|
||
})
|
||
|
||
</script>
|
||
<div class="modal fade" id="subDetailModal">
|
||
<div class="modal-dialog modal-lg">
|
||
<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强制为subForm -->
|
||
<form class="form-horizontal" id="subForm2">
|
||
<input type="hidden" id="cameraid" name="cameraid" value ="${cameraid}">
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">外部算法</label>
|
||
<div class="col-sm-4">
|
||
<select id="algorithmid" name="algorithmid" class="form-control select2" style="width: 100%">
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">状态</label>
|
||
<div class="col-sm-4">
|
||
<select type="text" id="state" class="form-control pull-right" name="status" >
|
||
<option value="1" selected>启用</option>
|
||
<option value="0">禁用</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="alarmPointName" name="alarmPointName"
|
||
placeholder="关键触发点" onclick="selectMPint();"
|
||
readonly>
|
||
<input type="hidden" id="pointid" name="pointid">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">*是否设置识别区域</label>
|
||
<div class="col-sm-4">
|
||
<select type="text" id="iAreasType" class="form-control pull-right" name="iAreasType" >
|
||
<option value="0" selected>否</option>
|
||
<option value="1" >是</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">*是否设置视野区域</label>
|
||
<div class="col-sm-4">
|
||
<select type="text" id="vAreasType" class="form-control pull-right" name="vAreasType" >
|
||
<option value="0" selected>否</option>
|
||
<option value="1" >是</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<div id="iDiv">
|
||
<label class="col-sm-2 control-label">识别区域</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="identifyAreas" name="identifyAreas">
|
||
</div>
|
||
</div>
|
||
<div id="vDiv">
|
||
<label class="col-sm-2 control-label">视野区域</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="visionAreas" name="visionAreas">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" onclick="doclose()">关闭</button>
|
||
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|