161 lines
5.6 KiB
Plaintext
161 lines
5.6 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">
|
|||
|
|
function doupdate() {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/hqconfig/hqAlarmRecord/doUpdate.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
$(".modal").modal("hide");
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
} else if (data.code == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var confirm = function(id){
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证 备注不能为空的
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
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 + '/hqconfig/hqAlarmRecord/doEditConfirm.do',
|
|||
|
|
{id : id, content: $("#hqAlarmRecordContent").val()}, function(data) {
|
|||
|
|
if(data.code=="1"){
|
|||
|
|
// 关闭这个填写备注的界面
|
|||
|
|
closeModal("subModal");
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','消除失败','mainAlertdiv');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
$(function(){
|
|||
|
|
if('${hqAlarmRecord.remark}' != "") {
|
|||
|
|
$("#btn_save").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
hqAlarmRecordContent: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '备注不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
</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强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" class="form-control" id="id" name ="id" value ="${hqAlarmRecord.id}">
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">报警内容</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input type="text" id="name" name="name" class="form-control pull-right" value ="${hqAlarmRecord.name}" readonly="readonly">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">报警区域</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" id="areaName" name="areaName" class="form-control pull-right" value ="${hqAlarmRecord.areaName}" readonly="readonly">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">风险等级</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" id="riskLevel" name="riskLevel" class="form-control pull-right" value ="${hqAlarmRecord.riskLevel}" readonly="readonly">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">状态</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select type="text" id="state" class="form-control pull-right" name="state" disabled >
|
|||
|
|
<option value="1" <c:if test="${hqAlarmRecord.state==1}"> selected </c:if>>报警中</option>
|
|||
|
|
<option value="2" <c:if test="${hqAlarmRecord.state==2}"> selected</c:if>>已消除</option>
|
|||
|
|
<option value="3" <c:if test="${hqAlarmRecord.state==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" id="hqAlarmRecordContent" name="hqAlarmRecordContent" rows="3"
|
|||
|
|
placeholder="名称">${hqAlarmRecord.remark}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<button type="button" class="btn btn-danger" onclick="confirm('${hqAlarmRecord.id}')" id="btn_save">消除</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|