Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/work/cameradetailEdit.jsp
2026-01-16 14:13:44 +08:00

189 lines
8.7 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 doUpdateDetail() {
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/update.do", $("#subForm2").serialize(), function(data) {
if (data.res == 1){
$("#table_Detail").bootstrapTable('refresh');
document.getElementById("subDetailModal").setAttribute("class", "modal hidden fade");
$(".modal-backdrop").remove();
}else if(data.res == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
// }
}
function doclose() {
closeModal('subDetailModal');
}
$.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");
// }
selelct.val('${cameraDetail.algorithmid}').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 () {
if ('${cameraDetail.iAreasType}' == '1') {
document.getElementById('iDiv').style.visibility = 'visible';
console.log(1)
} else {
document.getElementById('iDiv').style.visibility = 'hidden';
console.log(2)
}
if ('${cameraDetail.vAreasType}' == '1') {
document.getElementById('vDiv').style.visibility = 'visible';
console.log(3)
} else {
document.getElementById('vDiv').style.visibility = 'hidden';
console.log(4)
}
$("#iAreasType").change(function () {
let iAreasType = $("#iAreasType").val();
if (iAreasType == '1') {
document.getElementById('iDiv').style.visibility = 'visible';
} else {
document.getElementById('iDiv').style.visibility = 'hidden';
}
});
$("#vAreasType").change(function () {
let vAreasType = $("#vAreasType").val();
if (vAreasType == '1') {
document.getElementById('vDiv').style.visibility = 'visible';
} else {
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">&times;</span></button>
<h4 class="modal-title">编辑</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm2">
<input type="hidden" id="id" name="id" value ="${cameraDetail.id}">
<input type="hidden" id="cameraid" name="cameraid" value ="${cameraDetail.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" <c:if test="${cameraDetail.status == '1'}"> selected </c:if>>启用</option>
<option value="0" <c:if test="${cameraDetail.status == '0'}"> selected </c:if>>禁用</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();" value ="${cameraDetail.mPoint.parmname}"
readonly>
<input type="hidden" id="pointid" name="pointid" value ="${cameraDetail.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" <c:if test="${cameraDetail.iAreasType == '0'}"> selected </c:if>>否</option>
<option value="1" <c:if test="${cameraDetail.iAreasType == '1'}"> selected </c:if>>是</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" <c:if test="${cameraDetail.vAreasType == '0'}"> selected </c:if>>否</option>
<option value="1" <c:if test="${cameraDetail.vAreasType == '1'}"> selected </c:if>>是</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" onclick="identifyAreasDiv('${cameraDetail.cameraid}')" name="identifyAreas" value="${cameraDetail.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" onclick="visionAreasDiv('${cameraDetail.cameraid}')" name="visionAreas" value="${cameraDetail.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="doUpdateDetail()" id="btn_save">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>