first commit
This commit is contained in:
173
WebRoot/jsp/alarm/alarmConditionAdd.jsp
Normal file
173
WebRoot/jsp/alarm/alarmConditionAdd.jsp
Normal file
@ -0,0 +1,173 @@
|
||||
<%@ 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 selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm2',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
if($('#mpid').val()==null || $('#mpid').val()==''){
|
||||
swal('请选择测量点');
|
||||
return;
|
||||
}
|
||||
var com = $("input[name='compare']:checked").val();
|
||||
if(com == '1' || com == '-1' || com == '0' ){
|
||||
if($('#val').val() == null || $('#val').val() == ''){
|
||||
swal('请输入数值');
|
||||
$('#val').focus();
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
if($('#lowerlimit').val() == null || $('#lowerlimit').val() == ''){
|
||||
swal('请输入下限数值');
|
||||
$('#lowerlimit').focus();
|
||||
return;
|
||||
}
|
||||
if($('#upperlimit').val() == null || $('#upperlimit').val() == ''){
|
||||
swal('请输入上限数值');
|
||||
$('#upperlimit').focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*$("#subForm2").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
$.post(ext.contextPath + "/alarm/alarmCondition/dosave.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
closeModal('subModal');
|
||||
$("#conditiontable").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
/*}
|
||||
}, 100);*/
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm2").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
//初始化工艺段选择框
|
||||
var refreshSelect = function() {
|
||||
$("#processsectionid").select2({
|
||||
data: null,
|
||||
placeholder:'请先选择厂区',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
});
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$("input[name='compare']").click(function(){
|
||||
var com = $("input[name='compare']:checked").val();
|
||||
if(com=='-1'||com=='1'||com=='0'){
|
||||
$("#val").attr("disabled",false);
|
||||
$("#upperlimit").attr("disabled",'disabled');
|
||||
$("#lowerlimit").attr("disabled",'disabled');
|
||||
$("#val").val('');
|
||||
$("#upperlimit").val('');
|
||||
$("#lowerlimit").val('');
|
||||
}else{
|
||||
$("#upperlimit").attr("disabled",false);
|
||||
$("#lowerlimit").attr("disabled",false);
|
||||
$("#val").attr("disabled","disabled");
|
||||
$("#val").val('');
|
||||
$("#upperlimit").val('');
|
||||
$("#lowerlimit").val('');
|
||||
}
|
||||
});
|
||||
})
|
||||
</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="subForm2">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="alarmtypeid" value="${alarmtypeid}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">测量点编号</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="hidden" class="form-control" style="cursor: pointer" id="mpcode" >
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="mpid" name="mpointid" onclick="selectMPint('')" placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">测量点名称</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="txt" placeholder="测量点名称" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">条件</label>
|
||||
<div class="col-sm-10">
|
||||
<label><input type="radio" name="compare" value="1" checked="checked" />大于</label>
|
||||
<label><input type="radio" name="compare" value="-1" />小于</label>
|
||||
|
||||
<label><input type="radio" name="compare" value="0" />等于</label>
|
||||
|
||||
<label><input type="radio" name="compare" value="2" />范围[a,b]</label>
|
||||
|
||||
<label><input type="radio" name="compare" value="3" />范围[-∞,a],[b,+∞]</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">触发条件</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<label>预警数值 </label><input type="number" id="val" name="val" style="width:80px;">
|
||||
<label>下限 </label><input type="number" name="lowerlimit" id="lowerlimit" style="width:80px;" disabled="disabled"/>
|
||||
<label>上限 </label><input type="number" name="upperlimit" id="upperlimit" style="width:80px;" disabled="disabled"/>
|
||||
</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-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
157
WebRoot/jsp/alarm/alarmConditionEdit.jsp
Normal file
157
WebRoot/jsp/alarm/alarmConditionEdit.jsp
Normal file
@ -0,0 +1,157 @@
|
||||
<%@ 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 selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm2',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
function doupdate() {
|
||||
if($('#mpid').val()==null || $('#mpid').val()==''){
|
||||
swal('请选择测量点');
|
||||
return;
|
||||
}
|
||||
var com = $("input[name='compare']:checked").val();
|
||||
if(com == '1' || com == '-1' || com == '0' ){
|
||||
if($('#val').val() == null || $('#val').val() == ''){
|
||||
swal('请输入数值');
|
||||
$('#val').focus();
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
if($('#lowerlimit').val() == null || $('#lowerlimit').val() == ''){
|
||||
swal('请输入下限数值');
|
||||
$('#lowerlimit').focus();
|
||||
return;
|
||||
}
|
||||
if($('#upperlimit').val() == null || $('#upperlimit').val() == ''){
|
||||
swal('请输入上限数值');
|
||||
$('#upperlimit').focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*$("#subForm2").bootstrapValidator('validate');//提交验证 */
|
||||
/*setTimeout(function(){
|
||||
if ($("#subForm2").data('bootstrapValidator').isValid()) {//*/
|
||||
$.post(ext.contextPath + "/alarm/alarmCondition/update.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
closeModal('subModal');
|
||||
$("#conditiontable").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data.res,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
/* }*/
|
||||
/* }, 100); */
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
/*$("#subForm2").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}); */
|
||||
|
||||
|
||||
$(function(){
|
||||
$("input[name='compare']").click(function(){
|
||||
var com = $("input[name='compare']:checked").val();
|
||||
if(com=='-1'||com=='1'||com=='0'){
|
||||
$("#val").attr("disabled",false);
|
||||
$("#upperlimit").attr("disabled",'disabled');
|
||||
$("#lowerlimit").attr("disabled",'disabled');
|
||||
$("#val").val('');
|
||||
$("#upperlimit").val('');
|
||||
$("#lowerlimit").val('');
|
||||
}else{
|
||||
$("#upperlimit").attr("disabled",false);
|
||||
$("#lowerlimit").attr("disabled",false);
|
||||
$("#val").attr("disabled","disabled");
|
||||
$("#val").val('');
|
||||
$("#upperlimit").val('');
|
||||
$("#lowerlimit").val('');
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</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">编辑KPI测量点</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm2">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="alarmtypeid" value="${alarmCondition.alarmtypeid}">
|
||||
<input type="hidden" name="id" value="${alarmCondition.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*测量点编号</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="hidden" class="form-control" style="cursor: pointer"id="mpcode" >
|
||||
<input type="text" class="form-control" style="cursor: pointer" id="mpid" value="${alarmCondition.mpointid}" name ="mpointid" onclick="selectMPint('')" placeholder="单击选择" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">测量点名称</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" class="form-control" id="txt" value="${alarmCondition.mPoint.parmname}" placeholder="测量点名称" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">条件</label>
|
||||
<div class="col-sm-10">
|
||||
<label><input type="radio" name="compare" value="1" <c:if test="${alarmCondition.compare==1}">checked="checked"</c:if> />大于</label>
|
||||
<label><input type="radio" name="compare" value="-1" <c:if test="${alarmCondition.compare==-1}">checked="checked"</c:if>/>小于</label>
|
||||
|
||||
<label><input type="radio" name="compare" value="0" <c:if test="${alarmCondition.compare==0}">checked="checked"</c:if>/>等于</label>
|
||||
|
||||
<label><input type="radio" name="compare" value="2" <c:if test="${alarmCondition.compare==2}">checked="checked"</c:if>/>范围[a,b]</label>
|
||||
|
||||
<label><input type="radio" name="compare" value="3" <c:if test="${alarmCondition.compare==3}">checked="checked"</c:if>/>范围[-∞,a],[b,+∞]</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">触发条件</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<label>预警数值 </label><input type="number" id="val" name="val" value="${alarmCondition.val}" style="width:80px;" <c:if test="${alarmCondition.compare==2 || alarmCondition.compare==3}">disabled="disabled"</c:if>>
|
||||
<label>下限 </label><input type="number" name="lowerlimit" id="lowerlimit" style="width:80px;" <c:if test="${alarmCondition.compare==0 || alarmCondition.compare==1 || alarmCondition.compare==-1}">disabled="disabled"</c:if> value="${alarmCondition.lowerlimit}" />
|
||||
<label>上限 </label><input type="number" name="upperlimit" id="upperlimit" style="width:80px;" <c:if test="${alarmCondition.compare==0 || alarmCondition.compare==1 || alarmCondition.compare==-1}">disabled="disabled"</c:if> value="${alarmCondition.upperlimit}" />
|
||||
</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-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
192
WebRoot/jsp/alarm/alarmInformationAdd.jsp
Normal file
192
WebRoot/jsp/alarm/alarmInformationAdd.jsp
Normal file
@ -0,0 +1,192 @@
|
||||
<%@ 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(){
|
||||
var alarmMoldCodeEnum=jQuery.parseJSON('${alarmMoldCodeEnum}');
|
||||
var selelct_ = $("#moldCode").select2({
|
||||
data: alarmMoldCodeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
if('${param.nowMoldCode}'!=''){
|
||||
selelct_.val('${param.nowMoldCode}').trigger("change");
|
||||
}else{
|
||||
selelct_.val('').trigger("change");
|
||||
}
|
||||
|
||||
selelct_.on("change", function (e) {
|
||||
var value = $('#moldCode').val();
|
||||
var text = $("#moldCode").find("option:selected").text();
|
||||
var value2 = $('#levelCode').val();
|
||||
var text2 = $("#levelCode").find("option:selected").text();
|
||||
$('#name').val(text+"_"+text2);
|
||||
$('#code').val(value+"_"+value2);
|
||||
});
|
||||
|
||||
var alarmLevelsCodeEnum=jQuery.parseJSON('${alarmLevelsCodeEnum}');
|
||||
var selelct_2 = $("#levelCode").select2({
|
||||
data: alarmLevelsCodeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_2.val('').trigger("change");
|
||||
selelct_2.on("change", function (e) {
|
||||
var value = $('#moldCode').val();
|
||||
var text = $("#moldCode").find("option:selected").text();
|
||||
var value2 = $('#levelCode').val();
|
||||
var text2 = $("#levelCode").find("option:selected").text();
|
||||
$('#name').val(text+"_"+text2);
|
||||
$('#code').val(value+"_"+value2);
|
||||
});
|
||||
|
||||
var alarmInformationAlarmModeEnum=jQuery.parseJSON('${AlarmInformationAlarmModeEnum}');
|
||||
var selelct_3 = $("#alarmMode").select2({
|
||||
data: alarmInformationAlarmModeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_3.val('').trigger("change");
|
||||
// if(alarmInformationAlarmModeEnum!=''){
|
||||
// selelct_3.val(alarmInformationAlarmModeEnum[0].id).trigger("change");
|
||||
// }else{
|
||||
// selelct_3.val('').trigger("change");
|
||||
// }
|
||||
selelct_3.on("change", function (e) {
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmInformation/dosave.do", $("#subForm").serialize()+"&unitId="+unitId, function(data) {
|
||||
if (data.code == 1){
|
||||
informationTree();
|
||||
// closeModal('subModal');
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
moldCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '报警类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
levelCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '报警等级不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#alarmReceivers").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"alarmReceivers",textId:"alarmReceiversName",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>
|
||||
<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">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></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="名称" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*标识</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name ="code" placeholder="标识" readonly>
|
||||
</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="moldCode" name ="moldCode" style="width:170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*报警等级</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="levelCode" name ="levelCode" style="width:170px;"></select>
|
||||
</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="alarmMode" name ="alarmMode" style="width:170px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警接收人</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" style="height: 80px;" class="form-control" id="alarmReceiversName" name ="alarmReceiversName" placeholder="报警接收人" onclick="showUser4SelectsFun();" readonly></textarea>
|
||||
<input id="alarmReceivers" name="alarmReceivers" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
418
WebRoot/jsp/alarm/alarmInformationEdit.jsp
Normal file
418
WebRoot/jsp/alarm/alarmInformationEdit.jsp
Normal file
@ -0,0 +1,418 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@page import="com.sipai.entity.alarm.AlarmPoint"%>
|
||||
<% request.setAttribute("Type_MPoint", AlarmPoint.Type_MPoint);%>
|
||||
<% request.setAttribute("Type_Other", AlarmPoint.Type_Other);%>
|
||||
|
||||
<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(){
|
||||
var alarmMoldCodeEnum=jQuery.parseJSON('${alarmMoldCodeEnum}');
|
||||
var selelct_ = $("#moldCode").select2({
|
||||
data: alarmMoldCodeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${alarmInformation.moldCode}').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
var value = $('#moldCode').val();
|
||||
var text = $("#moldCode").find("option:selected").text();
|
||||
var value2 = $('#levelCode').val();
|
||||
var text2 = $("#levelCode").find("option:selected").text();
|
||||
$('#name').val(text+"_"+text2);
|
||||
$('#code').val(value+"_"+value2);
|
||||
});
|
||||
|
||||
var alarmLevelsCodeEnum=jQuery.parseJSON('${alarmLevelsCodeEnum}');
|
||||
var selelct_2 = $("#levelCode").select2({
|
||||
data: alarmLevelsCodeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_2.val('${alarmInformation.levelCode}').trigger("change");
|
||||
selelct_2.on("change", function (e) {
|
||||
var value = $('#moldCode').val();
|
||||
var text = $("#moldCode").find("option:selected").text();
|
||||
var value2 = $('#levelCode').val();
|
||||
var text2 = $("#levelCode").find("option:selected").text();
|
||||
$('#name').val(text+"_"+text2);
|
||||
$('#code').val(value+"_"+value2);
|
||||
});
|
||||
|
||||
var alarmInformationAlarmModeEnum=jQuery.parseJSON('${AlarmInformationAlarmModeEnum}');
|
||||
var selelct_3 = $("#alarmMode").select2({
|
||||
data: alarmInformationAlarmModeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_3.val('${alarmInformation.alarmMode}').trigger("change");
|
||||
selelct_3.on("change", function (e) {
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function doMainSave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmInformation/doupdate.do", $("#subForm").serialize()+"&oldCode=${alarmInformation.code}&unitId="+unitId, function(data) {
|
||||
if (data.code == 1){
|
||||
// closeModal('subModal');
|
||||
informationTree();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
// showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
moldCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '报警类型不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
levelCode: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '报警等级不能为空'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#alarmReceivers").val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:"alarmReceivers",textId:"alarmReceiversName",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
var dodel = 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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/dodelete.do', {id : '${alarmInformation.id}'}, function(data) {
|
||||
if(data.code==1){
|
||||
informationTree();
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$("#pointTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmPoint/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId:unitId,
|
||||
informationCode:'${alarmInformation.code}'
|
||||
}
|
||||
},
|
||||
sortName: 'alarm_point', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'alarmPointName', // 返回json数据中的name
|
||||
title: '报警点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'alarmPoint', // 返回json数据中的name
|
||||
title: '点位名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if(row.type=='${Type_MPoint}'){
|
||||
buts += '<security:authorize buttonUrl="alarm/alarmInformation/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editMpPointFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||
buts += '</security:authorize>';
|
||||
}
|
||||
buts += '<security:authorize buttonUrl="alarm/alarmInformation/dodel.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deletePointFun(\'' + 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("pointTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var addMpPointFun = function() {
|
||||
$.post(ext.contextPath + '/alarm/alarmPoint/doMPointadd.do', {informationCodeMp:'${alarmInformation.code}',addType:'${Type_MPoint}'} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editMpPointFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/alarm/alarmPoint/doMPointedit.do', {id:id,unitId:unitId} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var deletePointFun = 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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmPoint/dodelete.do', {id : id}, function(data) {
|
||||
if(data.code==1){
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletePointFuns = function(id) {
|
||||
var checkedItems = $("#pointTable").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 + '/alarm/alarmPoint/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function addOwnPoint(){
|
||||
$.post(ext.contextPath + '/alarm/alarmPoint/addOwnPoint.do', {unitId:unitId,addType:'${Type_Other}',informationCode:'${alarmInformation.code}'} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</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="doMainSave()" 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="${alarmInformation.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></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="${alarmInformation.name}" readonly>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*标识</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code" name ="code" placeholder="标识" value="${alarmInformation.code}" readonly>
|
||||
</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="moldCode" name ="moldCode" style="width:170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*报警等级</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="levelCode" name ="levelCode" style="width:170px;"></select>
|
||||
</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="alarmMode" name ="alarmMode" style="width:170px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警接收人</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" style="height: 80px;" class="form-control" id="alarmReceiversName" name ="alarmReceiversName" placeholder="报警接收人" onclick="showUser4SelectsFun();" readonly>${alarmInformation.alarmReceiversName}</textarea>
|
||||
<input id="alarmReceivers" name="alarmReceivers" type="hidden" value="${alarmInformation.alarmReceivers}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">数据点配置</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div >
|
||||
<div class="btn-group" style="width: 320px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default" onclick="addMpPointFun();"><i class="fa fa-plus"></i> 新增测量点</button>
|
||||
<%-- <c:if test="${alarmInformation.moldCode}==Type_ZNPD">--%>
|
||||
<button type="button" class="btn btn-default" onclick="addOwnPoint();"><i class="fa fa-plus"></i> 新增自定义点</button>
|
||||
<%-- </c:if>--%>
|
||||
<button type="button" class="btn btn-default" onclick="deletePointFuns();"><i class="fa fa-trash-o"></i> 删除</button>
|
||||
</div>
|
||||
<br>
|
||||
<table id="pointTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
274
WebRoot/jsp/alarm/alarmInformationList.jsp
Normal file
274
WebRoot/jsp/alarm/alarmInformationList.jsp
Normal file
@ -0,0 +1,274 @@
|
||||
<%@ 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() {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/doadd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addFuns = function() {
|
||||
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 + '/alarm/alarmInformation/dofirstsave.do',{unitId:unitId}, function(data) {
|
||||
if(data.code>=1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/doedit.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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/dodelete.do', {id : id}, function(data) {
|
||||
if(data.code==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/alarm/alarmInformation/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmInformation/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,
|
||||
unitId:unitId,
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'code', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '标识', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'alarmModeName', // 返回json数据中的name
|
||||
title: '报警方式', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'alarmReceiversName', // 返回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="alarm/alarmInformation/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="alarm/alarmInformation/dodel.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 id="user4SelectDiv"></div>
|
||||
<div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<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="addFuns();"><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>
|
||||
</div>
|
||||
<br>
|
||||
<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>
|
||||
100
WebRoot/jsp/alarm/alarmLevelsAdd.jsp
Normal file
100
WebRoot/jsp/alarm/alarmLevelsAdd.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@ 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(){
|
||||
var alarmLevelsEnum=jQuery.parseJSON('${alarmLevelsCodeEnum}');
|
||||
var selelct_ = $("#code").select2({
|
||||
data: alarmLevelsEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
// selelct_.on("change", function (e) {
|
||||
// var value = $(this).val();
|
||||
// });
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmLevels/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
code: {
|
||||
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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="code" name ="code" style="width:170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="排序" value="0">
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
146
WebRoot/jsp/alarm/alarmLevelsConfigAdd.jsp
Normal file
146
WebRoot/jsp/alarm/alarmLevelsConfigAdd.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ 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(){
|
||||
$('#colorContainer').colorpicker({format: null});
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/config/doSave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d', data.msg);
|
||||
}else{
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
upperLimit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险度上限'
|
||||
}
|
||||
}
|
||||
},lowerLimit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险度下限'
|
||||
}
|
||||
}
|
||||
},level: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险等级'
|
||||
}
|
||||
}
|
||||
},color: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '颜色'
|
||||
}
|
||||
}
|
||||
},fraction: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '扣分数'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*风险度下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="lowerLimit" name ="lowerLimit"></input>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*风险度上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="upperLimit" name ="upperLimit"></input>
|
||||
</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="level" name="level">
|
||||
<option value="A">A</option>
|
||||
<option value="B">B</option>
|
||||
<option value="C">C</option>
|
||||
<option value="D">D</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*颜色</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group " id="colorContainer">
|
||||
<input name="color" type="text" class="form-control">
|
||||
<div class="input-group-addon">
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*扣分数</label>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<input type="number"
|
||||
oninput="if(value>100)value=100;if(value.length>4)value=value.slice(0,4);if(value<0)value=0"
|
||||
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
|
||||
οnkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
|
||||
onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}"
|
||||
max="100" min="1" class="form-control" id="fraction" name ="fraction" placeholder="扣分数" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea maxlength="200" class="form-control select2" id="remark" name ="remark" style="width:100%;"></textarea>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
148
WebRoot/jsp/alarm/alarmLevelsConfigEdit.jsp
Normal file
148
WebRoot/jsp/alarm/alarmLevelsConfigEdit.jsp
Normal file
@ -0,0 +1,148 @@
|
||||
<%@ 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(){
|
||||
$('#colorContainer').colorpicker({format: null});
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/config/doUpdate.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','更新成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d', data.msg);
|
||||
}else{
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
upperLimit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险度上限'
|
||||
}
|
||||
}
|
||||
},lowerLimit: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险度下限'
|
||||
}
|
||||
}
|
||||
},level: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险等级'
|
||||
}
|
||||
}
|
||||
},color: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '颜色'
|
||||
}
|
||||
}
|
||||
},fraction: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '扣分数'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<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="subForm">
|
||||
<input id="id" name="id" type="hidden" value="${alarmLevelsConfig.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*风险度下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="lowerLimit" name ="lowerLimit" value="${alarmLevelsConfig.lowerLimit}"></input>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*风险度上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input class="form-control" id="upperLimit" name ="upperLimit" value="${alarmLevelsConfig.upperLimit}"></input>
|
||||
</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="level" name="level">
|
||||
<option value="A" <c:if test="${alarmLevelsConfig.level=='A'}"> selected</c:if>>A</option>
|
||||
<option value="B" <c:if test="${alarmLevelsConfig.level=='B'}"> selected</c:if>>B</option>
|
||||
<option value="C" <c:if test="${alarmLevelsConfig.level=='C'}"> selected</c:if>>C</option>
|
||||
<option value="D" <c:if test="${alarmLevelsConfig.level=='D'}"> selected</c:if>>D</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*颜色</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group " id="colorContainer">
|
||||
<input name="color" type="text" class="form-control" value="${alarmLevelsConfig.color}">
|
||||
<div class="input-group-addon">
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*扣分数</label>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<input type="number"
|
||||
value="${alarmLevelsConfig.fraction}"
|
||||
oninput="if(value>100)value=100;if(value.length>4)value=value.slice(0,4);if(value<0)value=0"
|
||||
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
|
||||
οnkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
|
||||
onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'0')}else{this.value=this.value.replace(/\D/g,'')}"
|
||||
max="100" min="1" class="form-control" id="fraction" name ="fraction" placeholder="扣分数" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea maxlength="200" class="form-control select2" id="remark" name ="remark" style="width:100%;">${alarmLevelsConfig.remark}</textarea>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
290
WebRoot/jsp/alarm/alarmLevelsConfigList.jsp
Normal file
290
WebRoot/jsp/alarm/alarmLevelsConfigList.jsp
Normal file
@ -0,0 +1,290 @@
|
||||
<%@ 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>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<!-- 颜色选择器-->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css"
|
||||
type="text/css" rel="stylesheet"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"
|
||||
charset="utf-8"></script>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/alarm/config/doAdd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addFuns = function() {
|
||||
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 + '/alarm/config/dofirstsave.do', function(data) {
|
||||
if(data.code>=1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/alarm/config/doEdit.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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/config/dodel.do', {id : id}, function(data) {
|
||||
if(data.code==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/alarm/config/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/config/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
}
|
||||
},
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'code', // 返回json数据中的name
|
||||
title: '序号', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'limit', // 返回json数据中的name
|
||||
title: '风险度', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'level', // 返回json数据中的name
|
||||
title: '风险等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'color', // 返回json数据中的name
|
||||
title: '风险颜色', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
var color = '#357ca5';
|
||||
if (row.color != '') {
|
||||
color = row.color;
|
||||
}
|
||||
return '<button class="btn btn-default " style="background-color:' + color + '"> </button>';
|
||||
}
|
||||
},{
|
||||
field: 'fraction', // 返回json数据中的name
|
||||
title: '扣分数', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},{
|
||||
field: 'remark', // 返回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="alarm/alarmLevels/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="alarm/alarmLevels/dodel.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;">
|
||||
<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>
|
||||
</div>
|
||||
<br>
|
||||
<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>
|
||||
101
WebRoot/jsp/alarm/alarmLevelsEdit.jsp
Normal file
101
WebRoot/jsp/alarm/alarmLevelsEdit.jsp
Normal file
@ -0,0 +1,101 @@
|
||||
<%@ 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(){
|
||||
var alarmLevelsEnum=jQuery.parseJSON('${alarmLevelsCodeEnum}');
|
||||
var selelct_ = $("#code").select2({
|
||||
data: alarmLevelsEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${alarmLevels.code}').trigger("change");
|
||||
// selelct_.on("change", function (e) {
|
||||
// var value = $(this).val();
|
||||
// });
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmLevels/doupdate.do", $("#subForm").serialize()+"&oldCode=${alarmLevels.code}", function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
code: {
|
||||
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">
|
||||
<input id="id" name="id" type="hidden" value="${alarmLevels.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="code" name ="code" style="width:170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="排序" value="${alarmLevels.morder}" >
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
260
WebRoot/jsp/alarm/alarmLevelsList.jsp
Normal file
260
WebRoot/jsp/alarm/alarmLevelsList.jsp
Normal file
@ -0,0 +1,260 @@
|
||||
<%@ 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() {
|
||||
$.post(ext.contextPath + '/alarm/alarmLevels/doadd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addFuns = function() {
|
||||
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 + '/alarm/alarmLevels/dofirstsave.do', function(data) {
|
||||
if(data.code>=1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/alarm/alarmLevels/doedit.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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmLevels/dodelete.do', {id : id}, function(data) {
|
||||
if(data.code==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/alarm/alarmLevels/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmLevels/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: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'code', // 返回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="alarm/alarmLevels/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="alarm/alarmLevels/dodel.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;">
|
||||
<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="addFuns();"><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>
|
||||
</div>
|
||||
<br>
|
||||
<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>
|
||||
107
WebRoot/jsp/alarm/alarmMoldAdd.jsp
Normal file
107
WebRoot/jsp/alarm/alarmMoldAdd.jsp
Normal file
@ -0,0 +1,107 @@
|
||||
<%@ 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(){
|
||||
var alarmMoldEnum=jQuery.parseJSON('${alarmMoldCodeEnum}');
|
||||
var selelct_ = $("#code").select2({
|
||||
data: alarmMoldEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
var value = $(this).val();
|
||||
$('#code2').val(value);
|
||||
});
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmMold/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
code: {
|
||||
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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="code" name ="code" style="width:170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*标识</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code2" name ="code2" placeholder="标识" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="排序" value="0">
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
111
WebRoot/jsp/alarm/alarmMoldAdds.jsp
Normal file
111
WebRoot/jsp/alarm/alarmMoldAdds.jsp
Normal file
@ -0,0 +1,111 @@
|
||||
<%@ 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(){
|
||||
$("#adds_table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmMold/getAlarmMoldCodeEnumJson.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'client', // 设置为服务器端分页
|
||||
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: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '标识', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
var checkedItems = $("#adds_table").bootstrapTable('getSelections');
|
||||
var ids="";
|
||||
var names="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
ids+=item.id+",";
|
||||
names+=item.name+",";
|
||||
});
|
||||
if(ids==""){
|
||||
showAlert('d','请先选择记录','addsAlertdiv');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/alarm/alarmMold/dosaves.do', {ids:ids,names:names} , function(data) {
|
||||
// console.log(data);
|
||||
if(data.code==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
}else{
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
closeModal('subModal');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
</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">
|
||||
<div id="addsAlertdiv"></div>
|
||||
<table id="adds_table"></table>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
108
WebRoot/jsp/alarm/alarmMoldEdit.jsp
Normal file
108
WebRoot/jsp/alarm/alarmMoldEdit.jsp
Normal file
@ -0,0 +1,108 @@
|
||||
<%@ 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(){
|
||||
var alarmMoldEnum=jQuery.parseJSON('${alarmMoldCodeEnum}');
|
||||
var selelct_ = $("#code").select2({
|
||||
data: alarmMoldEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${alarmMold.code}').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
var value = $(this).val();
|
||||
$('#code2').val(value);
|
||||
});
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmMold/doupdate.do", $("#subForm").serialize()+"&oldCode=${alarmMold.code}", function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
code: {
|
||||
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">
|
||||
<input id="id" name="id" type="hidden" value="${alarmMold.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*名称</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="code" name ="code" style="width:170px;"></select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*标识</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="code2" name ="code2" placeholder="标识" value="${alarmMold.code}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="morder" name ="morder" placeholder="排序" value="${alarmMold.morder}" >
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
233
WebRoot/jsp/alarm/alarmMoldList.jsp
Normal file
233
WebRoot/jsp/alarm/alarmMoldList.jsp
Normal file
@ -0,0 +1,233 @@
|
||||
<%@ 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() {
|
||||
$.post(ext.contextPath + '/alarm/alarmMold/doadd.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addFuns = function() {
|
||||
$.post(ext.contextPath + '/alarm/alarmMold/doadds.do', {} , function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
stopBubbleDefaultEvent();
|
||||
$.post(ext.contextPath + '/alarm/alarmMold/doedit.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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmMold/dodelete.do', {id : id}, function(data) {
|
||||
if(data.code==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/alarm/alarmMold/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmMold/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: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'code', // 返回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="alarm/alarmMold/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="alarm/alarmMold/dodel.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;">
|
||||
<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="addFuns();"><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>
|
||||
</div>
|
||||
<br>
|
||||
<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>
|
||||
181
WebRoot/jsp/alarm/alarmPersonalSubscribePointList.jsp
Normal file
181
WebRoot/jsp/alarm/alarmPersonalSubscribePointList.jsp
Normal file
@ -0,0 +1,181 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.entity.alarm.AlarmPoint" %>
|
||||
<% request.setAttribute("Type_MPoint", AlarmPoint.Type_MPoint);%>
|
||||
|
||||
<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 () {
|
||||
$("#pointTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmPoint/getlistForSubscribePersonal.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: unitId,
|
||||
moldCode:'${param.moldCode}',
|
||||
levelCode:'${param.levelCode}'
|
||||
}
|
||||
},
|
||||
sortName: 'mold_code', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'alarmPointName', // 返回json数据中的name
|
||||
title: '报警点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="订阅" onclick="deletePointFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">订阅</span></button';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("pointTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
var deletePointFun = 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(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmSubscribe/dodelete.do', {id: id}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var deletePointFuns = function() {
|
||||
var checkedItems = $("#pointTable").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 + '/alarm/alarmSubscribe/dodeletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<!-- /.box-header -->
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">报警点列表</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<%-- <button type="button" class="btn btn-default" onclick="addMpPointFun();"><i class="fa fa-plus"></i>--%>
|
||||
<%-- 新增测量点--%>
|
||||
<%-- </button>--%>
|
||||
<button type="button" class="btn btn-default" onclick="deletePointFuns();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<br>
|
||||
<table id="pointTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
223
WebRoot/jsp/alarm/alarmPointAddForMPoint.jsp
Normal file
223
WebRoot/jsp/alarm/alarmPointAddForMPoint.jsp
Normal file
@ -0,0 +1,223 @@
|
||||
<%@ 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(){
|
||||
<%--var alarmInformationJson=jQuery.parseJSON('${alarmInformationJson}');--%>
|
||||
<%--var selelct_ = $("#informationCode").select2({--%>
|
||||
<%-- data: alarmInformationJson,--%>
|
||||
<%-- cache: false,--%>
|
||||
<%-- placeholder: '请选择',//默认文字提示--%>
|
||||
<%-- allowClear: false,//允许清空--%>
|
||||
<%-- escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入--%>
|
||||
<%-- language: "zh-CN",--%>
|
||||
<%-- minimumInputLength: 0,--%>
|
||||
<%-- minimumResultsForSearch: 10,//数据超过十个启用搜索框--%>
|
||||
<%-- formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果--%>
|
||||
<%-- formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择--%>
|
||||
<%--});--%>
|
||||
<%--if(alarmInformationJson!=''){--%>
|
||||
<%-- selelct_.val(alarmInformationJson[0].id).trigger("change");--%>
|
||||
<%--}else{--%>
|
||||
<%-- selelct_.val('').trigger("change");--%>
|
||||
<%--}--%>
|
||||
|
||||
// selelct_.on("change", function (e) {
|
||||
// var value = $(this).val();
|
||||
// });
|
||||
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:unitId},function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
$("#addMPoint_table").bootstrapTable('refresh');
|
||||
});
|
||||
}, 'json');
|
||||
})
|
||||
|
||||
function dosearch(){
|
||||
$("#addMPoint_table").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#addMPoint_table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/mpoint/getAlarmMPointList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
companyId:unitId,
|
||||
triggerAlarm: $("#triggerAlarm").val(),
|
||||
signalType: $("#signalType").val(),
|
||||
pSectionId: $("#processSection").val(),
|
||||
search_name: $('#search_name').val()
|
||||
}
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'parmname', // 返回json数据中的name
|
||||
title: '测量点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'mpointcode', // 返回json数据中的name
|
||||
title: '测量点标识', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'parmvalue', // 返回json数据中的name
|
||||
title: '最新值', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'measuredt', // 返回json数据中的name
|
||||
title: '最新时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,16);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'unit', // 返回json数据中的name
|
||||
title: '单位', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("addMPoint_table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function dosave() {
|
||||
var checkedItems = $("#addMPoint_table").bootstrapTable('getSelections');
|
||||
var ids="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
ids+=item.id+",";
|
||||
});
|
||||
if(ids==""){
|
||||
showAlert('d','请先选择记录','addsAlertdiv');
|
||||
}else{
|
||||
var informationCode=$('#informationCodeMp').val();
|
||||
$.post(ext.contextPath + '/alarm/alarmPoint/doMPointSaves.do', {ids:ids,informationCode:informationCode,type:'${param.addType}',unitId:unitId} , function(data) {
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog" style="width: 1200px;">
|
||||
<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="addsAlertdiv"></div>
|
||||
<input id="informationCodeMp" name="informationCodeMp" type="hidden" value="${param.informationCodeMp}" />
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="form-group pull-left">
|
||||
<%-- <div class="input-group input-group-sm " style="width: 240px;">--%>
|
||||
<%-- <label class="control-label" style="float:left;width:25%;line-height: 30px;padding: 0px;">信息标识</label>--%>
|
||||
<%-- <div class="control-label" style="float:left;width:75%;">--%>
|
||||
<%-- <select class="form-control select2 " id="informationCode" name ="informationCode" style="width: 100%;" ></select>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div class="form-group pull-right">
|
||||
<div class="input-group input-group-sm " style="width: 140px;">
|
||||
<label class="control-label" style="float:left;width:45%;line-height: 30px;padding: 0px;">查询内容</label>
|
||||
<div class="control-label" style="float:left;width:55%;" >
|
||||
<select id ="triggerAlarm" name="triggerAlarm" class="form-control select2" style="width:100%;padding: 0px;height: 30px;border-radius:4px;border:1px solid #aaa;" onchange="dosearch();">
|
||||
<option value="-1" >全部</option>
|
||||
<option value="1" >预设值</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 120px;">
|
||||
<label class="control-label" style="float:left;width:30%;line-height: 30px;padding: 0px;">信号</label>
|
||||
<div class="control-label" style="float:left;width:70%;">
|
||||
<select id ="signalType" name="signalType" class="form-control select2" style="width:100%;padding: 0px;height: 30px;border-radius:4px;border:1px solid #aaa;" onchange="dosearch();">
|
||||
<option value="-1" >全部</option>
|
||||
<option value="AI" >AI</option>
|
||||
<option value="DI" >DI</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 200px;">
|
||||
<label class="control-label" style="float:left;width:25%;line-height: 30px;padding: 0px;">工艺段</label>
|
||||
<div class="control-label" style="float:left;width:75%;">
|
||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 100%;" ></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 180px;padding-right: 5px;">
|
||||
<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>
|
||||
<br>
|
||||
<table id="addMPoint_table"></table>
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
326
WebRoot/jsp/alarm/alarmPointEditForMPoint.jsp
Normal file
326
WebRoot/jsp/alarm/alarmPointEditForMPoint.jsp
Normal file
@ -0,0 +1,326 @@
|
||||
<%@ 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.alarm.AlarmMoldCodeEnum" %>
|
||||
<% request.setAttribute("LimitValue_Pro", AlarmMoldCodeEnum.LimitValue_Pro.getKey());%>
|
||||
<% request.setAttribute("ValueMutation_Pro", AlarmMoldCodeEnum.ValueMutation_Pro.getKey());%>
|
||||
|
||||
<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 () {
|
||||
var alarmInformationJson = jQuery.parseJSON('${alarmInformationJson}');
|
||||
var selelct_ = $("#informationCode").select2({
|
||||
data: alarmInformationJson,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${alarmPoint.informationCode}').trigger("change");
|
||||
// selelct_.on("change", function (e) {
|
||||
// var value = $(this).val();
|
||||
// });
|
||||
if (1 == '${alarmConfigType}') {
|
||||
$('#levelTable').show()
|
||||
// 获取 任务计划关联的风险等级评估项 的表格
|
||||
$("#table_patrolRiskLevel").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmPointRiskLevel/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
pid: '${alarmPoint.id}'
|
||||
}
|
||||
},
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '安全项内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.riskLevel.securitycontent;
|
||||
}
|
||||
}, {
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '安全检测类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.riskLevel.safetyinspectionname
|
||||
// if (row.riskLevel.safetyinspection == "1")
|
||||
// return "实时报警";
|
||||
// else if (row.riskLevel.safetyinspection == "2")
|
||||
// return "任务超时报警";
|
||||
// else if (row.riskLevel.safetyinspection == "3")
|
||||
// return "任务不合格报警";
|
||||
}
|
||||
}, {
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '风险等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
// return row.riskLevel.risklevel;
|
||||
if (row.riskLevel.alarmLevelsConfig != null) {
|
||||
return row.riskLevel.alarmLevelsConfig.level;
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'id', // 返回json数据中的name
|
||||
title: '区域', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.areaText;
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '16%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="edit_RiskLevelFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-edit "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="delete_RiskLevelFun(\'' + row.id + '\')" data-toggle="tooltip" title="删除"><i class="fa fa-trash-o "></i><span class="hidden-md hidden-lg"> 删除</span></button>';
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("table_patrolRiskLevel 加载数据成功!!!");
|
||||
adjustBootstrapTableView("table_patrolRiskLevel");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
console.log("table_patrolRiskLevel 加载数据失败");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$('#levelTable').hide()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
function dosaveD() {
|
||||
$("#subFormD").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#subFormD").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmPoint/doupdate.do", $("#subFormD").serialize() + "&unitId=" + unitId, function (data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('subModal');
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', data.msg);
|
||||
} else {
|
||||
showAlert('d', data.msg);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
var selectMPint = function () {
|
||||
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {
|
||||
formId: 'subFormD',
|
||||
hiddenId: 'alarmPoint',
|
||||
textId: 'alarmPointName'
|
||||
}, function (data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
function doAdd_RiskLevel() {
|
||||
$.post(ext.contextPath + '/alarm/alarmPointRiskLevel/add.do', {alarmpointId: '${alarmPoint.id}'}, function (data) {
|
||||
$("#riskLevelDiv").html(data);
|
||||
openModal('riskLevelModal');
|
||||
});
|
||||
}
|
||||
function edit_RiskLevelFun(id) {
|
||||
$.post(ext.contextPath + '/alarm/alarmPointRiskLevel/edit.do', {id: id}, function (data) {
|
||||
$("#riskLevelDiv").html(data);
|
||||
openModal('riskLevelEditModal');
|
||||
});
|
||||
}
|
||||
|
||||
var delete_RiskLevelFun = 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(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmPointRiskLevel/dodel.do', {id : id}, function(data) {
|
||||
if(data.code==1){
|
||||
$("#table_patrolRiskLevel").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
</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="subFormD">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${alarmPoint.id}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*报警点</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="alarmPointName" name="alarmPointName"
|
||||
placeholder="报警点" onclick="selectMPint();" value="${alarmPoint.alarmPointName}"
|
||||
readonly>
|
||||
<input type="hidden" id="alarmPoint" name="alarmPoint" value="${alarmPoint.alarmPoint}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*信息标识</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="informationCode" name="informationCode"
|
||||
style="width:170px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${fn:contains(alarmPoint.informationCode,ValueMutation_Pro)}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">基础值</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="baseValue" name="baseValue"
|
||||
placeholder="基础值" value="${alarmPoint.baseValue}">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${fn:contains(alarmPoint.informationCode,LimitValue_Pro)}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">上限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="alarmmax" name="alarmmax" placeholder="上限"
|
||||
value="${alarmPoint.mPoint.alarmmax}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">下限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="alarmmin" name="alarmmin" placeholder="下限"
|
||||
value="${alarmPoint.mPoint.alarmmin}">
|
||||
</div>
|
||||
</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="halarmmax" name="halarmmax"
|
||||
placeholder="上极限" value="${alarmPoint.mPoint.halarmmax}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">下极限</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="lalarmmin" name="lalarmmin"
|
||||
placeholder="下极限" value="${alarmPoint.mPoint.lalarmmin}">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-body" id="levelTable">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title" style="font-size: 15px">关联风险等级评估</h4>
|
||||
<div class="box-tools pull-right">
|
||||
<a onclick="doAdd_RiskLevel()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i
|
||||
class="fa fa-plus"></i></a>
|
||||
<%-- <a onclick="doDelete_RiskLevel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i--%>
|
||||
<%-- class="fa fa-minus"></i></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_patrolRiskLevel"></table>
|
||||
</div>
|
||||
</div>
|
||||
</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="dosaveD()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
100
WebRoot/jsp/alarm/alarmPointEditForOwnPoint.jsp
Normal file
100
WebRoot/jsp/alarm/alarmPointEditForOwnPoint.jsp
Normal file
@ -0,0 +1,100 @@
|
||||
<%@ 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(){
|
||||
var alarmInformationJson=jQuery.parseJSON('${alarmInformationJson}');
|
||||
var selelct_ = $("#informationCode").select2({
|
||||
data: alarmInformationJson,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('${param.informationCode}').trigger("change");
|
||||
// selelct_.on("change", function (e) {
|
||||
// var value = $(this).val();
|
||||
// });
|
||||
})
|
||||
|
||||
function doOwnPointsave() {
|
||||
$("#owmPointsubForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#owmPointsubForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/alarmPoint/dosave.do", $("#owmPointsubForm").serialize()+"&unitId="+unitId+"&type=${param.addType}", function(data) {
|
||||
if (data.code == 1){
|
||||
closeModal('subModal');
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
// showAlert('s','保存成功');
|
||||
}else if(data.code == 0){
|
||||
showAlert('d',data.msg);
|
||||
}else{
|
||||
showAlert('d',data.msg);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#owmPointsubForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
alarmPoint: {
|
||||
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强制为owmPointsubForm -->
|
||||
<form class="form-horizontal" id="owmPointsubForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></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="alarmPoint" name ="alarmPoint" placeholder="报警点" value="${alarmPoint.alarmPoint}" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*信息标识</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="informationCode" name ="informationCode" style="width:170px;"></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="doOwnPointsave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
167
WebRoot/jsp/alarm/alarmPointList.jsp
Normal file
167
WebRoot/jsp/alarm/alarmPointList.jsp
Normal file
@ -0,0 +1,167 @@
|
||||
<%@ 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.alarm.AlarmPoint"%>
|
||||
<% request.setAttribute("Type_MPoint", AlarmPoint.Type_MPoint);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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 addFuns = function() {
|
||||
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 + '/alarm/alarmInformation/dofirstsave.do',{unitId:unitId}, function(data) {
|
||||
if(data.code>=1){
|
||||
// $("#table").bootstrapTable('refresh');
|
||||
informationTree();
|
||||
}else{
|
||||
showAlert('d',data.msg,'mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var nowMoldCode="";
|
||||
function informationTree(){
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/getJsonForConfigure.do', {unitId:unitId} , function(datas) {
|
||||
// console.log(datas)
|
||||
$('#informationTree').treeview({
|
||||
data: datas,
|
||||
levels: 1
|
||||
});
|
||||
$('#informationTree').on('nodeSelected', function(event, data) {
|
||||
nowMoldCode=data.moldCode;
|
||||
// console.log(data);
|
||||
if(data.type=='level'){
|
||||
editFun(data.hiddenId);
|
||||
}
|
||||
});
|
||||
},'json');
|
||||
$("#rightBox").html("");
|
||||
}
|
||||
|
||||
$(function () {
|
||||
informationTree();
|
||||
});
|
||||
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/doadd.do',{nowMoldCode:nowMoldCode}, function(data) {
|
||||
$("#rightBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/doedit.do', {id:id} , function(data) {
|
||||
$("#rightBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
</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 id="riskLevelDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="areaSubDiv"></div>
|
||||
<div style="height: 100%;">
|
||||
<div id="leftBox" class="col-md-3" style="height: 750px;">
|
||||
<div class="box box-solid" style="height:100%;">
|
||||
<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();" title="新增"><i class="fa fa-plus"> 新增</i></button>
|
||||
<button type="button" class="btn btn-box-tool" onclick="addFuns();" title="期初新增"><i class="fa fa-plus"> 期初新增</i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="informationTree" style="height:100%;overflow:auto;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
<div id="rightBox" class="col-md-9" >
|
||||
<%-- <div style="float: left;width: 100%;" >--%>
|
||||
<%-- <div class="box box-solid">--%>
|
||||
<%-- <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>--%>
|
||||
<%-- <a onclick="dodel()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-trash"></i></a>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- <div class="box-body ">--%>
|
||||
<%-- --%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<jsp:include page="/jsp/side.jsp"></jsp:include>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
161
WebRoot/jsp/alarm/alarmPointListForSubscribe.jsp
Normal file
161
WebRoot/jsp/alarm/alarmPointListForSubscribe.jsp
Normal file
@ -0,0 +1,161 @@
|
||||
<%@ 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.alarm.AlarmPoint" %>
|
||||
<% request.setAttribute("Type_MPoint", AlarmPoint.Type_MPoint);%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<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 informationTree() {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/getJsonForSysSubscribe.do', {unitId: unitId}, function (datas) {
|
||||
// console.log(datas)
|
||||
$('#informationTree').treeview({
|
||||
data: datas,
|
||||
levels: 1
|
||||
});
|
||||
$('#informationTree').on('nodeSelected', function (event, data) {
|
||||
// console.log(data);
|
||||
if (data.type == 'level') {
|
||||
showSysPoint(data.code);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
$("#rightBox").html("");
|
||||
}
|
||||
|
||||
function personalInformationTree() {
|
||||
$.post(ext.contextPath + '/alarm/alarmInformation/getJsonForPersonalSubscribe.do', {unitId: unitId}, function (datas) {
|
||||
// console.log("c",datas)
|
||||
$('#personalLnformationTree').treeview({
|
||||
data: datas,
|
||||
levels: 1
|
||||
});
|
||||
$('#personalLnformationTree').on('nodeSelected', function (event, data) {
|
||||
// console.log(data);
|
||||
if (data.type == 'level') {
|
||||
// console.log(data);
|
||||
showPersonalPoint(data.moldCode,data.levelCode);
|
||||
}
|
||||
});
|
||||
}, 'json');
|
||||
$("#rightBox").html("");
|
||||
}
|
||||
|
||||
$(function () {
|
||||
informationTree();
|
||||
personalInformationTree();
|
||||
});
|
||||
|
||||
var addPersonalFun = function () {
|
||||
$.post(ext.contextPath + '/alarm/alarmSubscribe/doadd.do', function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var showSysPoint = function (code) {
|
||||
$.post(ext.contextPath + '/alarm/alarmSubscribe/showSysPoint.do', {code: code}, function (data) {
|
||||
$("#rightBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
var showPersonalPoint = function (moldCode,levelCode) {
|
||||
$.post(ext.contextPath + '/alarm/alarmSubscribe/showPersonalPoint.do', {moldCode: moldCode,levelCode :levelCode}, function (data) {
|
||||
$("#rightBox").html(data);
|
||||
});
|
||||
};
|
||||
|
||||
</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 id="mpSubDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div id="leftBox" class="col-md-3" style="height: 750px;">
|
||||
<div class="box box-solid" style="height:100%;margin-bottom:0px;overflow: auto;overflow-x: hidden;">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li class="active"><a href="#tab1" data-toggle="tab"
|
||||
index="0" aria-expanded="true">系统订阅</a></li>
|
||||
<li class=""><a href="#tab2" data-toggle="tab" index="1"
|
||||
aria-expanded="true">个人订阅</a></li>
|
||||
</ul>
|
||||
<div class="tab-content no-padding">
|
||||
<div class="chart tab-pane active" id="tab1" style="position: relative; padding:5px;">
|
||||
<div class="box-header with-border">
|
||||
<%-- <h3 class="box-title"> </h3>--%>
|
||||
<div class="box-tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="informationTree" style="height:100%;overflow:auto;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<div class=" tab-pane" id="tab2" style="position: relative; padding:5px;">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"></h3>
|
||||
|
||||
<div class="box-tools">
|
||||
<button type="button" class="btn btn-box-tool" onclick="addPersonalFun();"
|
||||
title="新增"><i class="fa fa-plus"> 新增</i></button>
|
||||
<%-- <button type="button" class="btn btn-box-tool" onclick="addFuns();" title="期初新增"><i class="fa fa-plus"> 期初新增</i></button>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<div id="personalLnformationTree" style="height:100%;overflow:auto;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rightBox" class="col-md-9" style="height: 100%;">
|
||||
</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/alarm/alarmPointRiskLevelAdd.jsp
Normal file
103
WebRoot/jsp/alarm/alarmPointRiskLevelAdd.jsp
Normal file
@ -0,0 +1,103 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
//保存前先赋值班组
|
||||
$('#riskLevelId').val($('#_riskLevelId').val());
|
||||
// $('#areaId').val($('#_areaId').val());
|
||||
|
||||
$("#riskLevelForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#riskLevelForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var param = $("#riskLevelForm").serialize();
|
||||
$.post(ext.contextPath + "/alarm/alarmPointRiskLevel/doSave.do", param, function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('riskLevelModal')
|
||||
$("#table_patrolRiskLevel").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$.post(ext.contextPath + "/hqconfig/riskGrade/getJson.do", {}, function (data) {
|
||||
var selelct = $("#_riskLevelId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
|
||||
//获取巡检区域
|
||||
var selectAreaFun = function () {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
|
||||
|
||||
}, function (data) {
|
||||
$("#areaSubDiv").html(data);
|
||||
openModal('areaSubModal');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div class="modal fade" id="riskLevelModal">
|
||||
<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="riskLevelForm">
|
||||
<input type="hidden" id="risklevel" name="risklevel" class="form-control pull-right">
|
||||
<input type="hidden" id="alarmpointId" name="alarmpointId" value="${param.alarmpointId}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">风险项</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="_riskLevelId" name="_riskLevelId"
|
||||
style="width: 100%"></select>
|
||||
<input type="hidden" name="riskLevelId" id="riskLevelId" 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="_areaId" name="_areaId"
|
||||
onclick="selectAreaFun()" placeholder="点击选择"
|
||||
autocomplete="off" readonly="true">
|
||||
<input type="hidden" class="form-control" id="areaId" name="areaId">
|
||||
</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="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
146
WebRoot/jsp/alarm/alarmPointRiskLevelEdit.jsp
Normal file
146
WebRoot/jsp/alarm/alarmPointRiskLevelEdit.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
function doUpdate() {
|
||||
//保存前先赋值班组
|
||||
$('#riskLevelId').val($('#_riskLevelId').val());
|
||||
// $('#areaId').val($('#_areaId').val());
|
||||
|
||||
$("#riskLevelForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#riskLevelForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var param = $("#riskLevelForm").serialize();
|
||||
$.post(ext.contextPath + "/alarm/alarmPointRiskLevel/doUpdate.do", param, function (data) {
|
||||
if (data.code == 1) {
|
||||
closeModal('riskLevelEditModal')
|
||||
$("#table_patrolRiskLevel").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// $("#riskLevelForm").bootstrapValidator({
|
||||
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
// fields: {
|
||||
// name: {
|
||||
// validators: {
|
||||
// notEmpty: {
|
||||
// message: '用户名不能为空'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
$(function () {
|
||||
// $.post(ext.contextPath + "/hqconfig/riskGrade/getAreaManage.do", {}, function (data) {
|
||||
// var selelct = $("#_areaId").select2({
|
||||
// data: data,
|
||||
// placeholder: '请选择',//默认文字提示
|
||||
// allowClear: false,//允许清空
|
||||
// escapeMarkup: function (markup) {
|
||||
// return markup;
|
||||
// }, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
// multiple: false,
|
||||
// formatResult: function formatRepo(repo) {
|
||||
// return repo.text;
|
||||
// }, // 函数用来渲染结果
|
||||
// formatSelection: function formatRepoSelection(repo) {
|
||||
// return repo.text;
|
||||
// } // 函数用于呈现当前的选择
|
||||
// });
|
||||
// }, 'json');
|
||||
|
||||
$.post(ext.contextPath + "/hqconfig/riskGrade/getJson.do", {}, function (data) {
|
||||
var selelct = $("#_riskLevelId").select2({
|
||||
data: data,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: false,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
multiple: false,
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('${alarmPointRiskLevel.riskLevel.id}').trigger("change");
|
||||
selelct.on('change', function (e) {
|
||||
$('#riskLevelId').val(e.target.value);
|
||||
})
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
|
||||
|
||||
//获取巡检区域
|
||||
var selectAreaFun = function () {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
|
||||
|
||||
}, function (data) {
|
||||
$("#areaSubDiv").html(data);
|
||||
openModal('areaSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="riskLevelEditModal">
|
||||
<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="riskLevelForm">
|
||||
<input type="hidden" id="risklevel" name="risklevel" class="form-control pull-right">
|
||||
<input type="hidden" id="id" name="id" value="${alarmPointRiskLevel.id}">
|
||||
<input type="hidden" id="alarmpointId" name="alarmpointId" value="${alarmPointRiskLevel.alarmpointId}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">风险项</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="_riskLevelId" name="_riskLevelId"
|
||||
style="width: 100%"></select>
|
||||
<input type="hidden" name="riskLevelId" id="riskLevelId" value="${alarmPointRiskLevel.riskLevel.id}">
|
||||
</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="_areaId" name="_areaId"
|
||||
onclick="selectAreaFun()" placeholder="点击选择"
|
||||
autocomplete="off" readonly="true"
|
||||
value="${alarmPointRiskLevel.areaManage.name}">
|
||||
<input type="hidden" name="areaId" id="areaId" value="${alarmPointRiskLevel.areaManage.id}">
|
||||
</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="doUpdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
194
WebRoot/jsp/alarm/alarmRecordList.jsp
Normal file
194
WebRoot/jsp/alarm/alarmRecordList.jsp
Normal file
@ -0,0 +1,194 @@
|
||||
<%@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 viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/alarm/alarmRecord/doview.do', { id: id }, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmRecord/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: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'alarmType', // 返回json数据中的name
|
||||
title: '预警类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=null){
|
||||
return value.type;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},{
|
||||
field: 'operates', // 返回json数据中的name
|
||||
title: '接受人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'// 上下居中
|
||||
}, {
|
||||
field: 'alarmType', // 返回json数据中的name
|
||||
title: '预警异常描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=null){
|
||||
return value.describe;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'alarmType', // 返回json数据中的name
|
||||
title: '时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if(value!=null){
|
||||
if(value.noticeType=='0'){
|
||||
return "短信";
|
||||
}else if(value.noticeType=='1'){
|
||||
return "系统消息";
|
||||
}else if(value.noticeType=='2'){
|
||||
return "短信+系统消息";
|
||||
}
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'state', // 返回json数据中的name
|
||||
title: '预警异常描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',// 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if(value=='0'){
|
||||
return "未处理";
|
||||
}else if(value=='1'){
|
||||
return "已处理";
|
||||
}
|
||||
}
|
||||
},{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<security:authorize buttonUrl="equipment/equipmentClass/edit.do">';
|
||||
buts += '<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></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="equipment/equipmentClass/add.do">
|
||||
|
||||
</security:authorize>
|
||||
</div>
|
||||
<br>
|
||||
<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>
|
||||
163
WebRoot/jsp/alarm/alarmRecordView.jsp
Normal file
163
WebRoot/jsp/alarm/alarmRecordView.jsp
Normal file
@ -0,0 +1,163 @@
|
||||
<%@ 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"%>
|
||||
<%@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); %>
|
||||
<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(){
|
||||
$("#solutiontable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmSolution/getList.do?alarmtypeid=${alarmRecord.alarmType.id}', // 获取表格数据的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 // 排序规则
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'solution', // 返回json数据中的name
|
||||
title: '措施', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100
|
||||
},{
|
||||
field: 'result', // 返回json数据中的name
|
||||
title: '预期效果', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100
|
||||
},{
|
||||
field: 'isissueorder', // 返回json数据中的name
|
||||
title: '下发工单', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:20,
|
||||
formatter:function(value, row, index){
|
||||
if(value){
|
||||
return '是';
|
||||
}else{
|
||||
return '否';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'ordertype', // 返回json数据中的name
|
||||
title: '工单类型', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:20
|
||||
},{
|
||||
field: 'orderdescribe', // 返回json数据中的name
|
||||
title: '工单描述', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
$(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' })
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
function issueFun(){
|
||||
var checkedItems = $("#solutiontable").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
swal('请先选择措施');
|
||||
return;
|
||||
}
|
||||
/*$.post(ext.contextPath+'/alarm/alarmRecord/issue.do',{id:'${alarmRecord.id}',solutionid:datas},function(data){
|
||||
if(data==1){
|
||||
swal('下发成功');
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
});*/
|
||||
$.post(ext.contextPath + "/alarm/alarmRecord/issue.do", {id:'${alarmRecord.id}',solutionid:datas,unitId:unitId}, function (data) {
|
||||
if(data==1){
|
||||
swal('下发成功');
|
||||
closeModal('subModal');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
}
|
||||
</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" id="id" name="id" value="${alarmRecord.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预警类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" value="${alarmRecord.alarmType.type}" readonly="readonly">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">预警时间</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" value="${fn:substring(alarmRecord.insdt,0,19)}" readonly="readonly">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预警描述</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="3">${alarmRecord.alarmType.describe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<table id="solutiontable"></table>
|
||||
<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="issueFun()" id="btn_update">下发</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
207
WebRoot/jsp/alarm/alarmSolutionAdd.jsp
Normal file
207
WebRoot/jsp/alarm/alarmSolutionAdd.jsp
Normal file
@ -0,0 +1,207 @@
|
||||
<%@ 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 selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm2',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
if($('#solution').val()==null || $('#solution').val()==''){
|
||||
swal('请输入解决措施');
|
||||
$('#solution').focus();
|
||||
return;
|
||||
}
|
||||
if($('#result').val()==null || $('#result').val()==''){
|
||||
swal('请输入解决措施');
|
||||
$('#result').focus();
|
||||
return;
|
||||
}
|
||||
//保存前先赋值班组
|
||||
var val = $('#_deptIds').val();
|
||||
var rolestr = "";
|
||||
if(val!=null && val!=''){
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#deptids').val(rolestr);//赋值班组
|
||||
}
|
||||
|
||||
/*$("#subForm2").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
$.post(ext.contextPath + "/alarm/alarmSolution/dosave.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
closeModal('subModal');
|
||||
$("#solutiontable").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
/*}
|
||||
}, 100);*/
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm2").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
refreshSelect();
|
||||
$.post(ext.contextPath + "/alarm/alarmSolution/getOrderJson.do", {}, function(data) {
|
||||
|
||||
var selelct =$("#ordertype").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("").trigger("change");
|
||||
}
|
||||
},'json');
|
||||
|
||||
|
||||
|
||||
$("input[name='compare']").click(function(){
|
||||
var com = $("input[name='compare']:checked").val();
|
||||
if(com=='-1'||com=='1'||com=='0'){
|
||||
$("#val").attr("disabled",false);
|
||||
$("#upperlimit").attr("disabled",'disabled');
|
||||
$("#lowerlimit").attr("disabled",'disabled');
|
||||
$("#val").val('');
|
||||
$("#upperlimit").val('');
|
||||
$("#lowerlimit").val('');
|
||||
}else{
|
||||
$("#upperlimit").attr("disabled",false);
|
||||
$("#lowerlimit").attr("disabled",false);
|
||||
$("#val").attr("disabled","disabled");
|
||||
$("#val").val('');
|
||||
$("#upperlimit").val('');
|
||||
$("#lowerlimit").val('');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//初始化班组
|
||||
function refreshSelect() {
|
||||
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", { companyId: unitId}, function (data) {
|
||||
var selelct = $("#_deptIds").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');
|
||||
};
|
||||
</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="subForm2">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="alarmtypeid" value="${alarmtypeid}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">解决措施</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" id="solution" name ="solution" placeholder="解决措施。。。"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预计效果</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" id="result" name ="result" placeholder="预计效果。。。"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">下发工单</label>
|
||||
<div class="col-sm-2">
|
||||
<label><input type="radio" name="isissueorder" value="1" checked="checked" />是</label>
|
||||
<label><input type="radio" name="isissueorder" value="0" />否</label>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工单类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="ordertype" name="ordertype" 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="4" id="orderdescribe" name ="orderdescribe" placeholder="工单描述。。。"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">下发班组</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control select2" id="_deptIds" name="_deptIds" style="width: 100%;">
|
||||
</select>
|
||||
<input type="hidden" name="deptids" id="deptids" value="">
|
||||
</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-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
196
WebRoot/jsp/alarm/alarmSolutionEdit.jsp
Normal file
196
WebRoot/jsp/alarm/alarmSolutionEdit.jsp
Normal file
@ -0,0 +1,196 @@
|
||||
<%@ 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 selectMPint = function(pid) {
|
||||
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm2',hiddenId:'mpid',codeId:'mpcode',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
||||
$("#mpSubDiv").html(data);
|
||||
openModal('mpSubModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
if($('#solution').val()==null || $('#solution').val()==''){
|
||||
swal('请输入解决措施');
|
||||
$('#solution').focus();
|
||||
return;
|
||||
}
|
||||
if($('#result').val()==null || $('#result').val()==''){
|
||||
swal('请输入解决措施');
|
||||
$('#result').focus();
|
||||
return;
|
||||
}
|
||||
//保存前先赋值班组
|
||||
var val = $('#_deptIds').val();
|
||||
var rolestr = "";
|
||||
if(val!=null && val!=''){
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#deptids').val(rolestr);//赋值班组
|
||||
}else{
|
||||
$('#deptids').val("");//赋值班组
|
||||
}
|
||||
|
||||
/*$("#subForm2").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function(){
|
||||
if ($("#subForm2").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码 */
|
||||
$.post(ext.contextPath + "/alarm/alarmSolution/doupdate.do", $("#subForm2").serialize(), function(data) {
|
||||
if (data == 1){
|
||||
closeModal('subModal');
|
||||
$("#solutiontable").bootstrapTable('refresh');
|
||||
}else if(data == 0){
|
||||
showAlert('d','保存失败','alertDiv');
|
||||
}else{
|
||||
showAlert('d',data,'alertDiv');
|
||||
}
|
||||
},'json');
|
||||
/*}
|
||||
}, 100);*/
|
||||
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm2").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
mpointid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '测量点不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/* processsectionid: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '工艺段不能为空'
|
||||
}
|
||||
}
|
||||
}, */
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
refreshSelect();
|
||||
$.post(ext.contextPath + "/alarm/alarmSolution/getOrderJson.do", {}, function(data) {
|
||||
|
||||
var selelct =$("#ordertype").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('${alarmSolution.ordertype}').trigger("change");
|
||||
}
|
||||
},'json');
|
||||
});
|
||||
|
||||
//初始化班组
|
||||
function refreshSelect() {
|
||||
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", { companyId: unitId}, function (data) {
|
||||
var selelct = $("#_deptIds").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; } // 函数用于呈现当前的选择
|
||||
});
|
||||
var roleitems = new Array();
|
||||
var roles = JSON.parse('${depts}');
|
||||
for (var i = 0; i < roles.length; i++) {
|
||||
roleitems.push(roles[i].id);
|
||||
}
|
||||
selelct.val(roleitems).trigger("change");
|
||||
}, 'json');
|
||||
};
|
||||
</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="subForm2">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" name="alarmtypeid" value="${alarmSolution.alarmtypeid}">
|
||||
<input type="hidden" name="id" value="${alarmSolution.id}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">解决措施</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" id="solution" name ="solution" placeholder="解决措施。。。">${alarmSolution.solution}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">预计效果</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" id="result" name ="result" placeholder="预计效果。。。">${alarmSolution.result}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">下发工单</label>
|
||||
<div class="col-sm-2">
|
||||
<label><input type="radio" name="isissueorder" value="1" <c:if test='${alarmSolution.isissueorder}'> checked="checked"</c:if> />是</label>
|
||||
<label><input type="radio" name="isissueorder" value="0" <c:if test='${!alarmSolution.isissueorder}'> checked="checked"</c:if> />否</label>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">工单类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="ordertype" name="ordertype" 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="4" id="orderdescribe" name ="orderdescribe" placeholder="工单描述。。。">${alarmSolution.orderdescribe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">下发班组</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control select2" id="_deptIds" name="_deptIds" style="width: 100%;">
|
||||
</select>
|
||||
<input type="hidden" name="deptids" id="deptids" value="">
|
||||
</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-primary" onclick="dosave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
191
WebRoot/jsp/alarm/alarmSubscribeAdd.jsp
Normal file
191
WebRoot/jsp/alarm/alarmSubscribeAdd.jsp
Normal file
@ -0,0 +1,191 @@
|
||||
<%@ 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 () {
|
||||
var alarmMoldCodeEnum = jQuery.parseJSON('${alarmMoldCodeEnum}');
|
||||
var selelct_ = $("#alarmMoldCode").select2({
|
||||
data: alarmMoldCodeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
|
||||
var alarmLevelsCodeEnum = jQuery.parseJSON('${alarmLevelsCodeEnum}');
|
||||
var selelct_2 = $("#alarmLevelsCode").select2({
|
||||
data: alarmLevelsCodeEnum,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_2.val('').trigger("change");
|
||||
selelct_2.on("change", function (e) {
|
||||
dosearch();
|
||||
});
|
||||
})
|
||||
|
||||
function dosearch() {
|
||||
$("#subscribeTable").bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#subscribeTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmPoint/getlistForSubscribePersonalAdd.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 20, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: unitId,
|
||||
alarmMoldCode: $('#alarmMoldCode').val(),
|
||||
alarmLevelsCode: $('#alarmLevelsCode').val()
|
||||
}
|
||||
},
|
||||
sortName: 'alarm_point', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'alarmPointName', // 返回json数据中的name
|
||||
title: '报警点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'informationCodeName', // 返回json数据中的name
|
||||
title: '信息标识', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("subscribeTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function doPersonalSave() {
|
||||
var checkedItems = $("#subscribeTable").bootstrapTable('getSelections');
|
||||
var ids = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
ids += item.id + ",";
|
||||
});
|
||||
if (ids == "") {
|
||||
showAlert('d', '请先选择记录', 'addsAlertdiv');
|
||||
} else {
|
||||
var informationCode = $('#informationCodeMp').val();
|
||||
$.post(ext.contextPath + '/alarm/alarmSubscribe/doPersonalSave.do', {
|
||||
ids: ids,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
personalInformationTree();
|
||||
closeModal('subModal');
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
</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">
|
||||
<div id="addsAlertdiv"></div>
|
||||
<div class="form-group form-inline" style="padding:0;padding-bottom: 10px;">
|
||||
<div class="form-group pull-left">
|
||||
<div class="input-group input-group-sm " style="width: 220px;">
|
||||
<label class="control-label" style="float:left;width:30%;line-height: 30px;padding: 0px;">报警类型</label>
|
||||
<div class="control-label" style="float:left;width:70%;">
|
||||
<select class="form-control select2 " id="alarmMoldCode" name="alarmMoldCode"
|
||||
style="width: 100%;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 220px;">
|
||||
<label class="control-label" style="float:left;width:30%;line-height: 30px;padding: 0px;">报警等级</label>
|
||||
<div class="control-label" style="float:left;width:70%;">
|
||||
<select class="form-control select2 " id="alarmLevelsCode" name="alarmLevelsCode"
|
||||
style="width: 100%;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right">
|
||||
<%-- <div class="input-group input-group-sm" style="width: 180px;padding-right: 5px;">--%>
|
||||
<%-- <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>
|
||||
<br>
|
||||
<table id="subscribeTable"></table>
|
||||
</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="doPersonalSave()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
123
WebRoot/jsp/alarm/alarmSysSubscribePointList.jsp
Normal file
123
WebRoot/jsp/alarm/alarmSysSubscribePointList.jsp
Normal file
@ -0,0 +1,123 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.entity.alarm.AlarmPoint" %>
|
||||
<% request.setAttribute("Type_MPoint", AlarmPoint.Type_MPoint);%>
|
||||
|
||||
<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 () {
|
||||
$("#pointTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmPoint/getlistForSubscribeSys.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
unitId: unitId,
|
||||
informationCode:'${param.code}'
|
||||
}
|
||||
},
|
||||
sortName: 'alarm_point', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'alarmPointName', // 返回json数据中的name
|
||||
title: '报警点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("pointTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
var deletePointFun = 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(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/alarmPoint/dodelete.do', {id: id}, function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#pointTable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
<div class="box box-primary">
|
||||
<!-- /.box-header -->
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">报警点列表</h3>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<%-- <button type="button" class="btn btn-default" onclick="addMpPointFun();"><i class="fa fa-plus"></i>--%>
|
||||
<%-- 新增测量点--%>
|
||||
<%-- </button>--%>
|
||||
<%-- <button type="button" class="btn btn-default" onclick="deletePointFuns();"><i--%>
|
||||
<%-- class="fa fa-trash-o"></i> 删除--%>
|
||||
<%-- </button>--%>
|
||||
</div>
|
||||
<br>
|
||||
<table id="pointTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
43
WebRoot/jsp/alarm/alarmType4Select.jsp
Normal file
43
WebRoot/jsp/alarm/alarmType4Select.jsp
Normal file
@ -0,0 +1,43 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
var selectMenu = function() {
|
||||
|
||||
alert('${param.hiddenId}'+'${param.textId}');
|
||||
}
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/alarm/getAlarmTypesJson.do', {ng:'',unitid:unitId} , function(data) {
|
||||
console.info(data);
|
||||
if(data.length>0){
|
||||
$('#alarmType_select_tree').treeview({
|
||||
data: data,
|
||||
});
|
||||
$('#alarmType_select_tree').on('nodeSelected', function(event, data) {
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(data.id);
|
||||
$('#${param.formId} #${param.textId}').val(data.text);
|
||||
closeModal("alarmType4SelectModal")
|
||||
});
|
||||
}
|
||||
},'json');
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="alarmType4SelectModal">
|
||||
<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="alarmType_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>
|
||||
146
WebRoot/jsp/alarm/alarmTypeAdd.jsp
Normal file
146
WebRoot/jsp/alarm/alarmTypeAdd.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ 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 showAlarmType4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/alarm/showAlarmType4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#alarmType4SelectDiv").html(data);
|
||||
openModal('alarmType4SelectModal');
|
||||
});
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#operaterId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"operaterId",textId:"operater",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/saveAlarm.do?unitId="+unitId, $("#subForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
initTreeView();
|
||||
//showAlert('s','保存成功');
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
//var active=$("#active").select2();
|
||||
// $("#active").select2({ minimumResultsForSearch: 10 }).val("${menu.active}").trigger("change");
|
||||
});
|
||||
var showMsgType4SelectsFun = function () {
|
||||
//var userIds = $("#recvid").val();
|
||||
$.post(ext.contextPath + '/msg/msgTypeForSelect.do', { formId: "subForm", hiddenId: "noticeType", textId: "mtypename" }, function (data) {
|
||||
$("#msgType4SelectDiv").html(data);
|
||||
openModal("msgType4SelectModal");
|
||||
});
|
||||
};
|
||||
</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" value="${menu.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="alarmType4SelectDiv"></div>
|
||||
<div id="msgType4SelectDiv"></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="type" name="type" placeholder="类型名称"
|
||||
value="">
|
||||
</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="showAlarmType4SelectFun();" value="${pname}">
|
||||
<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">
|
||||
<input type="text" class="form-control" id="mtypename" name="mtypename" placeholder="消息类型"
|
||||
value="" onclick="showMsgType4SelectsFun();">
|
||||
<input id="noticeType" name="noticeType" type="hidden" value="P" />
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*接收人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="operater" name ="operater" placeholder="请选择接收人员" onclick="showUser4SelectsFun();">
|
||||
<input id="operaterId" name="operaterId" type="hidden" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="state" name="state" class="form-control select2 "
|
||||
style="width: 120px;">
|
||||
<option value="1">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">自动下发</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="autoIssue" name="autoIssue" class="form-control select2 "
|
||||
style="width: 120px;">
|
||||
<option value="1">自动</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">
|
||||
<textarea class="form-control" rows="4" id="describe" name ="describe" placeholder="预警异常描述。。。"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
494
WebRoot/jsp/alarm/alarmTypeEdit.jsp
Normal file
494
WebRoot/jsp/alarm/alarmTypeEdit.jsp
Normal file
@ -0,0 +1,494 @@
|
||||
<%@ 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 showAlarmType4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/alarm/showAlarmType4Select.do', { formId: "subForm", hiddenId: "pid", textId: "_pname" }, function (data) {
|
||||
$("#alarmType4SelectDiv").html(data);
|
||||
openModal('alarmType4SelectModal');
|
||||
});
|
||||
};
|
||||
var showUser4SelectsFun = function() {
|
||||
var userIds= $("#operaterId").val();
|
||||
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"operaterId",textId:"operater",userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/alarm/updatealarmType.do", $("#subForm").serialize(), function (result) {
|
||||
if (result == 1) {
|
||||
showAlert('s', '保存成功');
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
_pname: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '上级菜单不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
morder: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '顺序不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^[0-9]*$/,
|
||||
message: '顺序必须为数字'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
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 + '/alarm/deleteAlarmType.do', $("#subForm").serialize(), function (data) {
|
||||
if (data.res > 0) {
|
||||
initTreeView();
|
||||
} else {
|
||||
showAlert('d', '删除失败');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function delFun(id) {
|
||||
|
||||
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 + '/alarm/alarmCondition/dodel.do', { id: id }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#conditiontable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'alertDiv_condition');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var delSolutionFun = function(id){
|
||||
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 + '/alarm/alarmSolution/dodel.do', { id: id }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#solutiontable").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'alertDiv_condition');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var addConditionFun = function () {
|
||||
$.post(ext.contextPath + '/alarm/alarmCondition/showAdd.do', { alarmtypeid: "${alarmType.id}" }, function (data) {
|
||||
$("#conditionDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editConditionFun = function (id) {
|
||||
$.post(ext.contextPath + '/alarm/alarmCondition/showEdit.do', { id: id }, function (data) {
|
||||
$("#conditionDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var addsolutionFun = function(){
|
||||
$.post(ext.contextPath + '/alarm/alarmSolution/showAdd.do', { alarmtypeid: "${alarmType.id}" }, function (data) {
|
||||
$("#solutionDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
var editSolutionFun = function(id){
|
||||
$.post(ext.contextPath + '/alarm/alarmSolution/showEdit.do', { id: id }, function (data) {
|
||||
$("#solutionDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#conditiontable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmCondition/getList.do?alarmtypeid=${alarmType.id}', // 获取表格数据的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 // 排序规则
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'mPoint', // 返回json数据中的name
|
||||
title: '测量点', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100,
|
||||
formatter:function (value, row, index){
|
||||
if(value!=null){
|
||||
return value.parmname;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'mPoint', // 返回json数据中的name
|
||||
title: '测量点编号', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100,
|
||||
formatter:function (value, row, index){
|
||||
if(value!=null){
|
||||
return value.mpointcode;
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'compare', // 返回json数据中的name
|
||||
title: '条件', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100,
|
||||
formatter:function (value, row, index){
|
||||
if(value!=null){
|
||||
if(value == '1'){
|
||||
return '>'+row.val;
|
||||
}else if( value == '0'){
|
||||
return '='+row.val;
|
||||
}else if( value == '-1'){
|
||||
return '<'+row.val;
|
||||
}else if( value == '2'){
|
||||
return '范围:['+row.lowerlimit+'-'+row.upperlimit+']';
|
||||
}else if( value == '3'){
|
||||
return '范围:[<'+row.lowerlimit+' || >'+row.upperlimit+']';
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="editConditionFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>' +
|
||||
'<button class="btn btn-default btn-sm" onclick="delFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
$(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' })
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
$("#solutiontable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/alarmSolution/getList.do?alarmtypeid=${alarmType.id}', // 获取表格数据的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 // 排序规则
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'solution', // 返回json数据中的name
|
||||
title: '措施', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100
|
||||
},{
|
||||
field: 'result', // 返回json数据中的name
|
||||
title: '预期效果', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100
|
||||
},{
|
||||
field: 'isissueorder', // 返回json数据中的name
|
||||
title: '下发工单', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:20,
|
||||
formatter:function(value, row, index){
|
||||
if(value){
|
||||
return '是';
|
||||
}else{
|
||||
return '否';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'ordertype', // 返回json数据中的name
|
||||
title: '工单类型', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:20
|
||||
},{
|
||||
field: 'orderdescribe', // 返回json数据中的name
|
||||
title: '工单描述', // 表格表头显示文字
|
||||
align: 'left', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
align: 'center',
|
||||
width:100
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 20, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return '<div class="btn-group"><button class="btn btn-default btn-sm" onclick="editSolutionFun(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>' +
|
||||
'<button class="btn btn-default btn-sm" onclick="delSolutionFun(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button></div>';
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
$(".bs-checkbox").css({ 'text-align': 'center', 'vertical-align': 'middle' })
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
var showMsgType4SelectsFun = function () {
|
||||
//var userIds = $("#recvid").val();
|
||||
$.post(ext.contextPath + '/msg/msgTypeForSelect.do', { formId: "subForm", hiddenId: "noticeType", textId: "mtypename" }, function (data) {
|
||||
$("#msgType4SelectDiv").html(data);
|
||||
openModal("msgType4SelectModal");
|
||||
});
|
||||
};
|
||||
</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>
|
||||
<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="${alarmType.id}" />
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="alarmType4SelectDiv"></div>
|
||||
<div id="msgType4SelectDiv"></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="type" name="type" placeholder="类型名称" value="${alarmType.type }">
|
||||
</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="showAlarmType4SelectFun();" value="${alarmType._pname}">
|
||||
<input id="pid" name="pid" type="hidden" value="${alarmType.pid}" />
|
||||
</div>
|
||||
</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="mtypename" name="mtypename" placeholder="消息类型"
|
||||
value="${msgType.name}" onclick="showMsgType4SelectsFun();">
|
||||
<input id="noticeType" name="noticeType" type="hidden" value="${alarmType.noticeType}" />
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*接收人</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="operater" name ="operater" placeholder="请选择接收人员" onclick="showUser4SelectsFun();" value="${operaters}">
|
||||
<input id="operaterId" name="operaterId" type="hidden" value="${alarmType.operaterId}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">启用</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="state" name="state" class="form-control select2 "
|
||||
style="width: 120px;">
|
||||
<option value="1" <c:if test="${alarmType.state==true}">selected="selected"</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${alarmType.state==false}">selected="selected"</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">自动下发</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="autoIssue" name="autoIssue" class="form-control select2 "
|
||||
style="width: 120px;">
|
||||
<option value="1" <c:if test="${alarmType.autoIssue==true}">selected="selected"</c:if>>自动</option>
|
||||
<option value="0" <c:if test="${alarmType.autoIssue==false}">selected="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="4" id="describe" name ="describe" placeholder="预警异常描述。。。">${alarmType.describe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">触发条件</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_condition"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default" onclick="addConditionFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</div>
|
||||
<div id="conditionDiv"></div>
|
||||
<div id="mpSubDiv"></div>
|
||||
<div id="condition4SelectDiv_func"></div>
|
||||
<br>
|
||||
<table id="conditiontable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">解决措施</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body ">
|
||||
<div>
|
||||
<div id="alertDiv_solution"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default" onclick="addsolutionFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
</div>
|
||||
<div id="solutionDiv"></div>
|
||||
<div id="solution4SelectDiv_func"></div>
|
||||
<br>
|
||||
<table id="solutiontable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
183
WebRoot/jsp/alarm/alarmTypeTree.jsp
Normal file
183
WebRoot/jsp/alarm/alarmTypeTree.jsp
Normal file
@ -0,0 +1,183 @@
|
||||
<%@ 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>
|
||||
<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() {
|
||||
var node=$('#tree').treeview('getSelected');
|
||||
var pid="";
|
||||
if(node!=null && node.length>0){
|
||||
pid=node[0].id;
|
||||
}
|
||||
$.post(ext.contextPath + '/alarm/showAlarmTypeAdd.do', {pid:pid} , function(data) {
|
||||
$("#alarmTypeBox").html(data);
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/alarm/showAlarmTypeEdit.do', {id:id} , function(data) {
|
||||
$("#alarmTypeBox").html(data);
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
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/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}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 + '/work/group/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var initTreeView = function() {
|
||||
$.post(ext.contextPath + '/alarm/getAlarmTypesJson.do', {ng:'',unitid:unitId} , function(data) {
|
||||
//console.info(data)
|
||||
$('#tree').treeview({data: data,
|
||||
});
|
||||
$('#tree').on('nodeSelected', function(event, data) {
|
||||
editFun(data.id);
|
||||
//var node=$('#tree').treeview('getSelected');
|
||||
});
|
||||
},'json');
|
||||
$("#alarmTypeBox").html("");
|
||||
};
|
||||
$(function() {
|
||||
initTreeView();
|
||||
|
||||
});
|
||||
|
||||
</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='user4SelectDiv'></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="alarmTypeBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
602
WebRoot/jsp/alarm/proAlarmBaseTextList.jsp
Normal file
602
WebRoot/jsp/alarm/proAlarmBaseTextList.jsp
Normal file
@ -0,0 +1,602 @@
|
||||
<%@ 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.scada.ProAlarmBaseText" %>
|
||||
<%request.setAttribute("AdoptSt_True", ProAlarmBaseText.AdoptSt_True); %>
|
||||
<%request.setAttribute("AdoptSt_False", ProAlarmBaseText.AdoptSt_False); %>
|
||||
|
||||
<!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 beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
|
||||
var beginTimeStore2 = '';
|
||||
// var endTimeStore2 = '';
|
||||
|
||||
let colors = ['#3AA1FF', '#59D4D4', '#6DD48C', '#FBDB5A',
|
||||
"#2ec7c9",
|
||||
"#b6a2de",
|
||||
"#5ab1ef",
|
||||
"#ffb980",
|
||||
"#d87a80",
|
||||
"#8d98b3",
|
||||
"#e5cf0d",
|
||||
"#97b552",
|
||||
"#95706d",
|
||||
"#dc69aa",
|
||||
"#07a2a4",
|
||||
"#9a7fd1",
|
||||
"#588dd5",
|
||||
"#f5994e",
|
||||
"#c05050",
|
||||
"#59678c",
|
||||
"#c9ab00",
|
||||
"#7eb00a",
|
||||
"#6f5553",
|
||||
"#c14089"];
|
||||
|
||||
|
||||
$(function () {
|
||||
let bodyWidth = $(window).width();
|
||||
let bodyHeight = $(window).height();
|
||||
// var bodyWidth = global_width;
|
||||
// var bodyHeight = global_height;
|
||||
|
||||
$('#main').css('width', bodyWidth);
|
||||
$('#main').css('height', bodyHeight);
|
||||
|
||||
initDate();
|
||||
initDate2();
|
||||
|
||||
dosearch2();
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + "/process/decisionExpertBase/get4SelectPidJson.do",
|
||||
async: false,
|
||||
globle: false,
|
||||
data: {unitId: unitId},
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
$("#zdType").empty();
|
||||
var selelct_ = $("#zdType").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_.val('${param.zdType}').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}
|
||||
});
|
||||
var data_adoptSt = [{ id: '${AdoptSt_True}', text: '采纳' }, { id: '${AdoptSt_False}', text: '未采纳' }];
|
||||
|
||||
var selelct_adoptSt = $("#adoptSt").select2({
|
||||
data: data_adoptSt,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_adoptSt.val('${param.adoptSt}').trigger("change");
|
||||
selelct_adoptSt.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/proAlarmBaseText/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,
|
||||
unitId: unitId,
|
||||
sdt: beginTimeStore,
|
||||
edt: endTimeStore,
|
||||
adoptSt: $("#adoptSt").val(),
|
||||
zdType: $("#zdType").val()
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
// {
|
||||
// checkbox: true, // 显示一个勾选框
|
||||
// },
|
||||
{
|
||||
field: 'pointName', // 返回json数据中的name
|
||||
title: '问题项', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.proAlarm != null) {
|
||||
return row.proAlarm.pointName
|
||||
} else {
|
||||
return "未关联报警点"
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'describe', // 返回json数据中的name
|
||||
title: '问题描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.proAlarm != null) {
|
||||
return row.proAlarm.describe
|
||||
} else {
|
||||
return "未关联报警点"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'zdTypeName', // 返回json数据中的name
|
||||
title: '诊断类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'alarmTime', // 返回json数据中的name
|
||||
title: '诊断时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (row.proAlarm != null) {
|
||||
return row.proAlarm.alarmTime.substring(0, 16)
|
||||
} else {
|
||||
return "未关联报警点"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'decisionexpertbasetext', // 返回json数据中的name
|
||||
title: '专家建议', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'adoptSt', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
if (value == '${AdoptSt_True}') {
|
||||
return "采纳"
|
||||
} else {
|
||||
return "未采纳"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 120, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
buts += '<button class="btn btn-default btn-sm" title="采纳" onclick="downOrder(\'' + row.id + '\')"><i class="fa fa-check"></i><span class="hidden-md hidden-lg"> 采纳</span></button>';
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function downOrder(id) {
|
||||
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 + "/alarm/proAlarmBaseText/downOrder.do", {
|
||||
id: id,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function initDate() {
|
||||
//定义locale汉化插件
|
||||
// beginTimeStore = moment().subtract(7, 'days').format('YYYY-MM-DD HH:mm');
|
||||
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD') + ' 00:00';
|
||||
endTimeStore = moment().subtract(0, 'days').format('YYYY-MM-DD') + ' 23:59';
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtimeMain').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore,
|
||||
endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtimeMain').val(beginTimeStore + locale.separator + endTimeStore);
|
||||
};
|
||||
|
||||
|
||||
function initDate2() {
|
||||
beginTimeStore2 = moment().subtract(0, 'days').format("YYYY");
|
||||
$('#reservationtime2').datetimepicker({
|
||||
startView: 4,//日期时间选择器打开之后首先显示的视图。 可接受的值:0 - 小时 视图,1 - 天 视图,2 - 月 视图,3 - 年 视图,4 - 十年 视图
|
||||
minView: 4,//Number, String. 默认值:0, ‘hour’,日期时间选择器所能够提供的最精确的时间选择视图
|
||||
autoclose: true,//当选择一个日期之后是否立即关闭此日期时间选择器
|
||||
todayBtn: true,//在日期时间选择器组件的底部显示一个 “Today” 按钮用以选择当前日期
|
||||
format: 'yyyy'//日期显示格式
|
||||
});
|
||||
$('#reservationtime2').val(beginTimeStore2);
|
||||
};
|
||||
|
||||
|
||||
//模糊查询列表中的数据
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
|
||||
//展示数据
|
||||
var dosearch2 = function () {
|
||||
// console.log($('#reservationtime2').val() + "-01-01")
|
||||
$.post(ext.contextPath + "/alarm/proAlarmBaseText/getStatisticalData.do", {
|
||||
unitId: unitId,
|
||||
statisticalDate: $('#reservationtime2').val() + "-01-01"
|
||||
}, function (data) {
|
||||
// console.log(data)
|
||||
|
||||
let pieData = [];
|
||||
|
||||
let totalNum = 0;
|
||||
let trueNum = 0;
|
||||
let falseNum = 0;
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let forData = data[i];
|
||||
pieData.push({
|
||||
name: forData.name,
|
||||
value: forData.totalNum
|
||||
})
|
||||
totalNum += forData.totalNum;
|
||||
trueNum += forData.trueNum;
|
||||
falseNum += forData.falseNum;
|
||||
}
|
||||
|
||||
|
||||
$('#totalNum').text(totalNum);
|
||||
$('#trueNum').text(trueNum);
|
||||
if (totalNum > 0) {
|
||||
$('#truePercent').text(((trueNum / totalNum) * 100).toFixed(0));
|
||||
} else {
|
||||
$('#truePercent').text(0);
|
||||
}
|
||||
|
||||
|
||||
let typeTableHtml = "";
|
||||
typeTableHtml += "<table style=\"width: 100%;height: 100%;text-align: center;\">";
|
||||
|
||||
typeTableHtml += "<tr >";
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let forData = data[i];
|
||||
typeTableHtml += "<td style='color: #9F9F9F;'>" + forData.name + "<br>采纳次数</td>";
|
||||
}
|
||||
typeTableHtml += "</tr>";
|
||||
typeTableHtml += "<tr >";
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let forData = data[i];
|
||||
typeTableHtml += "<td style=\"color: " + colors[i] + ";font-size: 30px;\">" + forData.trueNum + "</td>";
|
||||
}
|
||||
typeTableHtml += "</tr>";
|
||||
typeTableHtml += "<tr >";
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
// let forData = data[i];
|
||||
typeTableHtml += "<td style='color: #9F9F9F;'>被采纳率</td>";
|
||||
}
|
||||
typeTableHtml += "</tr>";
|
||||
typeTableHtml += "<tr >";
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let forData = data[i];
|
||||
if (forData.totalNum > 0) {
|
||||
typeTableHtml += "<td ><span style='font-size: 30px;'>" + ((forData.trueNum / forData.totalNum) * 100).toFixed(0) + "</span><span style='font-size: 18px;'>%</span></td>";
|
||||
} else {
|
||||
typeTableHtml += "<td ><span style='font-size: 30px;'>0</span><span style='font-size: 18px;'>%</span></td>";
|
||||
}
|
||||
}
|
||||
typeTableHtml += "</tr>";
|
||||
|
||||
typeTableHtml += "</table>";
|
||||
|
||||
$('#typeTableHtml').html(typeTableHtml);
|
||||
|
||||
|
||||
getPieChart(pieData);
|
||||
}, 'json');
|
||||
|
||||
|
||||
$.post(ext.contextPath + "/alarm/proAlarmBaseText/getBarData.do", {
|
||||
unitId: unitId,
|
||||
statisticalDate: $('#reservationtime2').val() + "-01-01"
|
||||
}, function (data) {
|
||||
// console.log(data)
|
||||
getBarChart(data[0], data[1]);
|
||||
}, 'json');
|
||||
};
|
||||
|
||||
function getPieChart(data) {
|
||||
let myChart = echarts.init(document.getElementById("chart1"));
|
||||
let option = {
|
||||
color: colors,
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
bottom: '10px'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '问题占比',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
center: ['50%', '40%'],
|
||||
data: data,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
|
||||
function getBarChart(data1, data2) {
|
||||
let myChart = echarts.init(document.getElementById("chart2"));
|
||||
let option = {
|
||||
color: ['#DADADA', '#26B2FF'],
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
bottom: '10px'
|
||||
},
|
||||
grid: {
|
||||
left: '2%', // 与容器左侧的距离
|
||||
right: '2%', // 与容器右侧的距离
|
||||
top: '8%', // 与容器顶部的距离
|
||||
bottom: '45px', // 与容器底部的距离
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
// axisLabel:{
|
||||
// formatter:'{yyyy}-{MM}'
|
||||
// }
|
||||
data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '建议次数',
|
||||
type: 'bar',
|
||||
data: data2
|
||||
},
|
||||
{
|
||||
name: '被采纳次数',
|
||||
type: 'bar',
|
||||
data: data1
|
||||
}
|
||||
]
|
||||
};
|
||||
console.log(option)
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div id="main" style="background-color: #ecf0f5;padding: 5px;">
|
||||
|
||||
<div style="float:left;width: 100%;height:calc((100% - 10px)*0.4);background-color: #fff;">
|
||||
<div style="float:left;width: 30%;height:100%;">
|
||||
<div style="float:left;width: 100%;height:45px;padding-left: 20px;padding-top: 5px;">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control pull-left" id="reservationtime2"
|
||||
style="width:80px">
|
||||
<div class="input-group-btn" style="float: left;">
|
||||
<button class="btn btn-default" onclick="dosearch2();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="chart1" style="float:left;width: 100%;height:calc(100% - 45px);">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div style="float:left;width: 30%;height:100%;padding: 10px;">
|
||||
<div style="float: left;width: 100%;height:33.3%;border-top:1px solid rgba(232, 232, 232, 1);border-bottom:1px solid rgba(232, 232, 232, 1);">
|
||||
<table style="width: 100%;height: 100%;">
|
||||
<tr style="text-align: center;">
|
||||
<td>总建议次数</td>
|
||||
<td>被采纳次数</td>
|
||||
<td>被采纳率</td>
|
||||
</tr>
|
||||
<tr style="font-size: 40px;font-weight: 700;text-align: center;">
|
||||
<td id="totalNum" style="color: #D4D4D4;"></td>
|
||||
<td id="trueNum" style="color: #00A5FF;"></td>
|
||||
<td style="color: #00A5FF;"><span id="truePercent" style="font-size: 40px;"></span><span
|
||||
style="font-size: 20px;">%</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="typeTableHtml" style="float: left;width: 100%;height:66.6%;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="chart2" style="float:left;width: 40%;height:100%;"></div>
|
||||
</div>
|
||||
<div style="float:left;width: 100%;height:10px;">
|
||||
</div>
|
||||
<div style="float:left;width: 100%;height:calc((100% - 10px)*0.6);">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
|
||||
<div class="form-group form-inline" style="padding:0;height: 15px;">
|
||||
<div class="form-group pull-left">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control pull-left" id="reservationtimeMain"
|
||||
style="width:230px">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 240px;">
|
||||
<label class="col-sm-4 control-label"
|
||||
style="padding:0px 10px 0px 10px;line-height:30px;">诊断类型</label>
|
||||
<div class="col-sm-8 control-label" style="padding: 0px;">
|
||||
<select class="form-control select2 " id="zdType" name="zdType"
|
||||
style="width: 130px;height: 30px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 240px;">
|
||||
<label class="col-sm-4 control-label"
|
||||
style="padding:0px 10px 0px 10px;line-height:30px;">状态</label>
|
||||
<div class="col-sm-8 control-label" style="padding: 0px;">
|
||||
<select class="form-control select2 " id="adoptSt" name="adoptSt"
|
||||
style="width: 130px;height: 30px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
</html>
|
||||
87
WebRoot/jsp/alarm/proAlarmDataStopHisPointList.jsp
Normal file
87
WebRoot/jsp/alarm/proAlarmDataStopHisPointList.jsp
Normal file
@ -0,0 +1,87 @@
|
||||
<%@ 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">
|
||||
$(function () {
|
||||
$("#alarmDataStopTable").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/proAlarmDataStopHisPoint/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,
|
||||
alarmId: '${param.alarmId}',
|
||||
unitId: '${param.unitId}'
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.id);
|
||||
// },
|
||||
columns: [
|
||||
// {
|
||||
// checkbox: true, // 显示一个勾选框
|
||||
// },
|
||||
{
|
||||
field: 'pointId', // 返回json数据中的name
|
||||
title: '报警点描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '插入时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 16);
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("alarmDataStopTable");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="stopAlarmModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content" style="width: 800px;">
|
||||
<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">
|
||||
<table id="alarmDataStopTable"></table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
706
WebRoot/jsp/alarm/proAlarmList.jsp
Normal file
706
WebRoot/jsp/alarm/proAlarmList.jsp
Normal file
@ -0,0 +1,706 @@
|
||||
<%@ 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.scada.ProAlarm" %>
|
||||
<%request.setAttribute("STATUS_ALARM", ProAlarm.STATUS_ALARM); %>
|
||||
<%request.setAttribute("STATUS_ALARM_CONFIRM", ProAlarm.STATUS_ALARM_CONFIRM); %>
|
||||
<%request.setAttribute("STATUS_ALARM_RECOVER", ProAlarm.STATUS_ALARM_RECOVER); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!-- <html lang="zh-CN"> -->
|
||||
<!-- BEGIN HEAD -->
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||||
charset="utf-8"></script>
|
||||
<%--文件上传 minio--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
<!-- 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>
|
||||
|
||||
<%--文件上传 minio--%>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||||
<!-- 文件上传-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc" + "ript>")
|
||||
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc" + "ript>")
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
/*.main-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}*/
|
||||
|
||||
.my-skin .layui-layer-btn1 {
|
||||
border-color: #04B431 !important;
|
||||
background-color: #04B431 !important;;
|
||||
color: #fff !important;;
|
||||
}
|
||||
|
||||
.my-skin .layui-layer-btn2 {
|
||||
border-color: #5E610B !important;
|
||||
background-color: #5E610B !important;;
|
||||
color: #fff !important;;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
$(function () {
|
||||
// var flag = IsApp();
|
||||
// if (flag==true){
|
||||
|
||||
// }else{
|
||||
// $(".main-header").show();
|
||||
// $(".content-header").show();
|
||||
// $(".main-footer").show();
|
||||
// }
|
||||
initDate();
|
||||
|
||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: unitId}, function (data) {
|
||||
$("#processSection").empty();
|
||||
var selelct_ = $("#processSection").select2({
|
||||
data: data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_.val('').trigger("change");
|
||||
selelct_.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
var selelct_2Data = jQuery.parseJSON('${AlarmMoldCodeEnum}');
|
||||
var selelct_2 = $("#alarmType").select2({
|
||||
data: selelct_2Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct_2.val('').trigger("change");
|
||||
selelct_2.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
var alarmLevelsData = jQuery.parseJSON('${AlarmLevelsCodeEnum}');
|
||||
var alarmLevelsSelect = $("#alarmLevels").select2({
|
||||
data: alarmLevelsData,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
alarmLevelsSelect.val('').trigger("change");
|
||||
alarmLevelsSelect.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
var selelct_3Data = jQuery.parseJSON('[{"id":"${STATUS_ALARM}","text":"报警"},{"id":"${STATUS_ALARM_CONFIRM}","text":"报警确认"},{"id":"${STATUS_ALARM_RECOVER}","text":"报警恢复"}]');
|
||||
<%--var selelct_3Data = jQuery.parseJSON('[{"id":"${STATUS_ALARM}","text":"报警"},{"id":"${STATUS_ALARM_RECOVER}","text":"报警恢复"}]');--%>
|
||||
var selelct_3 = $("#status").select2({
|
||||
data: selelct_3Data,
|
||||
cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
language: "zh-CN",
|
||||
minimumInputLength: 0,
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_3.val("${STATUS_ALARM}").trigger("change");
|
||||
selelct_3.on("change", function (e) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/alarm/proAlarm/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [15, 30, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 15, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: "client", //分页方式:client客户端分页,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(),
|
||||
companyId: unitId,
|
||||
pSectionCode: $("#processSection").val(),
|
||||
alarmType: $("#alarmType").val(),
|
||||
alarmlevel: $("#alarmLevels").val(),
|
||||
status: $("#status").val(),
|
||||
sdt: beginTimeStore,
|
||||
edt: endTimeStore
|
||||
}
|
||||
},
|
||||
sortName: 'alarm_time', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
// onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
// viewFun(row.mpointcode);
|
||||
// },
|
||||
columns: [
|
||||
{
|
||||
field: 'pointCode', // 返回json数据中的name
|
||||
title: '报警点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'pointName', // 返回json数据中的name
|
||||
title: '报警名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'alarmTime', // 返回json数据中的name
|
||||
title: '报警时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: 140, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 16);
|
||||
}
|
||||
}, {
|
||||
field: 'alarmLevel', // 返回json数据中的name
|
||||
title: '报警等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
for (let i = 0; i < alarmLevelsData.length; i++) {
|
||||
if(alarmLevelsData[i].id=value){
|
||||
return alarmLevelsData[i].text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'describe', // 返回json数据中的name
|
||||
title: '报警内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'confirmerName', // 返回json数据中的name
|
||||
title: '确认人', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'confirmTime', // 返回json数据中的name
|
||||
title: '确认时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 140, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null) {
|
||||
return value.substring(0, 16);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'confirmContent', // 返回json数据中的name
|
||||
// title: '确认内容', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle', // 上下居中
|
||||
// // width: 60 ,// 定义列的宽度,单位为像素px
|
||||
// // formatter: function (value, row, index) {
|
||||
// // return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
||||
// // }
|
||||
// },
|
||||
{
|
||||
field: 'alarmTypeName', // 返回json数据中的name
|
||||
title: '报警类别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 60 // 定义列的宽度,单位为像素px
|
||||
}, {
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '报警状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
width: 40, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '${STATUS_ALARM}':
|
||||
return "报警";
|
||||
break;
|
||||
case '${STATUS_ALARM_RECOVER}':
|
||||
return "报警恢复";
|
||||
break;
|
||||
case '${STATUS_ALARM_CONFIRM}':
|
||||
return "报警确认";
|
||||
break;
|
||||
default:
|
||||
return "-";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}, {
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 180, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
// console.log(row)
|
||||
var buts = "";
|
||||
if (row.alarmType.indexOf('_Pro') > 0 || row.alarmType == 'Type_HYDB') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="历史曲线" onclick="showHis(\'' + row.pointCode + '\')"><i class="fa fa-line-chart"></i><span class="hidden-md hidden-lg"> 历史曲线</span></button>';
|
||||
// buts+='<button class="btn btn-default btn-sm" title="报警确认" onclick="confirmSt(\'' + row.id + '\')"><i class="fa fa-check"></i><span class="hidden-md hidden-lg"> 报警确认</span></button>';
|
||||
}
|
||||
if (row.status == '${STATUS_ALARM}') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="报警确认" onclick="confirmFun(\'' + row.pointCode + '\',\'' + row.alarmTime + '\',\'' + row.bizId + '\')"><i class="fa fa-check"></i><span class="hidden-md hidden-lg">报警确认</span></button>';
|
||||
}
|
||||
if (row.cameraFileSt == 'true') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="报警视频" onclick="cameraViewFun(\'' + row.id + '\',\'' + row.cameraIds + '\',\'' + row.alarmTime + '\')"><i class="fa fa-video-camera"></i><span class="hidden-md hidden-lg">报警视频</span></button>';
|
||||
}
|
||||
if (row.pointCode == 'data_stop_alarm') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="中断数据" onclick="stopAlarmView(\'' + row.id + '\',\'' + row.bizId + '\')"><i class="fa fa-eye-slash"></i><span class="hidden-md hidden-lg">中断数据</span></button>';
|
||||
}
|
||||
if (row.alarmType == 'Type_Emergency') {
|
||||
buts += '<button class="btn btn-default btn-sm" title="转为工单" onclick="toYJYAOrder(\'' + row.pointCode + '\')"><i class="fa fa-share"></i><span class="hidden-md hidden-lg"> 转为工单</span></button>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" title="转为工单" onclick="addFun4Abnormity(\'' + row.id + '\',\'' + row.bizId + '\',\'' + row.describe + '\',\'' + row.processSectionCode + '\')"><i class="fa fa-share"></i><span class="hidden-md hidden-lg"> 转为工单</span></button>';
|
||||
}
|
||||
buts += '<button class="btn btn-default btn-sm" title="详细数据" onclick="viewFun(\'' + row.id + '\',\'' + row.bizId + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 详细数据</span></button>';
|
||||
|
||||
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
function showHis(mpcode) {
|
||||
$.post(ext.contextPath + '/data/showOnlyLine.do', {mpcode: mpcode}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('curveModal');
|
||||
});
|
||||
}
|
||||
|
||||
function stopAlarmView(alarmId, unitId) {
|
||||
$.post(ext.contextPath + '/alarm/proAlarmDataStopHisPoint/showList.do', {
|
||||
alarmId: alarmId,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('stopAlarmModal');
|
||||
});
|
||||
}
|
||||
|
||||
function viewFun(id, bizId) {
|
||||
$.post(ext.contextPath + '/alarm/proAlarm/doView.do', {
|
||||
id: id,
|
||||
unitId: bizId
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subViewModal');
|
||||
});
|
||||
}
|
||||
|
||||
var viewAlarmCameraWindow = null;
|
||||
|
||||
function cameraViewFun(id, cameraIds, alarmTime) {
|
||||
alarmTime = getPlusTime(alarmTime, "-5", "min");
|
||||
alarmTime = alarmTime.substring(0, 16);
|
||||
viewAlarmCameraWindow = window.open(ext.contextPath + "/work/camera/cameraIdsHisShowList.do?cameraIds=" + cameraIds + "&hisData=" + alarmTime + "&alarmId=" + id, 'nowAlarmViewCamera', 'width=1920,height=1080,top=0,left=0,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
viewAlarmCameraWindow.focus();
|
||||
}
|
||||
|
||||
function toYJYAOrder(pointCode) {
|
||||
window.parent.addTab("alarm_YJYAOrder", "应急预案", "/command/emergencyRecords/dodrillview.do?id=" + pointCode);
|
||||
}
|
||||
|
||||
/*function confirmFun(pointCode, alarmTime, bizid) {
|
||||
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(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/alarm/proAlarm/alarmConfirm.do', {
|
||||
pointCode: pointCode,
|
||||
alarmTime: alarmTime,
|
||||
bizid: bizid
|
||||
}, function (data) {
|
||||
console.log(data)
|
||||
if (data.code == 1) {
|
||||
showAlert('s', '确认成功', 'mainAlertdiv');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
function confirmFun(pointCode, alarmTime, bizid) {
|
||||
stopBubbleDefaultEvent();
|
||||
layer.open({
|
||||
title: '报警确认内容',
|
||||
type: 1,
|
||||
closeBtn: 0,
|
||||
area: '30%',
|
||||
// offset:"auto",
|
||||
fixed: false,
|
||||
skin: 'bgfff', //没有背景色
|
||||
shadeClose: true,
|
||||
// formType: 2, //输入框类型,支持0(文本)默认1(密码)2(多行文本)
|
||||
// value: ' ', //初始时的值,默认空字符
|
||||
// maxlength: 200, //可输入文本的最大长度,默认500
|
||||
// area: ['300px', '200px'], //自定义文本域宽高
|
||||
btn: ["确认", "关闭"],
|
||||
content: ('<div id="confirmOpen" style="float: left;width: 100%;height: 250px;padding: 15px;"></div>'),
|
||||
yes: function (index) {//layer.msg('yes'); //点击确定回调
|
||||
// 只有当点击确认时才会执行这里
|
||||
$.post(ext.contextPath + '/alarm/proAlarm/alarmConfirm.do', {
|
||||
pointCode: pointCode,
|
||||
alarmTime: alarmTime,
|
||||
bizid: bizid,
|
||||
confirmContent: $('#confirmContent').val()
|
||||
}, function (data) {
|
||||
if (data.code == 1) {
|
||||
// showAlert('s', '确认成功', 'mainAlertdiv');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
} else {
|
||||
showAlert('d', data.msg, 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
layer.close(index);
|
||||
closeModal('subViewModal');
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
},
|
||||
success: function () {
|
||||
let html = "";
|
||||
html += "<div style='float: left;width: 20%;height: 45px;line-height: 45px;text-align: center;font-weight: 700;'>确认人</div>";
|
||||
html += "<div style='float: left;width: 30%;height: 45px;line-height: 45px;text-align: center;'>" + '${userName}' + "</div>";
|
||||
html += "<div style='float: left;width: 20%;height: 45px;line-height: 45px;text-align: center;font-weight: 700;'>确认时间</div>";
|
||||
html += "<div style='float: left;width: 30%;height: 45px;line-height: 45px;text-align: center;'>" + getNowTime().substring(0, 16) + "</div>";
|
||||
|
||||
html += "<div style='float: left;width: 20%;height: 45px;line-height: 175px;text-align: center;font-weight: 700;'>确认内容</div>";
|
||||
html += "<div style='float: left;width: 80%;height: calc(100% - 45px);'>" +
|
||||
"<textarea class='form-control' style='height: 100%;' id='confirmContent' ></textarea>" +
|
||||
"</div>";
|
||||
$('#confirmOpen').html(html);
|
||||
|
||||
}
|
||||
// end: function () {
|
||||
// layer.closeAll();
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
var beginTimeStore = '';
|
||||
var endTimeStore = '';
|
||||
|
||||
function initDate() {
|
||||
//定义locale汉化插件
|
||||
// beginTimeStore = moment().subtract(7, 'days').format('YYYY-MM-DD HH:mm');
|
||||
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD') + ' 00:00';
|
||||
endTimeStore = moment().subtract(0, 'days').format('YYYY-MM-DD') + ' 23:59';
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtimeMain').daterangepicker({
|
||||
"timePicker": true,
|
||||
"timePicker24Hour": true,
|
||||
"linkedCalendars": false,
|
||||
"autoUpdateInput": false,
|
||||
"timePickerIncrement": 10,
|
||||
"locale": locale,
|
||||
//汉化按钮部分
|
||||
ranges: {
|
||||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||||
},
|
||||
startDate: beginTimeStore,
|
||||
endDate: endTimeStore
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore = start.format(this.locale.format);
|
||||
endTimeStore = end.format(this.locale.format);
|
||||
if (!this.startDate) {
|
||||
this.element.val('');
|
||||
} else {
|
||||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||||
}
|
||||
});
|
||||
$('#reservationtimeMain').val(beginTimeStore + locale.separator + endTimeStore);
|
||||
};
|
||||
|
||||
/*var addFun4Abnormity = function (id, bizid, describe, processSectionCode) {
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doadd_new.do', {
|
||||
unitId: bizid,
|
||||
abnormityDescription: describe,
|
||||
processSectionCode: processSectionCode
|
||||
}, function (data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModalAbnorm');
|
||||
});
|
||||
};*/
|
||||
|
||||
var addFun4Abnormity = function (id, bizid, describe, processSectionCode) {
|
||||
layer.confirm('选择生成的工单', {
|
||||
title: "操作提示",
|
||||
btn: ['异常上报', '维修工单', '运行工单'],//可以无限个按钮
|
||||
skin: "my-skin",
|
||||
btn3: function (index, layero) {
|
||||
//按钮【按钮三】的回调
|
||||
layer.close(index)// 关闭当前弹窗
|
||||
$.post(ext.contextPath + '/maintenance/addDefect.do', {bizId: unitId}, function (data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
}
|
||||
}, function (index, layero) {
|
||||
//按钮【按钮一】的回调
|
||||
layer.close(index)// 关闭当前弹窗
|
||||
$.post(ext.contextPath + '/maintenance/abnormity/doadd_new.do', {
|
||||
unitId: bizid,
|
||||
abnormityDescription: describe,
|
||||
processSectionCode: processSectionCode
|
||||
}, function (data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModalAbnorm');
|
||||
});
|
||||
}, function (index, layero) {
|
||||
//按钮【按钮二】的回调
|
||||
layer.close(index)// 关闭当前弹窗
|
||||
$.post(ext.contextPath + '/workorder/workorderDetail/doAddRepair.do', {unitId: unitId}, function (data) {
|
||||
$("#subDivAbnorm").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
</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="menu4SelectDiv"></div>
|
||||
|
||||
<%-- 异常上报页面的div--%>
|
||||
<div id="subDivAbnorm"></div>
|
||||
<div id="equ4SelectDiv"></div>
|
||||
<div id="library4SelectDiv"></div>
|
||||
<div id="problemTyp4SelectDiv"></div>
|
||||
<div id="user4SelectDiv"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
|
||||
<div>
|
||||
<div class="form-group form-inline" style="padding:0;height: 15px;">
|
||||
<div class="form-group pull-left">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control pull-left" id="reservationtimeMain"
|
||||
style="width:230px">
|
||||
</div>
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<input type="text" id="search_name" name="search_name" class="form-control"
|
||||
placeholder="内容">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group pull-right">
|
||||
<div class="input-group input-group-sm " style="width: 200px;">
|
||||
<label class="col-sm-4 control-label" style="padding:0px 10px 0px 10px;line-height:30px;">工艺段</label>
|
||||
<div class="col-sm-8 control-label" style="padding: 0px;">
|
||||
<select class="form-control select2 " id="processSection" name="processSection"
|
||||
style="width: 130px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 190px;">
|
||||
<label class="col-sm-5 control-label" style="padding:0px 10px 0px 10px;line-height:30px;">报警类别</label>
|
||||
<div class="col-sm-7 control-label" style="padding: 0px;">
|
||||
<select class="form-control select2 " id="alarmType" name="alarmType"
|
||||
style="width: 110px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 190px;">
|
||||
<label class="col-sm-5 control-label" style="padding:0px 10px 0px 10px;line-height:30px;">报警等级</label>
|
||||
<div class="col-sm-7 control-label" style="padding: 0px;">
|
||||
<select class="form-control select2 " id="alarmLevels" name="alarmLevels"
|
||||
style="width: 110px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group input-group-sm " style="width: 190px;">
|
||||
<label class="col-sm-5 control-label" style="padding:0px 10px 0px 10px;line-height:30px;">报警状态</label>
|
||||
<div class="col-sm-7 control-label" style="padding: 0px;">
|
||||
<select class="form-control select2 " id="status" name="status"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<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>
|
||||
<!-- 引入daterangepicker-->
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
123
WebRoot/jsp/alarm/proAlarmView.jsp
Normal file
123
WebRoot/jsp/alarm/proAlarmView.jsp
Normal file
@ -0,0 +1,123 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@page import="com.sipai.entity.scada.ProAlarm" %>
|
||||
<%request.setAttribute("STATUS_ALARM", ProAlarm.STATUS_ALARM); %>
|
||||
<%request.setAttribute("STATUS_ALARM_CONFIRM", ProAlarm.STATUS_ALARM_CONFIRM); %>
|
||||
<%request.setAttribute("STATUS_ALARM_RECOVER", ProAlarm.STATUS_ALARM_RECOVER); %>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subViewModal">
|
||||
<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="subForm2">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警点</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.pointCode}
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警名称</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.pointName}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警等级</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.alarmLevelName}
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警类别</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.alarmTypeName}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警状态</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
<c:if test="${proAlarm.status==STATUS_ALARM}">报警</c:if>
|
||||
<c:if test="${proAlarm.status==STATUS_ALARM_RECOVER}">报警恢复</c:if>
|
||||
<c:if test="${proAlarm.status==STATUS_ALARM_CONFIRM}">报警确认</c:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警时间</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.alarmTime}
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">持续时间</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.duration}
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${proAlarm.alarmType=='LimitValue_Pro'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警值</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.originalStatus}
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警线</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.alarmLine}
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" readonly>${proAlarm.describe}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:if test="${proAlarm.status!=STATUS_ALARM}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">确认人</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.confirmerName}
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">确认时间</label>
|
||||
<div class="col-sm-4" style="padding-top: 7px;">
|
||||
${proAlarm.confirmTime}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">确认内容</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" readonly>${proAlarm.confirmContent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<c:if test="${proAlarm.status==STATUS_ALARM}">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onclick="confirmFun('${proAlarm.pointCode}','${proAlarm.alarmTime}','${proAlarm.bizId}')">
|
||||
报警确认
|
||||
</button>
|
||||
</c:if>
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user