first commit
This commit is contained in:
571
WebRoot/jsp/hqconfig/enterRecordList.jsp
Normal file
571
WebRoot/jsp/hqconfig/enterRecordList.jsp
Normal file
@ -0,0 +1,571 @@
|
||||
<%@ 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>
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<style>
|
||||
#tv {
|
||||
border: 1px solid #D6D6D6;
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
width: 300px;
|
||||
height: 400px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
<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">
|
||||
// $.post(ext.contextPath + "/hqconfig/enterRecord/gettype.do", {}, function (data) {
|
||||
//
|
||||
// var selelct = $("#type_name1").select2({
|
||||
// data: data,
|
||||
// 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('').trigger("change");
|
||||
// }, 'json');
|
||||
|
||||
|
||||
var viewFun = function (id) {
|
||||
$.post(ext.contextPath + '/hqconfig/enterRecord/view.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(willDelete => {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/hqconfig/enterRecord/delete.do', {id: id}, function (data) {
|
||||
if (data == 1) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$.post(ext.contextPath + '/hqconfig/enterRecordQualification/deletebyenterRecordId.do', {id: id}, function (data) {
|
||||
});
|
||||
$.post(ext.contextPath + '/hqconfig/Score/deletebyenterRecordId.do', {id: id}, function (data) {
|
||||
});
|
||||
} 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 + '/hqconfig/enterRecord/deletes.do', {ids: datas}, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
$.post(ext.contextPath + '/hqconfig/enterRecordQualification/deletebyenterRecordId.do', {id: datas}, function (data) {
|
||||
});
|
||||
$.post(ext.contextPath + '/hqconfig/Score/deletebyenterRecordId.do', {id: datas}, function (data) {
|
||||
});
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
var delName = function () {
|
||||
$('#search_name').val("")
|
||||
$('#sname').val("")
|
||||
};
|
||||
var delTime = function () {
|
||||
$('#reservationtimeD').val("")
|
||||
};
|
||||
|
||||
function initDate2() {
|
||||
//定义locale汉化插件
|
||||
beginTimeStore2 = moment().subtract(6, 'days').format('YYYY-MM-DD');
|
||||
endTimeStore2 = moment().subtract(-1, 'days').format('YYYY-MM-DD');
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月",
|
||||
"九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
$('#reservationtime2').daterangepicker(
|
||||
{
|
||||
"timePicker": false,
|
||||
"timePicker24Hour": false,
|
||||
"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: beginTimeStore2,
|
||||
endDate: endTimeStore2
|
||||
},
|
||||
function (start, end, label) {
|
||||
beginTimeStore2 = start.format(this.locale.format);
|
||||
endTimeStore2 = 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));
|
||||
}
|
||||
});
|
||||
$('#reservationtime2').val(
|
||||
beginTimeStore2 + locale.separator + endTimeStore2);
|
||||
//$('#reservationtime2').daterangepicker({autoUpdateInput:false})
|
||||
};
|
||||
// $.post(ext.contextPath + "/hqconfig/riskGrade/getAreaManage.do", {}, function (data) {
|
||||
//
|
||||
// var selelct = $("#search_name").select2({
|
||||
// data: data,
|
||||
// placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
// 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');
|
||||
$(function () {
|
||||
initDate1();
|
||||
treeView();
|
||||
$(".daterangepicker").css({'width': '680px'});
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/hqconfig/enterRecord/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
// showColumns: true,
|
||||
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(),
|
||||
name: $('#name').val(),
|
||||
reservationtimeD: $('#reservationtimeD').val(),
|
||||
// type_name: $('#type_name1').val(),
|
||||
enterRecordClass: $('#enterRecordClass').val(),
|
||||
hasArea: 1,
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
/* onClickRow: function (row) {//单击行事件,执行查看功能
|
||||
viewFun(row.id);
|
||||
}, */
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'enter.caption', // 返回json数据中的name
|
||||
title: '人员名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
// {
|
||||
// field: 'area.name', // 返回json数据中的name
|
||||
// title: '一级区域', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// },
|
||||
// {
|
||||
// field: 'areaT.name', // 返回json数据中的name
|
||||
// title: '二级区域', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle' // 上下居中
|
||||
// },
|
||||
{
|
||||
field: 'areaText', // 返回json数据中的name
|
||||
title: '区域', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'intime', // 返回json数据中的name
|
||||
title: '进入时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'outtime', // 返回json数据中的name
|
||||
title: '离开时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'durationText', // 返回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="hqconfig/enterRecord/delete.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("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
$('#table').bootstrapTable('hideColumn', 'legalPerson');
|
||||
$('#table').bootstrapTable('hideColumn', 'taxNumber');
|
||||
$('#table').bootstrapTable('hideColumn', 'typeStatus');
|
||||
$.post(ext.contextPath + "/hqconfig/enterRecordClass/getenterRecordClass4Select.do", {}, function (data) {
|
||||
var selelct = $("#enterRecordClass").select2({
|
||||
data: data,
|
||||
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();
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
|
||||
});
|
||||
|
||||
//点击空白隐藏树
|
||||
$(document).mouseup(function (e) {
|
||||
var divTree = $('#tv'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
if (divTree.css("display") != 'none') {
|
||||
divTree.hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "清空",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
$('#reservationtimeD').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
$('#reservationtimeD').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#reservationtimeD').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: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = 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));
|
||||
}
|
||||
});
|
||||
|
||||
$('#reservationtimeD').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$('#reservationtimeD').val('');
|
||||
});
|
||||
};
|
||||
|
||||
function treeView () {
|
||||
var nodeData = [];
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/work/areaManage/getAreaManageJson.do',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
nodeData = data;
|
||||
}
|
||||
})
|
||||
|
||||
$('#tv').treeview({
|
||||
data: nodeData, // 节点数据
|
||||
levels: 1, // 节点层级数
|
||||
color: "#000", // 每一级通用的 节点字体颜色
|
||||
backColor: "#fff", // 每一级通用的 节点字背景色
|
||||
onhoverColor: "skyblue", // 选中浮动颜色
|
||||
showBorder: false, // 不显示边框
|
||||
showTags: true, // 是否在每个节点的右侧显示标签。 其值必须在每个节点的数据结构中提供
|
||||
highlightSelected: true, // 是否突出显示选定的节点
|
||||
selectedColor: "#fff", // 设置选定节点的前景色
|
||||
selectedBackColor: "skyblue", // 设置选定节点的背景色
|
||||
onNodeSelected: function (event, data) {
|
||||
$('#sname').val(data.text);
|
||||
$('#search_name').val(data.id);
|
||||
$('#tv').hide();
|
||||
}
|
||||
})
|
||||
|
||||
$('#sname').click(function () {
|
||||
$('#tv').show();
|
||||
})
|
||||
|
||||
if ('${param.selectId}' != '') {
|
||||
var node = $('#tv').treeview('findNodes', ['${param.selectId}', 'id']);
|
||||
$('#tv').treeview('selectNode', [node[0], { silent: true }]);
|
||||
console.log("node is ", node)
|
||||
$("#search_name").val(node[0].id);
|
||||
$("#sname").val(node[0].text);
|
||||
}
|
||||
|
||||
$("#wrap-clear").click(function(){
|
||||
$("#search_name").val("");
|
||||
$("#sname").val("");
|
||||
});
|
||||
}
|
||||
</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) -->
|
||||
<!-- Main content -->
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="qualificationedit"></div>
|
||||
<div id="qualificationadd"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||
class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label pull-left" style="margin-top: 5px">区域:</label>
|
||||
<input type="text" id="sname" name="sname" class="form-control pull-left"
|
||||
style="height:34px;" autocomplete="off" readonly="true" placeholder="请选择" />
|
||||
<button class="btn btn-default" style="height:34px;" onclick="delName();"><i
|
||||
class="fa fa-close"></i></button>
|
||||
<input type="hidden" id="search_name" name="search_name"/>
|
||||
<div id="tv"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 200px;">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px; border-radius: 5px; width: 230px"
|
||||
id="reservationtimeD" placeholder="请选择日期">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right"
|
||||
style="height:34px;" placeholder="模糊搜索: 人员名称">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height:34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFileUpload.js" charset="utf-8"></script>
|
||||
|
||||
|
||||
<!-- 引入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>
|
||||
1011
WebRoot/jsp/hqconfig/hqAlarmAnaList.jsp
Normal file
1011
WebRoot/jsp/hqconfig/hqAlarmAnaList.jsp
Normal file
File diff suppressed because it is too large
Load Diff
28
WebRoot/jsp/hqconfig/hqAlarmRecordAdd.jsp
Normal file
28
WebRoot/jsp/hqconfig/hqAlarmRecordAdd.jsp
Normal file
@ -0,0 +1,28 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>My JSP 'hqAlarmRecordAdd.jsp' starting page</title>
|
||||
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
This is my JSP page. <br>
|
||||
</body>
|
||||
</html>
|
||||
160
WebRoot/jsp/hqconfig/hqAlarmRecordEdit.jsp
Normal file
160
WebRoot/jsp/hqconfig/hqAlarmRecordEdit.jsp
Normal file
@ -0,0 +1,160 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/hqconfig/hqAlarmRecord/doUpdate.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
$(".modal").modal("hide");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
var confirm = function(id){
|
||||
|
||||
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证 备注不能为空的
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
swal({
|
||||
text: "确认消除此报警记录?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete){
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/hqconfig/hqAlarmRecord/doEditConfirm.do',
|
||||
{id : id, content: $("#hqAlarmRecordContent").val()}, function(data) {
|
||||
if(data.code=="1"){
|
||||
// 关闭这个填写备注的界面
|
||||
closeModal("subModal");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','消除失败','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
$(function(){
|
||||
if('${hqAlarmRecord.remark}' != "") {
|
||||
$("#btn_save").attr("disabled", true);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
hqAlarmRecordContent: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '备注不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">详情</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${hqAlarmRecord.id}">
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警内容</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" value ="${hqAlarmRecord.name}" readonly="readonly">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">报警区域</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="areaName" name="areaName" class="form-control pull-right" value ="${hqAlarmRecord.areaName}" readonly="readonly">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">风险等级</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="riskLevel" name="riskLevel" class="form-control pull-right" value ="${hqAlarmRecord.riskLevel}" readonly="readonly">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="state" class="form-control pull-right" name="state" disabled >
|
||||
<option value="1" <c:if test="${hqAlarmRecord.state==1}"> selected </c:if>>报警中</option>
|
||||
<option value="2" <c:if test="${hqAlarmRecord.state==2}"> selected</c:if>>已消除</option>
|
||||
<option value="3" <c:if test="${hqAlarmRecord.state==3}"> selected</c:if>>已确认</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="hqAlarmRecordContent" name="hqAlarmRecordContent" rows="3"
|
||||
placeholder="名称">${hqAlarmRecord.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-danger" onclick="confirm('${hqAlarmRecord.id}')" id="btn_save">消除</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
820
WebRoot/jsp/hqconfig/hqAlarmRecordList.jsp
Normal file
820
WebRoot/jsp/hqconfig/hqAlarmRecordList.jsp
Normal file
@ -0,0 +1,820 @@
|
||||
<%@ 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-fileinput/css/fileinput.min.css"/>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ztree/css/metroStyle/metroStyle.css"
|
||||
rel="stylesheet" type="text/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>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/ztree/js/jquery.ztree.all.min.js"></script>
|
||||
|
||||
<style>
|
||||
#tv {
|
||||
border: 1px solid #D6D6D6;
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
width: 280px;
|
||||
height: 400px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#tv2 {
|
||||
border: 1px solid #D6D6D6;
|
||||
display: none;
|
||||
margin-top: 5px;
|
||||
width: 280px;
|
||||
height: 400px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/hqconfig/hqAlarmRecord/doAdd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var confirm1 = function (id) {
|
||||
// var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/hqconfig/hqAlarmRecord/doEdit.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
var confirm2 = function (id) {
|
||||
swal({
|
||||
text: "确认消除此报警记录?",
|
||||
dangerMode: true,
|
||||
// type: "input",
|
||||
// inputPlaceholder: "输入订单金额",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function (willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/hqconfig/hqAlarmRecord/doEdit.do', {id: id}, function (data) {
|
||||
if (data.code == "1") {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/hqconfig/hqAlarmRecord/dodel.do', {id: id}, function (data) {
|
||||
if (data.code == "1") {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', '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 + '/hqconfig/hqAlarmRecord/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var refreshTable = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
function initDate1() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
// $('#dt1').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(6, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
// $('#dt1').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#dt1').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: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = 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));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function initDate2() {
|
||||
var locale = {
|
||||
"format": 'YYYY-MM-DD HH:mm',
|
||||
"separator": " ~ ",
|
||||
"applyLabel": "确定",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
};
|
||||
|
||||
var oldreservationtime1 = "${param.oldreservationtime1}";
|
||||
if (oldreservationtime1 != "" && oldreservationtime1.length > 0) {
|
||||
beginTimeStore1 = oldreservationtime1.substring(0, 16);
|
||||
endTimeStore1 = oldreservationtime1.substring(19, 36);
|
||||
// $('#dt2').val(oldreservationtime1);
|
||||
} else {
|
||||
beginTimeStore1 = moment().subtract(6, 'days').format('YYYY-MM-DD HH:mm');
|
||||
endTimeStore1 = moment().subtract(0, 'days').format('YYYY-MM-DD HH:mm');
|
||||
// $('#dt2').val(beginTimeStore1 + locale.separator + endTimeStore1);
|
||||
}
|
||||
|
||||
$('#dt2').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: beginTimeStore1,
|
||||
endDate: endTimeStore1
|
||||
}, function (start, end, label) {
|
||||
beginTimeStore1 = start.format(this.locale.format);
|
||||
endTimeStore1 = 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));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//初始化树(区域)
|
||||
function treeView_Area() {
|
||||
var nodeData = [];
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/work/areaManage/getAreaManageJson.do',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
nodeData = data;
|
||||
}
|
||||
})
|
||||
|
||||
$('#tv').treeview({
|
||||
data: nodeData, // 节点数据
|
||||
levels: 1, // 节点层级数
|
||||
color: "#000", // 每一级通用的 节点字体颜色
|
||||
backColor: "#fff", // 每一级通用的 节点字背景色
|
||||
onhoverColor: "skyblue", // 选中浮动颜色
|
||||
showBorder: false, // 不显示边框
|
||||
showTags: true, // 是否在每个节点的右侧显示标签。 其值必须在每个节点的数据结构中提供
|
||||
highlightSelected: true, // 是否突出显示选定的节点
|
||||
selectedColor: "#fff", // 设置选定节点的前景色
|
||||
selectedBackColor: "skyblue", // 设置选定节点的背景色
|
||||
onNodeSelected: function (event, data) {
|
||||
$('#search_areaName').val(data.text);
|
||||
$('#search_areaId').val(data.id);
|
||||
$('#tv').hide();
|
||||
}
|
||||
})
|
||||
|
||||
//通过分页进来的 指定筛选该区域
|
||||
if ('${param.selectId}' != '') {
|
||||
var node = $('#tv').treeview('findNodes', ['${param.selectId}', 'id']);
|
||||
$('#tv').treeview('selectNode', [node[0], {silent: true}]);
|
||||
// console.log("node is ", node)
|
||||
$("#search_areaId").val(node[0].id);
|
||||
$("#search_areaName").val(node[0].text);
|
||||
|
||||
//按新的筛选条件 筛选列表
|
||||
refreshTable();
|
||||
}
|
||||
|
||||
$('#search_areaName').click(function () {
|
||||
$('#tv').show();
|
||||
})
|
||||
|
||||
$("#wrap-clear").click(function () {
|
||||
$("#search_areaName").val("");
|
||||
$("#search_areaId").val("");
|
||||
});
|
||||
}
|
||||
|
||||
//初始化树(类型)
|
||||
function treeView_Type() {
|
||||
var nodeData = [];
|
||||
|
||||
$.ajax({
|
||||
url: ext.contextPath + '/work/alarmTypes/getAlarmTypesJson.do',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
nodeData = data;
|
||||
}
|
||||
})
|
||||
|
||||
$('#tv2').treeview({
|
||||
data: nodeData, // 节点数据
|
||||
levels: 1, // 节点层级数
|
||||
color: "#000", // 每一级通用的 节点字体颜色
|
||||
backColor: "#fff", // 每一级通用的 节点字背景色
|
||||
onhoverColor: "skyblue", // 选中浮动颜色
|
||||
showBorder: false, // 不显示边框
|
||||
showTags: true, // 是否在每个节点的右侧显示标签。 其值必须在每个节点的数据结构中提供
|
||||
highlightSelected: true, // 是否突出显示选定的节点
|
||||
selectedColor: "#fff", // 设置选定节点的前景色
|
||||
selectedBackColor: "skyblue", // 设置选定节点的背景色
|
||||
onNodeSelected: function (event, data) {
|
||||
$('#search_typeName').val(data.text);
|
||||
$('#search_typeId').val(data.id);
|
||||
$('#tv2').hide();
|
||||
}
|
||||
})
|
||||
|
||||
$('#search_typeName').click(function () {
|
||||
$('#tv2').show();
|
||||
})
|
||||
|
||||
$("#wrap-clear").click(function () {
|
||||
$("#search_typeName").val("");
|
||||
$("#search_typeId").val("");
|
||||
});
|
||||
}
|
||||
|
||||
//点击空白隐藏树(区域和类型)
|
||||
$(document).mouseup(function (e) {
|
||||
var divTree = $('#tv'); // 设置目标区域
|
||||
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
||||
if (divTree.css("display") != 'none') {
|
||||
divTree.hide();
|
||||
}
|
||||
}
|
||||
var divTree2 = $('#tv2'); // 设置目标区域
|
||||
if (!divTree2.is(e.target) && divTree2.has(e.target).length === 0) {
|
||||
if (divTree2.css("display") != 'none') {
|
||||
divTree2.hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
var delNameArea = function () {
|
||||
$('#search_areaName').val("")
|
||||
$('#search_areaId').val("")
|
||||
};
|
||||
|
||||
var delNameType = function () {
|
||||
$('#search_typeName').val("")
|
||||
$('#search_typeId').val("")
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
//加载报警时间
|
||||
initDate1();
|
||||
//加载消除时间
|
||||
initDate2();
|
||||
|
||||
$("#risklevelForSelect").on("change", function (e) {
|
||||
refreshTable();
|
||||
});
|
||||
$("#riskStatusForSelect").on("change", function (e) {
|
||||
refreshTable();
|
||||
});
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/hqconfig/hqAlarmRecord/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
checkboxHeader: true,
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
risklevelForSelect: $('#risklevelForSelect').val(),
|
||||
riskStatusForSelect: $('#riskStatusForSelect').val(),
|
||||
|
||||
dt1: $('#dt1').val(),
|
||||
dt2: $('#dt2').val(),
|
||||
|
||||
search_areaId: $('#search_areaId').val(),
|
||||
search_typeId: $('#search_typeId').val(),
|
||||
searchContent: $('#searchContent').val()
|
||||
|
||||
/*search_warehouseinfor: $('#search_warehouseinfor').val(),*/
|
||||
/*search_shelf: $('#search_shelf').val(),*/
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
title: '序号',
|
||||
align: "center",
|
||||
valign: 'middle',
|
||||
width: 40,
|
||||
formatter: function (value, row, index) {
|
||||
//获取每页显示的数量
|
||||
var pageSize = $('#table').bootstrapTable('getOptions').pageSize;
|
||||
//获取当前是第几页
|
||||
var pageNumber = $('#table').bootstrapTable('getOptions').pageNumber;
|
||||
//返回序号,注意index是从0开始的,所以要加上1
|
||||
return pageSize * (pageNumber - 1) + index + 1;
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
width: '150',
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '报警内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
width: '130',
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '报警时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'areaName', // 返回json数据中的shelfclass
|
||||
title: '报警区域', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '40',
|
||||
field: 'riskLevel', // 返回json数据中的shelfclass
|
||||
title: '风险等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
return value == '' ? '-' : value;
|
||||
},
|
||||
cellStyle: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 'A':
|
||||
return {css: {"background-color": "#FF0000"}};
|
||||
case 'B':
|
||||
return {css: {"background-color": "#FF9900"}};
|
||||
case 'C':
|
||||
return {css: {"background-color": "#FFFF00"}};
|
||||
case 'D':
|
||||
return {css: {"background-color": "#0066FF"}};
|
||||
default:
|
||||
value = "-"
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
width: '125',
|
||||
field: 'eliminatedt', // 返回json数据中的shelfclass
|
||||
title: '消除时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '125',
|
||||
field: 'confirmdt', // 返回json数据中的shelfclass
|
||||
title: '确认时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '125',
|
||||
field: 'remark', // 返回json数据中的shelfclass
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '70',
|
||||
field: 'state', // 返回json数据中的shelfclass
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '报警中';
|
||||
case '2':
|
||||
return '已消除';
|
||||
case '3':
|
||||
return '已确认';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 100, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
buts += '<button class="btn btn-default btn-sm" title="确认消除" onclick="confirm1(\'' + row.id + '\')">确认消除</button>';
|
||||
// buts+= '<button class="btn btn-default btn-sm" title="确认消除" onclick="edit2(\'' + row.id + '\')">确认消除</button>';
|
||||
|
||||
if (row.alarmtypeid == '3') {
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="showHisCamera(\'' + row.cameraid + '\',\'' + row.insdt + '\',\'' + row.eliminatedt + '\')"><i class="fa fa-play-circle-o"></i></button>';
|
||||
}
|
||||
buts += '<security:authorize buttonUrl="hqconfig/hqAlarmRecord/delete.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("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//状态
|
||||
var selelct1 = $("#riskStatusForSelect").select2({
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
})
|
||||
if ('${param.riskStatusForSelect}' != '') {
|
||||
selelct1.val('${param.riskStatusForSelect}').trigger("change");
|
||||
} else {
|
||||
//通过分页进来的 指定筛选该区域
|
||||
if ('${param.selectId}' != '') {
|
||||
selelct1.val('1').trigger("change");
|
||||
}
|
||||
}
|
||||
fixSelect2ToTool('riskStatusForSelect');
|
||||
|
||||
|
||||
//风险等级
|
||||
var selelct2 = $("#risklevelForSelect").select2({
|
||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
})
|
||||
<%--alert('${param.risklevelForSelect}');--%>
|
||||
if ('${param.risklevelForSelect}' != '') {
|
||||
selelct2.val('${param.risklevelForSelect}').trigger("change");
|
||||
}
|
||||
fixSelect2ToTool('risklevelForSelect');
|
||||
|
||||
|
||||
});
|
||||
|
||||
var hisCameraViewWindow = null;
|
||||
var definitionSt = 'standard';
|
||||
|
||||
// 视频回放
|
||||
function showHisCamera(id, time, endtime) {
|
||||
if (id != '') {
|
||||
// hisCameraViewWindow = window.open(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt + "&time=" + time + ";" + endtime, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
hisCameraViewWindow = window.open(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt + "&time=" + time, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
console.log(ext.contextPath + "/work/camera/hisCameraView.do?id=" + id + "&definitionSt=" + definitionSt + "&time=" + time, 'hisCameraViewWindow', 'width=720,height=480,top=200,left=300,toolbar=0,menubar=0,scrollbars=0,resizable=0,location=0,status=0')
|
||||
hisCameraViewWindow.focus();
|
||||
} else {
|
||||
alert("未识别到当前选择的摄像头!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(window).load(function () {
|
||||
treeView_Area();
|
||||
treeView_Type();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="content-wrapper">
|
||||
<section class="content container-fluid">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDivDetail"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div style="float: left;width: 100%">
|
||||
|
||||
<div class="form-group form-inline" style="padding:0;">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<security:authorize buttonUrl="hqconfig/hqAlarmRecord/delete.do">
|
||||
<button type="button" class="btn btn-default" onclick="deletesFun();"><i
|
||||
class="fa fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
|
||||
<div class="form-group pull-right form-inline">
|
||||
<div class="form-group">
|
||||
<label class="form-label"> 风险等级:</label>
|
||||
<select class="form-control select2" type="text" id="risklevelForSelect"
|
||||
class="form-control pull-right"
|
||||
name="risklevelForSelect" style="width: 90px;">
|
||||
<option value="all">全部</option>
|
||||
<option value="A">A</option>
|
||||
<option value="B">B</option>
|
||||
<option value="C">C</option>
|
||||
<option value="D">D</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label"> 状态:</label>
|
||||
<select class="form-control select2" type="text" id="riskStatusForSelect"
|
||||
class="form-control pull-right"
|
||||
name="riskStatusForSelect" style="width: 90px;">
|
||||
<option value="all" selected>全部</option>
|
||||
<option value="1">报警中</option>
|
||||
<option value="2">已消除</option>
|
||||
<option value="3">已确认</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label pull-left" style="margin-top: 5px">区域:</label>
|
||||
<input type="text" id="search_areaName" name="search_areaName"
|
||||
class="form-control pull-left"
|
||||
style="height:34px;width: 150px;" autocomplete="off" readonly="true"
|
||||
placeholder="请选择"/>
|
||||
<button class="btn btn-default" style="height:34px;" onclick="delNameArea();"><i
|
||||
class="fa fa-close"></i></button>
|
||||
<input type="hidden" id="search_areaId" name="search_areaId"/>
|
||||
<div id="tv"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label pull-left" style="margin-top: 5px">类型:</label>
|
||||
<input type="text" id="search_typeName" name="search_typeName"
|
||||
class="form-control pull-left"
|
||||
style="height:34px;width: 150px;" autocomplete="off" readonly="true"
|
||||
placeholder="请选择"/>
|
||||
<button class="btn btn-default" style="height:34px;" onclick="delNameType();"><i
|
||||
class="fa fa-close"></i></button>
|
||||
<input type="hidden" id="search_typeId" name="search_areaId"/>
|
||||
<div id="tv2"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label"> 报警时间:</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px;width: 150px; border-radius: 5px;"
|
||||
id="dt1" placeholder="请选择日期">
|
||||
<%--<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height: 34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label"> 消除时间:</label>
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</div>
|
||||
<input type="text" autocomplete="off" class="form-control pull-left"
|
||||
style="height: 34px;width: 150px; border-radius: 5px;"
|
||||
id="dt2" placeholder="请选择日期">
|
||||
<%--<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height: 34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<input type="text" id="searchContent" name="searchContent"
|
||||
style="height: 34px; border-radius: 5px;"
|
||||
class="form-control pull-right"
|
||||
placeholder="模糊搜索:报警内容">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" style="height: 34px;" onclick="dosearch();"><i
|
||||
class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<%--<label class="form-label" style="float: left;line-height: 2;">报警时间:</label>
|
||||
<input style="width:86px;" type="text" class="input-medium search-query" id="starttime"
|
||||
name="starttime" value="${date}" placeholder="" autocomplete="off" readonly/><span
|
||||
class="add-on"><i class="icon-th"></i></span><font> 至 </font>
|
||||
<input style="width:86px;" type="text" class="input-medium search-query" id="endtime" name="endtime"
|
||||
value="${date}" placeholder="" autocomplete="off" readonly/>
|
||||
<button class="btn btn-primary glyphicon glyphicon-search"
|
||||
style="width:23px;height: 23px;margin-left:5px;padding:2px;border:none;border-radius: 5px;"
|
||||
onclick="dosearch();"></button>
|
||||
|
||||
<label class="form-label" style="line-height: 2;">消除时间:</label>
|
||||
<input style="width:86px;" type="text" class="input-medium search-query" id="starttime2"
|
||||
name="starttime2" value="" placeholder="" autocomplete="off" readonly/><span
|
||||
class="add-on"><i class="icon-th"></i></span><font> 至 </font>
|
||||
<input style="width:86px;" type="text" class="input-medium search-query" id="endtime2"
|
||||
name="endtime2" value="" placeholder="" autocomplete="off" readonly/>
|
||||
<button class="btn btn-primary glyphicon glyphicon-search"
|
||||
style="width:23px;height: 23px;margin-left:5px;padding:2px;border:none;border-radius: 5px;"
|
||||
onclick="dosearch();"></button>--%>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<table id="table" style="width: 100%;word-break:break-all"></table>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</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>
|
||||
861
WebRoot/jsp/hqconfig/hqAlarmRecordOverview.jsp
Normal file
861
WebRoot/jsp/hqconfig/hqAlarmRecordOverview.jsp
Normal file
@ -0,0 +1,861 @@
|
||||
<%@ 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>
|
||||
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||
</title>
|
||||
<!-- 引用页头及CSS页-->
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<!--bootstrap-table 导出 -->
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/export/bootstrap-table-export.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/libs/FileSaver/FileSaver.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/libs/js-xlsx/xlsx.core.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/libs/jsPDF/jspdf.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/libs/es6-promise/es6-promise.auto.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/libs/html2canvas/html2canvas.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/tableExport/tableExport.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
/*
|
||||
顶部工具栏
|
||||
*/
|
||||
#divtop {
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#div_top {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
margin: 0px 0px 0px 0px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#div_below {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
margin: 0px 0px 0px 0px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/*5个div下面的内容*/
|
||||
.direct-chat-messages {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.row {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.col-md-3 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-md-4 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-md-5 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-md-6 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-md-7 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-md-8 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-md-9 {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*
|
||||
根据不同分辨率显示不同px的文字大小
|
||||
*/
|
||||
@media (min-width: 400px) and (min-height: 300px) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (min-height: 432px) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 992px) and (min-height: 558px) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) and (min-height: 675px) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1400px) and (min-height: 875px) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1600px) and (min-height: 1075px) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var showview = 0;
|
||||
|
||||
window.onresize = function () {
|
||||
allfun();
|
||||
}
|
||||
|
||||
var color_blueSystem = ['#0C4F9D', '#0089F2', '#0063FE', '#95DEFF', '#CBEFFF', '#BBDEFF'];
|
||||
var color_bars = ['#D4D4D4', '#00A5FF', '#CB70EC'];
|
||||
|
||||
/*
|
||||
根据月查询
|
||||
*/
|
||||
function domonth() {
|
||||
$("#yeartimeId").val('');//点月的时候把年的值置为空
|
||||
|
||||
$("#monthButtonId").css({//高亮月 去除年高亮色
|
||||
"background-color": "#238AE5"
|
||||
});
|
||||
$("#yearButtonId").css({
|
||||
"background-color": "#FFFFFF"
|
||||
});
|
||||
$("#yearDiv").attr("style", "width:200px;height:100%;float:left;margin:11px 0px 11px 0px;display:none;");//隐藏div
|
||||
$("#monthDiv").attr("style", "width:200px;height:100%;float:left;margin:11px 0px 11px 0px;display:block;");//显示div
|
||||
|
||||
$("#dateType").val('0');//dateType为日期类型 0为查看月 1为查看年
|
||||
}
|
||||
|
||||
/*
|
||||
根据年查询
|
||||
*/
|
||||
function doyear() {
|
||||
$("#monthtimeId").val('');//点年的时候把月的值置为空
|
||||
|
||||
$("#yearButtonId").css({//高亮年 去除月高亮色
|
||||
"background-color": "#238AE5"
|
||||
});
|
||||
$("#monthButtonId").css({
|
||||
"background-color": "#FFFFFF"
|
||||
});
|
||||
$("#monthDiv").attr("style", "width:200px;height:100%;float:left;margin:11px 0px 11px 0px;display:none;");//隐藏div
|
||||
$("#yearDiv").attr("style", "width:200px;height:100%;float:left;margin:11px 0px 11px 0px;display:block;");//显示div
|
||||
|
||||
$("#dateType").val('1');//dateType为日期类型 0为查看月 1为查看年
|
||||
}
|
||||
|
||||
/*
|
||||
显示默认的时间
|
||||
*/
|
||||
function chaDate(ev) {
|
||||
var dateType = $('#dateType').val();//dateType为日期类型 0为查看月 1为查看年
|
||||
var datestr = '';
|
||||
if (dateType == '1') {
|
||||
datestr = $('#yeartimeId').val();
|
||||
} else {
|
||||
datestr = $('#monthtimeId').val();
|
||||
}
|
||||
$("#selectDate").val(datestr);//selectDate为查询时间
|
||||
|
||||
allfun();//加载所有方法
|
||||
}
|
||||
|
||||
//左上
|
||||
function chart1(bizid, dateType, selectDate) {
|
||||
//初始化echarts实例
|
||||
var myChart = echarts.init(document.getElementById('chart1'));
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + '/hqconfig/hqAlarmRecord/getAlarmRecordLevelType.do?&&math=' + Math.random() + '&unitId=' + bizid + '&dateType=' + dateType + '&patrolDate=' + selectDate,
|
||||
async: true,
|
||||
globle: false,
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
var data = eval('(' + data + ')');
|
||||
var xdata = new Array();//X轴数据 [0,1,2,3,4,5]
|
||||
var ydata_a = new Array();//Y轴数据 [0,1,2,3,4,5]
|
||||
var ydata_b = new Array();//Y轴数据 [0,1,2,3,4,5]
|
||||
var ydata_c = new Array();//Y轴数据 [0,1,2,3,4,5]
|
||||
var ydata_d = new Array();//Y轴数据 [0,1,2,3,4,5]
|
||||
var ydata_all = new Array();//Y轴数据 [0,1,2,3,4,5]
|
||||
|
||||
var jsonObject_a = data.result.jsonObject_a;//总数
|
||||
var jsonObject_b = data.result.jsonObject_b;//总数
|
||||
var jsonObject_c = data.result.jsonObject_c;//总数
|
||||
var jsonObject_d = data.result.jsonObject_d;//总数
|
||||
var jsonObject_all = data.result.jsonObject_all;//总数
|
||||
|
||||
// console.log(jsonObject_all);
|
||||
|
||||
for (var i in jsonObject_all) {
|
||||
xdata.push(i);
|
||||
}
|
||||
for (var i in jsonObject_a) {
|
||||
ydata_a.push(jsonObject_a[i]);
|
||||
}
|
||||
for (var i in jsonObject_b) {
|
||||
ydata_b.push(jsonObject_b[i]);
|
||||
}
|
||||
for (var i in jsonObject_c) {
|
||||
ydata_c.push(jsonObject_c[i]);
|
||||
}
|
||||
for (var i in jsonObject_d) {
|
||||
ydata_d.push(jsonObject_d[i]);
|
||||
}
|
||||
for (var i in jsonObject_all) {
|
||||
ydata_all.push(jsonObject_all[i]);
|
||||
}
|
||||
|
||||
var option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
align: 'left'
|
||||
}
|
||||
},
|
||||
/*toolbox: {
|
||||
feature: {
|
||||
dataView: { show: true, readOnly: false },
|
||||
magicType: { show: true, type: ['line', 'bar'] },
|
||||
restore: { show: true },
|
||||
saveAsImage: { show: true }
|
||||
}
|
||||
},*/
|
||||
legend: {
|
||||
data: ['A', 'B', 'C', 'D', '总计'],
|
||||
bottom: 0,//缩放条显示在底部
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '4%',
|
||||
bottom: '30',
|
||||
top: '30',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: xdata,
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '',
|
||||
// min: 0,
|
||||
// max: 250,
|
||||
// interval: 1,
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
}
|
||||
}
|
||||
/*{
|
||||
type: 'value',
|
||||
name: '',
|
||||
// min: 0,
|
||||
// max: 25,
|
||||
// interval: 1,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
}
|
||||
}*/
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: 'A',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 左边';
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#FF0000',//#FFC000
|
||||
}
|
||||
},
|
||||
data: ydata_a
|
||||
},
|
||||
{
|
||||
name: 'B',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 左边';
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#FFC000',//##FFFF00
|
||||
}
|
||||
},
|
||||
data: ydata_b
|
||||
},
|
||||
{
|
||||
name: 'C',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 左边';
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#FFFF00',//##FFFF00
|
||||
}
|
||||
},
|
||||
data: ydata_c
|
||||
},
|
||||
{
|
||||
name: 'D',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 左边';
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#00B0F0',//#5AD8A6
|
||||
}
|
||||
},
|
||||
data: ydata_d
|
||||
},
|
||||
{
|
||||
name: '总计',
|
||||
type: 'line',
|
||||
// yAxisIndex: 1,
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' 右边';
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#5AD8A6',//#5AD8A6
|
||||
}
|
||||
},
|
||||
data: ydata_all
|
||||
}
|
||||
]
|
||||
};
|
||||
// myChart = echarts.init(document.getElementById('chart1'));
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//右上
|
||||
function chart2(bizid, dateType, selectDate) {
|
||||
//初始化echarts实例
|
||||
var myChart = echarts.init(document.getElementById('chart2'));
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + '/hqconfig/hqAlarmRecord/getAlarmRecordPie.do?&&math=' + Math.random() + '&unitId=' + bizid + '&dateType=' + dateType + '&patrolDate=' + selectDate,
|
||||
async: true,
|
||||
globle: false,
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
// var xdata = new Array();//X轴数据 [0,1,2,3,4,5]
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: '',
|
||||
subtext: '',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
grid: {
|
||||
// x: 'left'
|
||||
// left: '-20',
|
||||
// right: '30%',
|
||||
// bottom: '30',
|
||||
// top: '30'
|
||||
// containLabel: true
|
||||
},
|
||||
legend: {
|
||||
icon: 'circle',
|
||||
orient: 'vertical',
|
||||
right: '10%',
|
||||
top: '36%',
|
||||
fontSize: 16,
|
||||
formatter: function (name) {
|
||||
var num = 0;
|
||||
if (name == 'A') {
|
||||
num = datastr.result.jsonObject_a.size
|
||||
}
|
||||
if (name == 'B') {
|
||||
num = datastr.result.jsonObject_b.size
|
||||
}
|
||||
if (name == 'C') {
|
||||
num = datastr.result.jsonObject_c.size
|
||||
}
|
||||
if (name == 'D') {
|
||||
num = datastr.result.jsonObject_d.size
|
||||
}
|
||||
var arr = [name + '级风险 ', " " + num]
|
||||
return arr.join(" ")
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Access From',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
label: {
|
||||
normal: {
|
||||
formatter: '{b}: ({d}%)',
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
fontSize: 12
|
||||
}
|
||||
}
|
||||
},
|
||||
center: ['37%', '50%'],
|
||||
data: [
|
||||
{value: datastr.result.jsonObject_a.size, name: 'A'},
|
||||
{value: datastr.result.jsonObject_b.size, name: 'B'},
|
||||
{value: datastr.result.jsonObject_c.size, name: 'C'},
|
||||
{value: datastr.result.jsonObject_d.size, name: 'D'}
|
||||
],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
myChart.setOption(option, true);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//左上
|
||||
function chart3(bizid, dateType, selectDate) {
|
||||
//初始化echarts实例
|
||||
var myChart = echarts.init(document.getElementById('chart3'));
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + '/hqconfig/hqAlarmRecord/getAlarmRecordAreaType.do?&&math=' + Math.random() + '&unitId=' + bizid + '&dateType=' + dateType + '&patrolDate=' + selectDate,
|
||||
async: true,
|
||||
globle: false,
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
var data = eval('(' + data + ')');
|
||||
// var xdata = new Array();//X轴数据 [0,1,2,3,4,5]
|
||||
// var ydata = new Array();//Y轴数据 [0,1,2,3,4,5]
|
||||
|
||||
var l_data = new Array();//X轴数据 [0,1,2,3,4,5]
|
||||
|
||||
for (var i in data.result) {
|
||||
l_data.push(data.result[i].name);
|
||||
}
|
||||
|
||||
var option = {
|
||||
color: ['#5B8FF9', '#5D7092', '#6F5EF9', '#945FB9'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
textStyle: {
|
||||
align: 'left'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '4%',
|
||||
bottom: '30',
|
||||
top: '30',
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
data: l_data,
|
||||
bottom: 0,//缩放条显示在底部
|
||||
},
|
||||
toolbox: {
|
||||
show: true,
|
||||
orient: 'vertical',
|
||||
left: 'right',
|
||||
top: 'center'
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
axisTick: {show: false},
|
||||
// data: ['2012', '2013', '2014', '2015', '2016']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: data.result
|
||||
};
|
||||
// myChart = echarts.init(document.getElementById('chart1'));
|
||||
myChart.setOption(option, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//右上
|
||||
function chart4(bizid, dateType, selectDate) {
|
||||
//初始化echarts实例
|
||||
var myChart = echarts.init(document.getElementById('chart4'));
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: ext.contextPath + '/hqconfig/hqAlarmRecord/getAlarmRecordAreaTypePie.do?&&math=' + Math.random() + '&unitId=' + bizid + '&dateType=' + dateType + '&patrolDate=' + selectDate,
|
||||
async: true,
|
||||
globle: false,
|
||||
error: function () {
|
||||
return false;
|
||||
},
|
||||
success: function (data) {
|
||||
var datastr = eval('(' + data + ')');
|
||||
|
||||
var option = {
|
||||
title: {
|
||||
text: '',
|
||||
subtext: '',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
grid: {
|
||||
// x: 'right',
|
||||
// left: '-20',
|
||||
// right: '0',
|
||||
// bottom: '30',
|
||||
// top: '30'
|
||||
// containLabel: true
|
||||
},
|
||||
legend: {
|
||||
icon: 'circle',
|
||||
orient: 'right',
|
||||
right: '7%',
|
||||
top: '40%',
|
||||
fontSize: 16,
|
||||
textStyle: {
|
||||
name: {//legend左边的文字:第一针、第二针...
|
||||
fontSize: 10,
|
||||
padding: [3, 100, 0, 0]//1.左边的文字添加右边距10(可自己调整)
|
||||
},
|
||||
value: {//legend右边的值:10.09%、59.62%...
|
||||
fontSize:12,
|
||||
color: "#182F41",
|
||||
backgroundColor: "transparent",//2.右边的值添加背景色
|
||||
align: "right",//3.右对齐
|
||||
padding: [5, 0, 0, 0],//4.设置右边距为-100(-70/-80..可自己调整)
|
||||
}
|
||||
},
|
||||
formatter: function (name) {
|
||||
var num = 0;
|
||||
var array = datastr.result;//总数
|
||||
for (var i in array) {
|
||||
if (array[i].name == name) {
|
||||
num = array[i].value;
|
||||
}
|
||||
}
|
||||
var arr = [name, " " + num]
|
||||
return arr.join(" ")
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Access From',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
label: {
|
||||
normal: {
|
||||
formatter: '{b}: ({d}%)',
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
fontSize: 12
|
||||
}
|
||||
}
|
||||
},
|
||||
center: ['37%', '50%'],
|
||||
data: datastr.result,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
myChart.setOption(option, true);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function selectBz(type) {
|
||||
//给div赋值高度
|
||||
var heightstr = $(window).height();
|
||||
$("#divbottom").height(heightstr - 50);//20只是为了避免滚动条 无其他意义
|
||||
|
||||
var dateType = $('#dateType').val();//查询类型 0:月 1:年
|
||||
var selectDate = $('#selectDate').val();//查询的日期
|
||||
var bizid = unitId;
|
||||
|
||||
|
||||
if (dateType == 1) {
|
||||
dateType = 'year';
|
||||
selectDate = selectDate + '-01-01';
|
||||
}
|
||||
if (dateType == 0) {
|
||||
dateType = 'month';
|
||||
selectDate = selectDate + '-01';
|
||||
}
|
||||
|
||||
if (type == 'P') {
|
||||
document.getElementById('button1').className = 'btn btn-primary btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-default btn-sm';
|
||||
}
|
||||
if (type == 'E') {
|
||||
document.getElementById('button1').className = 'btn btn-default btn-sm';
|
||||
document.getElementById('button2').className = 'btn btn-primary btn-sm';
|
||||
}
|
||||
|
||||
bzchart2(bizid, dateType, selectDate, type);
|
||||
}
|
||||
|
||||
/*
|
||||
预加载
|
||||
*/
|
||||
function initMenu() {
|
||||
|
||||
//根据分辨率自适应
|
||||
var wid = $(window).width();
|
||||
var hei = $(window).height();
|
||||
$('#divbottom').height(hei - 50);//顶部工具栏固定30px 其余为下面div高度
|
||||
|
||||
//box box-primary
|
||||
$('.box-body').height((hei / 2) - 110);
|
||||
|
||||
$('#monthtimeId').datepicker({
|
||||
format: 'yyyy-mm',
|
||||
weekStart: 1,
|
||||
autoclose: true,
|
||||
startView: 2,
|
||||
minViewMode: 1,
|
||||
maxViewMode: 2,
|
||||
forceParse: false,
|
||||
language: 'zh-CN'
|
||||
}).on('changeDate', chaDate);
|
||||
|
||||
$('#yeartimeId').datepicker({
|
||||
format: 'yyyy',
|
||||
weekStart: 1,
|
||||
autoclose: true,
|
||||
startView: 2,
|
||||
minViewMode: 2,
|
||||
maxViewMode: 2,
|
||||
forceParse: false,
|
||||
language: 'zh-CN'
|
||||
}).on('changeDate', chaDate);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
加载所有方法
|
||||
*/
|
||||
function allfun() {
|
||||
//给div赋值高度
|
||||
var heightstr = $(window).height();
|
||||
$("#divbottom").height(heightstr - 50);//20只是为了避免滚动条 无其他意义
|
||||
|
||||
var dateType = $('#dateType').val();//查询类型 0:月 1:年
|
||||
var selectDate = $('#selectDate').val();//查询的日期
|
||||
var bizid = unitId;
|
||||
|
||||
if (dateType == 1) {
|
||||
dateType = 'year';
|
||||
selectDate = selectDate + '-01-01';
|
||||
showview = 0;
|
||||
}
|
||||
if (dateType == 0) {
|
||||
dateType = 'month';
|
||||
selectDate = selectDate + '-01';
|
||||
showview = 1;
|
||||
}
|
||||
|
||||
chart1(bizid, dateType, selectDate);
|
||||
chart2(bizid, dateType, selectDate);
|
||||
chart3(bizid, dateType, selectDate);
|
||||
chart4(bizid, dateType, selectDate);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="initMenu();allfun();" style="background-color: #ECF0F5;">
|
||||
<input type="hidden" name="dateType" id="dateType" value="0">
|
||||
<input type="hidden" name="selectDate" id="selectDate" value="${datestr}">
|
||||
<div id="mainAlertdiv"></div>
|
||||
<div id="subDiv"></div>
|
||||
<div id="subDiv_recordDetail"></div>
|
||||
|
||||
<div id="divtop" style="background-color:#ECF0F5;">
|
||||
<div style="width:1%;height:100%;float:left;"></div>
|
||||
<div style="width:200px;height:100%;float:left;margin:5px 0px;display:none;" id="yearDiv">
|
||||
<div class="input-group">
|
||||
<input class="form-control date-picker" id="yeartimeId" name="yeartimeId" autocomplete="off" type="text"
|
||||
placeholder="点击选择" style="background-color:#FFFFFF;height:100%;" value=""/>
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-calendar bigger-110"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:200px;height:100%;float:left;margin:11px 0px 11px 0px;" id="monthDiv">
|
||||
<div class="input-group">
|
||||
<input class="form-control date-picker" id="monthtimeId" autocomplete="off" type="text"
|
||||
placeholder="点击选择" style="background-color:#FFFFFF;height:100%;" value="${datestr}"/>
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-calendar bigger-110"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="width:1%;height:100%;float:left;"></div>
|
||||
<div style="width:100px;height:100%;float:left;margin:10px 5px 10px 0px">
|
||||
<div class="btn-group" role="group" aria-label="...">
|
||||
<button id="yearButtonId" type="button" class="btn btn-default"
|
||||
style="height:100%;background-color:#D4D4D4;"
|
||||
onclick="doyear();">
|
||||
年
|
||||
</button>
|
||||
<button id="monthButtonId" type="button" class="btn btn-default"
|
||||
style="height:100%;background-color:#238AE5;"
|
||||
onclick="domonth();">
|
||||
月
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="width:100%;" id="divbottom">
|
||||
<!--上面div-->
|
||||
<div id="div_top" class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">风险等级统计</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="direct-chat-messages">
|
||||
<div style="width:100%;height:100%;">
|
||||
<div class="col-md-8">
|
||||
<div id="chart1" style="width:100%; height: 100%;"></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div id="chart2" style="width:100%; height: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--下面div-->
|
||||
<div id="div_below">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">风险区域统计</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="direct-chat-messages">
|
||||
<div style="width:100%;height:100%;">
|
||||
<div class="col-md-8">
|
||||
<div id="chart3" style="width:100%; height: 100%;"></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div id="chart4" style="width:100%; height: 100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
416
WebRoot/jsp/hqconfig/riskGradeList.jsp
Normal file
416
WebRoot/jsp/hqconfig/riskGradeList.jsp
Normal file
@ -0,0 +1,416 @@
|
||||
<%@ 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-fileinput/css/fileinput.min.css" />
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ztree/css/metroStyle/metroStyle.css" rel="stylesheet"
|
||||
type="text/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>
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/ztree/js/jquery.ztree.all.min.js"></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>
|
||||
<script type="text/javascript">
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/hqconfig/riskGrade/doAdd.do', {}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
$.post(ext.contextPath + '/hqconfig/riskGrade/doEdit.do', {
|
||||
id: id
|
||||
}, function(data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/hqconfig/riskGrade/dodel.do', {id : id}, function(data) {
|
||||
if(data.code=="1"){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','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 + '/hqconfig/riskGrade/deletes.do', {ids:datas} , function(data) {
|
||||
if(data.code>0){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
}else{
|
||||
showAlert('d','删除失败','mainAlertdiv');
|
||||
}
|
||||
},'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function() {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
var refreshTable = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function() {
|
||||
|
||||
$("#risklevelForSelect").on("change", function (e) {
|
||||
refreshTable();
|
||||
});
|
||||
|
||||
$("#safetyinspectionnameSelect").on("change", function (e) {
|
||||
refreshTable();
|
||||
});
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/hqconfig/riskGrade/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
checkboxHeader: true,
|
||||
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(),
|
||||
risklevelForSelect: $('#risklevelForSelect').val(),
|
||||
safetyinspectionnameSelect: $('#safetyinspectionnameSelect').val()
|
||||
/*search_warehouseinfor: $('#search_warehouseinfor').val(),*/
|
||||
/*search_shelf: $('#search_shelf').val(),*/
|
||||
}
|
||||
},
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
title : '序号',
|
||||
align: "center",
|
||||
valign: 'middle',
|
||||
width: 40,
|
||||
formatter: function (value, row, index) {
|
||||
//获取每页显示的数量
|
||||
var pageSize=$('#table').bootstrapTable('getOptions').pageSize;
|
||||
//获取当前是第几页
|
||||
var pageNumber=$('#table').bootstrapTable('getOptions').pageNumber;
|
||||
//返回序号,注意index是从0开始的,所以要加上1
|
||||
return pageSize * (pageNumber - 1) + index + 1;
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
width: '200',
|
||||
field: 'securitycontent', // 返回json数据中的name
|
||||
title: '安全项内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
width: '100',
|
||||
field: 'safetyinspectionname', // 返回json数据中的name
|
||||
title: '报警类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
},
|
||||
{
|
||||
width: '150',
|
||||
field: 'place', // 返回json数据中的shelfclass
|
||||
title: '地点', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '40',
|
||||
field: 'accidentcategory', // 返回json数据中的shelfclass
|
||||
title: '潜在的事故类别', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '中毒和窒息';
|
||||
case '2':
|
||||
return '触电';
|
||||
case '3':
|
||||
return '火灾';
|
||||
case '4':
|
||||
return '淹溺';
|
||||
case '7':
|
||||
return '坠落';
|
||||
case '8':
|
||||
return '爆炸';
|
||||
case '5':
|
||||
return '起重伤害';
|
||||
case '6':
|
||||
return '其它伤害';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'consequences', // 返回json数据中的shelfclass
|
||||
title: '主要后果', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '轻伤';
|
||||
case '2':
|
||||
return '重伤';
|
||||
case '3':
|
||||
return '死亡';
|
||||
default:
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
width: '40',
|
||||
field: 'lvalue', // 返回json数据中的shelfclass
|
||||
title: 'L', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '40',
|
||||
field: 'svalue', // 返回json数据中的shelfclass
|
||||
title: 'S', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '40',
|
||||
field: 'rvalue', // 返回json数据中的shelfclass
|
||||
title: 'R', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
// {
|
||||
// width: '60',
|
||||
// field: 'risklevel', // 返回json数据中的shelfclass
|
||||
// title: '风险等级', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle'
|
||||
//
|
||||
// },
|
||||
{
|
||||
width: '60',
|
||||
field: 'alarmLevelsConfig.level', // 返回json数据中的shelfclass
|
||||
title: '风险等级', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
|
||||
},
|
||||
{
|
||||
width: '200',
|
||||
field: 'actionstaken', // 返回json数据中的shelfclass
|
||||
title: '应采取的行动', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 70, // 定义列的宽度,单位为像素px
|
||||
formatter: function(value, row, index) {
|
||||
var buts = "";
|
||||
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+='<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='<div class="btn-group" >'+buts+'</div>';
|
||||
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function() { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function() { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
|
||||
var risklevelForSelect = document.getElementById("risklevelForSelect");
|
||||
$.post(ext.contextPath + '/alarm/config/getList.do', {}, function(data) {
|
||||
var res = eval('(' + data + ')');
|
||||
var datas = res.rows
|
||||
for(var i = 0; i < datas.length; i++) {
|
||||
var opp = new Option(datas[i].level, datas[i].id)
|
||||
risklevelForSelect.add(opp)
|
||||
}
|
||||
});
|
||||
|
||||
var safetyinspectionnameSelect = document.getElementById("safetyinspectionnameSelect");
|
||||
$.post(ext.contextPath + '/work/alarmTypes/getPidJson.do', {}, function(data) {
|
||||
data = eval('(' + data + ')');
|
||||
for(var i = 0; i < data.length; i++) {
|
||||
var opp = new Option(data[i].name, data[i].id)
|
||||
safetyinspectionnameSelect.add(opp)
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
||||
<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="subDivDetail"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="areaSubDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div style="float: left;width: 100%">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;float: left;">
|
||||
<security:authorize buttonUrl="maintenance/addProblem.do">
|
||||
<button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa fa-trash-o"></i> 删除</button>
|
||||
|
||||
<!-- <button type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button> -->
|
||||
|
||||
</security:authorize>
|
||||
</div>
|
||||
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right">
|
||||
<div class="input-group input-group-sm" style="width: 250px;">
|
||||
<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>
|
||||
|
||||
<div class="input-group input-group-sm pull-right" style="margin-top: -15px; margin-right: 5px">
|
||||
<label class="form-label" style="float: left;line-height: 2;">报警类型:</label>
|
||||
<select type="text" id="safetyinspectionnameSelect" class="form-control pull-right" name="safetyinspectionnameSelect" style="width: 120px;">
|
||||
<option value="">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-sm pull-right" style="margin-top: -15px; margin-right: 5px">
|
||||
<label class="form-label" style="float: left;line-height: 2;">风险等级:</label>
|
||||
<select type="text" id="risklevelForSelect" class="form-control pull-right" name="risklevelForSelect" style="width: 120px;">
|
||||
<option value="all">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<table id="table" style="width: 100%;word-break:break-all"></table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
211
WebRoot/jsp/hqconfig/riskLevelAdd.jsp
Normal file
211
WebRoot/jsp/hqconfig/riskLevelAdd.jsp
Normal file
@ -0,0 +1,211 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
//保存前先赋值班组
|
||||
var val = $('#_place').val();
|
||||
console.log(val);
|
||||
var rolestr = "";
|
||||
if (val != null && val != '') {
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#place').val(rolestr);
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
var param = $("#subForm").serialize();
|
||||
console.log(param);
|
||||
$.post(ext.contextPath + "/hqconfig/riskGrade/doSave.do", param, function(data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
}else if(data.res == 0){
|
||||
showAlert('d','保存失败');
|
||||
}else{
|
||||
showAlert('d',data.res);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '用户名不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$.post(ext.contextPath + "/hqconfig/riskGrade/getAreaManage.do", {}, function(data) {
|
||||
|
||||
var selelct =$("#_place").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');
|
||||
|
||||
//获取巡检区域
|
||||
var selectAreaFun = function () {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreasLayer.do', {
|
||||
|
||||
}, function (data) {
|
||||
$("#areaSubDiv").html(data);
|
||||
openModal('areaSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$('#lvalue, #svalue').bind('input propertychange',function () {
|
||||
var lvalue = $('#lvalue').val();
|
||||
var svalue = $('#svalue').val();
|
||||
var rvalue = lvalue * svalue;
|
||||
$('#rvalue').val(rvalue);
|
||||
$.post(ext.contextPath + "/alarm/config/getConfigList.do", {rvalue: rvalue}, function(data) {
|
||||
if (data.rows.length == 0) {
|
||||
$('#risklevels').val("-");
|
||||
} else {
|
||||
$('#risklevel').val(data.rows[0].id);
|
||||
$('#risklevels').val(data.rows[0].level);
|
||||
}
|
||||
},'json');
|
||||
// if(rvalue >= 20 && rvalue <= 25){
|
||||
// $('#risklevel').val("A");
|
||||
// }else if(rvalue >= 13 && rvalue <= 19){
|
||||
// $('#risklevel').val("B");
|
||||
// }else if(rvalue >= 8 && rvalue <= 12){
|
||||
// $('#risklevel').val("C");
|
||||
// }else if(rvalue >= 4 && rvalue <= 7){
|
||||
// $('#risklevel').val("D");
|
||||
// }else{
|
||||
// }
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var showAlarmTyps4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/showList4Select.do', {formId:"subForm",hiddenId:"safetyinspection",textId:"safetyinspectionname", type:"s"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
</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 type="hidden" id="risklevel" name="risklevel" class="form-control pull-right">
|
||||
<!-- 界面提醒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" id="securitycontent" name="securitycontent" class="form-control pull-right" placeholder="安全项内容">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="safetyinspectionname" name ="safetyinspectionname" placeholder="请点击选择风险类型" onclick="showAlarmTyps4SelectFun();" readonly="readonly"></input>
|
||||
<input id="safetyinspection" name="safetyinspection" type="hidden"/>
|
||||
</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="place" name="place"--%>
|
||||
<%-- onclick="selectAreaFun()" placeholder="点击选择">--%>
|
||||
<%-- <input type="hidden" class="form-control" id="areaid" name="areaid">--%>
|
||||
<input type="text" id="place" name="place" class="form-control pull-right" placeholder="地点">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">潜在的事故类别</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="accidentcategory" class="form-control pull-right" name="accidentcategory" >
|
||||
<option value="1">中毒和窒息</option>
|
||||
<option value="2">触电</option>
|
||||
<option value="3">火灾</option>
|
||||
<option value="4">淹溺</option>
|
||||
<option value="7">坠落</option>
|
||||
<option value="8">爆炸</option>
|
||||
<option value="5">起重伤害</option>
|
||||
<option value="6">其它伤害</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">主要后果</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="consequences" class="form-control pull-right" name="consequences" >
|
||||
<option value="1">轻伤</option>
|
||||
<option value="2">重伤</option>
|
||||
<option value="3">死亡</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">L</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="lvalue" name="lvalue" class="form-control pull-right" placeholder="L(事故发生的可能性)">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">S</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="svalue" name="svalue" class="form-control pull-right" placeholder="S(事故发生的严重程度)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">R(L*S)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="rvalue" name="rvalue" class="form-control pull-right" placeholder="R(风险度)" readonly="readonly">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">风险等级</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="risklevels" name="risklevels" class="form-control pull-right" placeholder="风险等级" 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 " id="actionstaken" name="actionstaken" rows="6" placeholder="应采取的行动"></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>
|
||||
214
WebRoot/jsp/hqconfig/riskLevelEdit.jsp
Normal file
214
WebRoot/jsp/hqconfig/riskLevelEdit.jsp
Normal file
@ -0,0 +1,214 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {//获取验证结果,如果成功,执行下面代码
|
||||
//保存前先赋值班组
|
||||
var val = $('#_place').val();
|
||||
var rolestr = "";
|
||||
if (val != null && val != '') {
|
||||
$.each(val, function (index, value, array) {
|
||||
if (rolestr != "") {
|
||||
rolestr += ","
|
||||
}
|
||||
rolestr += value;
|
||||
})
|
||||
$('#place').val(rolestr);//赋值班组
|
||||
}
|
||||
var param = $("#subForm").serialize();
|
||||
$.post(ext.contextPath + "/hqconfig/riskGrade/doUpdate.do", param, function (data) {
|
||||
if (data.code == 1) {
|
||||
$(".modal").modal("hide");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
//获取巡检区域
|
||||
var selectAreaFun = function () {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPoint/selectAreaLayer.do', {
|
||||
|
||||
}, function (data) {
|
||||
$("#areaSubDiv").html(data);
|
||||
openModal('areaSubModal');
|
||||
});
|
||||
};
|
||||
|
||||
<%--$.post(ext.contextPath + "/hqconfig/riskGrade/getAreaManage.do", {}, function(data) {--%>
|
||||
|
||||
<%-- var selelct = $("#_place").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('${place}');--%>
|
||||
<%-- for (var i = 0; i < roles.length; i++) {--%>
|
||||
<%-- roleitems.push(roles[i].id);--%>
|
||||
<%-- }--%>
|
||||
<%-- selelct.val(roleitems).trigger("change");--%>
|
||||
<%-- },'json');--%>
|
||||
|
||||
$(function(){
|
||||
$('#lvalue, #svalue').bind('input propertychange',function () {
|
||||
var lvalue = $('#lvalue').val();
|
||||
var svalue = $('#svalue').val();
|
||||
var rvalue = lvalue * svalue;
|
||||
$('#rvalue').val(rvalue);
|
||||
$.post(ext.contextPath + "/alarm/config/getConfigList.do", {rvalue: rvalue}, function(data) {
|
||||
if (data.rows.length == 0) {
|
||||
$('#risklevels').val("-");
|
||||
$('#risklevel').val("-");
|
||||
} else {
|
||||
$('#risklevel').val(data.rows[0].id);
|
||||
$('#risklevels').val(data.rows[0].level);
|
||||
}
|
||||
},'json');
|
||||
// if(rvalue >= 20 && rvalue <= 25){
|
||||
// $('#risklevel').val("A");
|
||||
// }else if(rvalue >= 13 && rvalue <= 19){
|
||||
// $('#risklevel').val("B");
|
||||
// }else if(rvalue >= 8 && rvalue <= 12){
|
||||
// $('#risklevel').val("C");
|
||||
// }else if(rvalue >= 4 && rvalue <= 7){
|
||||
// $('#risklevel').val("D");
|
||||
// }else{
|
||||
// $('#risklevel').val("-");
|
||||
// }
|
||||
});
|
||||
});
|
||||
|
||||
var showAlarmTyps4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/work/alarmTypes/showList4Select.do', {formId:"subForm",hiddenId:"safetyinspection",textId:"safetyinspectionname", type:"s"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
</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 type="hidden" id="risklevel" name="risklevel" class="form-control pull-right" value="${riskLevel.risklevel}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${riskLevel.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">安全项内容</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="securitycontent" name="securitycontent" class="form-control pull-right" value="${riskLevel.securitycontent}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">报警类型</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="safetyinspectionname" name ="safetyinspectionname" placeholder="请点击选择风险类型"
|
||||
onclick="showAlarmTyps4SelectFun();" readonly="readonly" value="${riskLevel.safetyinspectionname}"></input>
|
||||
<input id="safetyinspection" name="safetyinspection" type="hidden" value="${riskLevel.safetyinspection}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">地点</label>
|
||||
<%-- <div class="col-sm-10">--%>
|
||||
<%-- <select class="form-control select2" id="_place" name ="_place" style="width: 100%">--%>
|
||||
<%-- </select>--%>
|
||||
<%-- <input type="hidden" name="place" id="place" value="">--%>
|
||||
<%-- </div>--%>
|
||||
<div class="col-sm-10">
|
||||
<%-- <input type="text" class="form-control" id="place" name="place"--%>
|
||||
<%-- onclick="selectAreaFun()" placeholder="点击选择" value="${riskLevel.place}">--%>
|
||||
<%-- <input type="hidden" class="form-control" id="areaid" name="areaid" value="${riskLevel.areaid}">--%>
|
||||
<input type="text" id="place" name="place" class="form-control pull-right" value="${riskLevel.place}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">潜在的事故类别</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="accidentcategory" class="form-control pull-right" name="accidentcategory">
|
||||
<option value="1" <c:if test="${riskLevel.accidentcategory=='1'}"> selected</c:if>>中毒和窒息</option>
|
||||
<option value="2" <c:if test="${riskLevel.accidentcategory=='2'}"> selected</c:if>>触电</option>
|
||||
<option value="3" <c:if test="${riskLevel.accidentcategory=='3'}"> selected</c:if>>火灾</option>
|
||||
<option value="4" <c:if test="${riskLevel.accidentcategory=='4'}"> selected</c:if>>淹溺</option>
|
||||
<option value="7" <c:if test="${riskLevel.accidentcategory=='7'}"> selected</c:if>>坠落</option>
|
||||
<option value="8" <c:if test="${riskLevel.accidentcategory=='8'}"> selected</c:if>>爆炸</option>
|
||||
<option value="5" <c:if test="${riskLevel.accidentcategory=='5'}"> selected</c:if>>起重伤害</option>
|
||||
<option value="6" <c:if test="${riskLevel.accidentcategory=='6'}"> selected</c:if>>其它伤害</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">主要后果</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="consequences" class="form-control pull-right" name="consequences">
|
||||
<option value="1" <c:if test="${riskLevel.consequences=='1'}"> selected</c:if>>轻伤</option>
|
||||
<option value="2" <c:if test="${riskLevel.consequences=='2'}"> selected</c:if>>重伤</option>
|
||||
<option value="3" <c:if test="${riskLevel.consequences=='3'}"> selected</c:if>>死亡</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">L</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="lvalue" name="lvalue" class="form-control pull-right" value="${riskLevel.lvalue}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">S</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="svalue" name="svalue" class="form-control pull-right" value="${riskLevel.svalue}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">R(L*S)</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="rvalue" name="rvalue" class="form-control pull-right" value="${riskLevel.rvalue}" readonly="readonly">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">风险等级</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="risklevels" name="risklevels" class="form-control pull-right" value="${riskLevel.alarmLevelsConfig.level}" 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 " id="actionstaken" name="actionstaken" rows="6">${riskLevel.actionstaken}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
156
WebRoot/jsp/hqconfig/workModelAdd.jsp
Normal file
156
WebRoot/jsp/hqconfig/workModelAdd.jsp
Normal file
@ -0,0 +1,156 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/hqconfig/workModel/doSave.do", $("#subForm").serialize(), function (data) {
|
||||
if (data.res == 1) {
|
||||
closeModal('subModal')
|
||||
$("#table").bootstrapTable('refresh');
|
||||
|
||||
} else if (data.res == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '算法名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
modelName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '调用模型名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
output: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '算法输出不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
riskLevelId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险项不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$.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: -1,//禁用搜索框
|
||||
allowClear: true,//允许清空
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
|
||||
if (data.length >= 1) {
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
|
||||
} else {
|
||||
selelct.val(data[0].id).trigger("change");
|
||||
}
|
||||
selelct.val('').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="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" id="modelName" name="modelName" class="form-control pull-right"
|
||||
placeholder="调用模型名称">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*算法名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" placeholder="算法名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*算法输出</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="output" name="output" class="form-control pull-right"
|
||||
placeholder="算法输出">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">是否报警</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="isalarm" class="form-control pull-right" name="isalarm">
|
||||
<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-4">
|
||||
<select type="text" id="status" class="form-control pull-right" name="status">
|
||||
<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">
|
||||
<select id="riskLevelId" name="riskLevelId" class="form-control select2"
|
||||
style="width: 100%"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" id="remark" name="remark" class="form-control pull-right"
|
||||
placeholder="备注"/>
|
||||
</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>
|
||||
149
WebRoot/jsp/hqconfig/workModelEdit.jsp
Normal file
149
WebRoot/jsp/hqconfig/workModelEdit.jsp
Normal file
@ -0,0 +1,149 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doupdate() {
|
||||
$("#subFormE").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subFormE").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/hqconfig/workModel/doUpdate.do", $("#subFormE").serialize(), function (data) {
|
||||
if (data.code == 1) {
|
||||
$(".modal").modal("hide");
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else if (data.code == 0) {
|
||||
showAlert('d', '保存失败');
|
||||
} else {
|
||||
showAlert('d', data.res);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
$("#subFormE").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
name: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '算法名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
modelName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '调用模型名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
output: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '算法输出不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
riskLevelId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '风险项不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
$(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: -1,//禁用搜索框
|
||||
allowClear: true,//允许清空
|
||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||
});
|
||||
selelct.val('${workModel.riskLevelId}').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="subFormE">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<input type="hidden" class="form-control" id="id" name ="id" value ="${workModel.id}">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*调用模型名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="modelName" name="modelName" class="form-control pull-right" value ="${workModel.modelName}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*算法名称</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="name" name="name" class="form-control pull-right" value ="${workModel.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*算法输出</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" id="output" name="output" class="form-control pull-right" value ="${workModel.output}">
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">是否报警</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="isalarm" class="form-control pull-right" name="isalarm" >
|
||||
<option value="1" <c:if test="${workModel.isalarm==1}"> selected</c:if>>是</option>
|
||||
<option value="0" <c:if test="${workModel.isalarm==0}"> selected</c:if>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">模型状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select type="text" id="status" class="form-control pull-right" name="status" >
|
||||
<option value="1" <c:if test="${workModel.status==1}"> selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${workModel.status==0}"> selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*风险项</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="riskLevelId" name="riskLevelId" class="form-control select2" style="width: 100%" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea type="text" id="remark" name="remark" class="form-control pull-right">${workModel.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
319
WebRoot/jsp/hqconfig/workModelList.jsp
Normal file
319
WebRoot/jsp/hqconfig/workModelList.jsp
Normal file
@ -0,0 +1,319 @@
|
||||
<%@ 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-fileinput/css/fileinput.min.css"/>
|
||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/ztree/css/metroStyle/metroStyle.css"
|
||||
rel="stylesheet"
|
||||
type="text/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>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/ztree/js/jquery.ztree.all.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/hqconfig/workModel/doAdd.do', {}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id) {
|
||||
$.post(ext.contextPath + '/hqconfig/workModel/doEdit.do', {
|
||||
id: id
|
||||
}, function (data) {
|
||||
$("#subDiv").html(data);
|
||||
openModal('subModal');
|
||||
});
|
||||
};
|
||||
|
||||
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 + '/hqconfig/workModel/dodel.do', {id: id}, function (data) {
|
||||
if (data.code == "1") {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', '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 + '/hqconfig/workModel/deletes.do', {ids: datas}, function (data) {
|
||||
if (data.code > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var dosearch = function () {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
};
|
||||
|
||||
$(function () {
|
||||
/*$(".select2-selection--single").css({
|
||||
'height': '30px',
|
||||
'paddingTop': '4px'
|
||||
})*/
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/hqconfig/workModel/getList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
checkboxHeader: true,
|
||||
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(),
|
||||
/*search_warehouseinfor: $('#search_warehouseinfor').val(),*/
|
||||
/*search_shelf: $('#search_shelf').val(),*/
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [{
|
||||
checkbox: true
|
||||
}, {
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
width: '20',
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return index + 1;
|
||||
}
|
||||
}, {
|
||||
width: '120',
|
||||
field: 'modelName', // 返回json数据中的name
|
||||
title: '调用模型名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
width: '100',
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '算法名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'output', // 返回json数据中的shelfclass
|
||||
title: '算法调用接口', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'isalarm', // 返回json数据中的shelfclass
|
||||
title: '是否报警', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '是';
|
||||
case '0':
|
||||
return '否';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'riskLevel.securitycontent', // 返回json数据中的shelfclass
|
||||
title: '风险项', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '100',
|
||||
field: 'remark', // 返回json数据中的shelfclass
|
||||
title: '备注', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
width: '40',
|
||||
field: 'status', // 返回json数据中的shelfclass
|
||||
title: '模型状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case '1':
|
||||
return '启用';
|
||||
case '0':
|
||||
return '禁用';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: 50, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = "";
|
||||
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 += '<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 = '<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">
|
||||
|
||||
<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="subDivDetail"></div>
|
||||
<div id="fileInputDiv"></div>
|
||||
<div id="fault4SelectDiv"></div>
|
||||
<div style="float: left;width: 100%">
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;float: left;">
|
||||
<security:authorize buttonUrl="maintenance/addProblem.do">
|
||||
<button type="button" class="btn btn-default" onclick="addFun();"><i class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" onclick="deletesFun();"><i
|
||||
class="fa fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
|
||||
<!-- <button type="button" class="btn btn-default" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button> -->
|
||||
|
||||
</security:authorize>
|
||||
</div>
|
||||
<div class="form-group " style="padding:0;">
|
||||
<div class="form-group pull-right">
|
||||
<div class="input-group input-group-sm" style="width: 250px; ">
|
||||
<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>
|
||||
|
||||
<table id="table" style="width: 100%;word-break:break-all"></table>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user