319 lines
12 KiB
Plaintext
319 lines
12 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@page import="com.sipai.entity.maintenance.Maintenance"%>
|
||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||
<!-- 补录状态 -->
|
||
<%request.setAttribute("TYPE_SUPPLEMENT",Maintenance.TYPE_SUPPLEMENT);%>
|
||
<!-- 运维主流程状态 -->
|
||
<%request.setAttribute("TYPE_MAINTENANCE",Maintenance.TYPE_MAINTENANCE);%>
|
||
|
||
<%request.setAttribute("Status_Finish",Maintenance.Status_Finish);%>
|
||
|
||
<script type="text/javascript">
|
||
var showMaintenanceDetailList = function(id) {
|
||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailList4SubList.do', {maintenanceId:id} , function(data) {
|
||
$("#maintenanceDiv").html(data);
|
||
openModal('subDetailModal');
|
||
});
|
||
};
|
||
var viewMaintenanceFun = function(id) {
|
||
$.post(ext.contextPath + '/maintenance/showMaintenanceView.do', {id:id} , function(data) {
|
||
$("#maintenanceDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
function searchFault(){
|
||
$("#table_handleDetail").bootstrapTable('refresh');
|
||
//每月故障次数,故障日期
|
||
$.post(ext.contextPath +"/maintenance/getFaultNumberByEquipmentId.do",{equipmentId: '${param.equipmentId}',yearNum:$('#selectYear').val()},function(data){
|
||
var jsonBar = data;
|
||
//console.info(data);
|
||
var myChart = echarts.init(document.getElementById('faultLine'));
|
||
// 指定图表的配置项和数据
|
||
var optionLine = {
|
||
backgroundColor: '#B9D3EE',
|
||
title : {
|
||
text: '设备故障日期',
|
||
x: 'center'
|
||
},
|
||
tooltip : {
|
||
trigger: 'axis',
|
||
padding: 10,
|
||
backgroundColor: '#222',
|
||
borderColor: '#777',
|
||
borderWidth: 1,
|
||
formatter: function (obj) {
|
||
var toolView = obj[0].data;
|
||
//console.info(toolView);
|
||
return toolView.name + '<br>'
|
||
+ '故障次数'+ ':' + toolView.value +'次'+ '<br>'
|
||
+ '故障日期' + ':' +toolView.timestr + '<br>';
|
||
}
|
||
},
|
||
/* legend: {
|
||
data:['设备故障次数']
|
||
}, */
|
||
toolbox: {
|
||
show : true,
|
||
feature : {
|
||
mark : {show: true},
|
||
dataView : {show: true, readOnly: false},
|
||
magicType : {show: true, type: ['line', 'bar']},
|
||
restore : {show: true},
|
||
saveAsImage : {show: true}
|
||
}
|
||
},
|
||
calculable : true,
|
||
xAxis : [
|
||
{
|
||
name : '月份',
|
||
type : 'category',
|
||
data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
|
||
axisLine: {
|
||
lineStyle: {
|
||
type: 'solid',
|
||
color: '#0F0F0F',//左边线的颜色
|
||
width:'2'//坐标线的宽度
|
||
}
|
||
},
|
||
axisLabel: {
|
||
textStyle: {
|
||
color: '#0F0F0F',//坐标值得具体的颜色
|
||
|
||
}
|
||
}
|
||
|
||
}
|
||
],
|
||
yAxis : [
|
||
{ name : '次数',
|
||
type : 'value',
|
||
axisLine: {
|
||
lineStyle: {
|
||
type: 'solid',
|
||
color: '#0F0F0F',//左边线的颜色
|
||
width:'2'//坐标线的宽度
|
||
}
|
||
},
|
||
axisLabel: {
|
||
textStyle: {
|
||
color: '#0F0F0F',//坐标值得具体的颜色
|
||
|
||
}
|
||
}
|
||
}
|
||
],
|
||
series : [
|
||
{
|
||
name:'故障次数',
|
||
type:'line',
|
||
data:jsonBar,
|
||
markLine : {
|
||
data : [
|
||
{type : 'average',name : '平均值'}
|
||
]
|
||
}
|
||
}
|
||
]
|
||
};
|
||
myChart.setOption(optionLine);
|
||
},'json');
|
||
|
||
|
||
//故障类型分类饼图
|
||
$.post(ext.contextPath +"/maintenance/getFaultTypeByEquipmentId.do",{equipmentId: '${param.equipmentId}',yearNum:$('#selectYear').val()},function(data){
|
||
var faultTypePie;
|
||
var json = data;
|
||
var legend = [];
|
||
$.each(data,function(index,value){
|
||
legend.push(value.name);
|
||
});
|
||
//var date = new Date();
|
||
var option = {
|
||
backgroundColor: '#B9D3EE',
|
||
title: {
|
||
text: '设备故障类型统计',
|
||
x: 'center'
|
||
},
|
||
tooltip : {
|
||
trigger: 'item',
|
||
formatter: "{b} : {c} 次"
|
||
},
|
||
legend: {
|
||
orient : 'vertical',
|
||
x : 'left',
|
||
data:legend
|
||
},
|
||
calculable : true,
|
||
series : [
|
||
{
|
||
|
||
type:'pie',
|
||
radius : '55%',//饼图的半径大小
|
||
center: ['50%', '50%'],//饼图的位置
|
||
data:json
|
||
}
|
||
],
|
||
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
|
||
};
|
||
faultTypePie = echarts.init(document.getElementById('faultTypePie'));
|
||
faultTypePie.setOption(option);
|
||
},'json');
|
||
};
|
||
var dosearch = function() {
|
||
$("#table_handleDetail").bootstrapTable('refresh');
|
||
};
|
||
|
||
$(function() {
|
||
$("#table_handleDetail").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/maintenance/getHandleDetailListByEquipmentId.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 50, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
search_name:$('#search_name').val(),
|
||
equipmentId: '${param.equipmentId}',
|
||
yearNum:$('#selectYear').val()
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'problem', // 返回json数据中的name
|
||
title: '问题描述', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
}, {
|
||
field: 'handledt', // 返回json数据中的name
|
||
title: '处理日期', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter:function(value,row,index){
|
||
return value.substring(0,10);
|
||
}
|
||
},{
|
||
field: 'insuserName', // 返回json数据中的name
|
||
title: '处理人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'handledetail', // 返回json数据中的name
|
||
title: '处理详情', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'faultLibraryName', // 返回json数据中的name
|
||
title: '故障类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
}
|
||
/* ,{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 120, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var str="";
|
||
|
||
str+='<button class="btn btn-default btn-sm" onclick="viewMaintenanceFun(\'' + row.id + '\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||
//运维流程才能查看详细
|
||
if(row.type =='${ TYPE_MAINTENANCE}'){
|
||
str+='<security:authorize buttonUrl="maintenance/showDetail.do">';
|
||
str+='<button class="btn btn-default btn-sm" onclick="showMaintenanceDetailList(\'' + row.id + '\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-file-text-o"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>';
|
||
str+='</security:authorize>';
|
||
}
|
||
str='<div class="btn-group" >'+str+'</div>';
|
||
return str;
|
||
}
|
||
} */
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
setDataCardView("table_handleDetail");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
});
|
||
|
||
$('#selectYear').datepicker({
|
||
startView: 'decade',
|
||
minView: 'decade',
|
||
format: 'yyyy',
|
||
maxViewMode: 2,
|
||
minViewMode:2,
|
||
autoclose: true
|
||
}).on('changeDate',function(){
|
||
searchFault();
|
||
});
|
||
$('#selectYear').datepicker('setDate', new Date());
|
||
//searchFault();
|
||
})
|
||
|
||
</script>
|
||
<div class="modal fade" id="handleDetailModal">
|
||
<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> -->
|
||
<h4 class="modal-title">设备运维情况</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="form-group form-inline pull-left" >
|
||
<label class="input-label">年份:</label>
|
||
<div class="input-group " >
|
||
<div class="input-group pull-right input-group-sm" >
|
||
<div class="input-group-addon">
|
||
<i class="fa fa-clock-o"></i>
|
||
</div>
|
||
<input type="text" class="form-control" id="selectYear" style="width:150px;font-size:15px;">
|
||
<!-- <div class="input-group-btn ">
|
||
<button type="button" class="btn btn-default" onclick="searchFault();" ><i class="fa fa-search"></i> 查询</button>
|
||
</div> -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="box-body" >
|
||
<div id="faultTypePie" style="height:250px;"></div>
|
||
</div>
|
||
<br>
|
||
<div class="box-body" >
|
||
<div id="faultLine" style="height:400px;"></div>
|
||
</div>
|
||
<div class="form-group " >
|
||
<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_handleDetail"></table>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
|