487 lines
20 KiB
Plaintext
487 lines
20 KiB
Plaintext
<%@page import="com.sipai.tools.CommString"%>
|
||
<%@page import="com.sipai.service.maintenance.MaintenanceDetailService"%>
|
||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%request.setAttribute("Status_Finish",MaintenanceDetail.Status_Finish);%>
|
||
<%request.setAttribute("Status_Start",MaintenanceDetail.Status_Start);%>
|
||
<% request.setAttribute("Type_Detail", MaintenanceDetailService.processDefKey);%>
|
||
<%request.setAttribute("UserType_Maintainer", CommString.UserType_Maintainer); %>
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single{
|
||
height:34px;
|
||
line-height: 34px;
|
||
}
|
||
.select2-selection__arrow{
|
||
margin-top:3px;
|
||
}
|
||
</style>
|
||
<!-- echarts-->
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.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>
|
||
|
||
<script type="text/javascript">
|
||
var beginTimeStore = '';
|
||
var endTimeStore = '';
|
||
function initDate() {
|
||
//定义locale汉化插件
|
||
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD');;
|
||
endTimeStore = 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
|
||
};
|
||
$('#reservationtime').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: beginTimeStore,
|
||
endDate: endTimeStore
|
||
}, function(start, end, label) {
|
||
beginTimeStore = start.format(this.locale.format);
|
||
endTimeStore = end.format(this.locale.format);
|
||
if(!this.startDate){
|
||
this.element.val('');
|
||
}else{
|
||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||
}
|
||
dosearch();
|
||
});
|
||
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
|
||
|
||
};
|
||
var echartsPie_taskSituation;
|
||
var echartsPie_handle;
|
||
var echartsPie_finish;
|
||
|
||
function getBizTaskCompleteSituation(bizId){
|
||
$.post(ext.contextPath +"/maintenance/getBizTaskCompleteSituation4Pie.do",{bizId:bizId,sdt:beginTimeStore,edt:endTimeStore,maintainerid:$('#maintainerid').val()},function(data){
|
||
//console.info(data);
|
||
var json = data;
|
||
var legend = [];
|
||
$.each(data,function(index,value){
|
||
legend.push(value.name)
|
||
});
|
||
var date = new Date();
|
||
var option = {
|
||
/* title: {
|
||
text: date.getFullYear()+'年运维完成图',
|
||
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%'],//饼图的位置
|
||
label: {
|
||
normal: {
|
||
show: true,
|
||
formatter: '{b}: {c}'
|
||
}
|
||
},
|
||
data:json
|
||
}
|
||
],
|
||
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
|
||
};
|
||
if(echartsPie_taskSituation!=null){
|
||
echartsPie_taskSituation.clear();
|
||
echartsPie_taskSituation.dispose();
|
||
}
|
||
//延时加载饼图
|
||
setTimeout(function(){
|
||
echartsPie_taskSituation = echarts.init(document.getElementById('echartsPie_taskSituation'));
|
||
echartsPie_taskSituation.setOption(option);
|
||
},500);
|
||
},'json');
|
||
}
|
||
|
||
function getMaintenanceDetailResult4Pie_handle(bizId){
|
||
$.post(ext.contextPath +"/maintenance/getMaintenanceDetailResult4Pie.do",{bizId:bizId,status:'${Status_Start}',sdt:beginTimeStore,edt:endTimeStore,maintainerid:$('#maintainerid').val()},function(data){
|
||
var json = data;
|
||
var legend = [];
|
||
$.each(data,function(index,value){
|
||
legend.push(value.name)
|
||
});
|
||
var date = new Date();
|
||
var option = {
|
||
/* title: {
|
||
text: date.getFullYear()+'年运维完成图',
|
||
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%'],//饼图的位置
|
||
label: {
|
||
normal: {
|
||
show: true,
|
||
formatter: '{b}: {c}'
|
||
}
|
||
},
|
||
data:json
|
||
}
|
||
],
|
||
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
|
||
};
|
||
if(echartsPie_handle!=null){
|
||
echartsPie_handle.clear();
|
||
echartsPie_handle.dispose();
|
||
}
|
||
//延时加载饼图
|
||
setTimeout(function(){
|
||
echartsPie_handle = echarts.init(document.getElementById('echartsPie_handle'));
|
||
echartsPie_handle.setOption(option);
|
||
},500);
|
||
},'json');
|
||
}
|
||
function getMaintenanceDetailResult4Pie_finish(bizId){
|
||
$.post(ext.contextPath +"/maintenance/getMaintenanceDetailResult4Pie.do",{bizId:bizId,status:'${Status_Finish}',sdt:beginTimeStore,edt:endTimeStore,maintainerid:$('#maintainerid').val()},function(data){
|
||
var echartsPie;
|
||
var json = data;
|
||
var legend = [];
|
||
$.each(data,function(index,value){
|
||
legend.push(value.name)
|
||
});
|
||
var date = new Date();
|
||
var option = {
|
||
/* title: {
|
||
text: date.getFullYear()+'年运维完成图',
|
||
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%'],//饼图的位置
|
||
label: {
|
||
normal: {
|
||
show: true,
|
||
formatter: '{b}: {c}'
|
||
}
|
||
},
|
||
data:json
|
||
}
|
||
],
|
||
color: ['#dd4b39','#00a65a','#f39c12','#00c0ef','#3c8dbc']
|
||
};
|
||
if(echartsPie_finish!=null){
|
||
echartsPie_finish.clear();
|
||
echartsPie_finish.dispose();
|
||
}
|
||
//延时加载饼图
|
||
setTimeout(function(){
|
||
echartsPie_finish = echarts.init(document.getElementById('echartsPie_finish'));
|
||
echartsPie_finish.setOption(option);
|
||
},500);
|
||
|
||
},'json');
|
||
}
|
||
function dosearch(){
|
||
var value=$("#search_code").select2("val");
|
||
if(value!=""){
|
||
getBizTaskCompleteSituation(value);
|
||
getMaintenanceDetailResult4Pie_finish(value);
|
||
getMaintenanceDetailResult4Pie_handle(value);
|
||
$("#table").bootstrapTable('refresh');
|
||
}
|
||
}
|
||
var viewTaskTraceFun = function(pid,ppid,taskId) {
|
||
graphTrace(pid,ppid,taskId);
|
||
};
|
||
var viewDetailFun = function(id) {
|
||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id:id} , function(data) {
|
||
$("#subDetailDiv").html(data);
|
||
openModal('maintenanceDetailModal');
|
||
});
|
||
};
|
||
function initialTable(bizId){
|
||
$("#table").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/maintenance/getCompanyAllTaskList.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,
|
||
companyId : $('#maintainerid').val(),
|
||
bizId:bizId,
|
||
sdt:beginTimeStore,
|
||
edt:endTimeStore,
|
||
userType:'${UserType_Maintainer}'
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'name', // 返回json数据中的name
|
||
title: '流程名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle'
|
||
},{
|
||
field: 'createTime', // 返回json数据中的name
|
||
title: '任务下发时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter:function(value, row){
|
||
return row.task.createTime;
|
||
}
|
||
},{
|
||
field: 'problem', // 返回json数据中的name
|
||
title: '问题描述', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter:function(value, row){
|
||
return row.business==null?'':row.business.problem;
|
||
}
|
||
},{
|
||
field: 'taskName', // 返回json数据中的name
|
||
title: '任务节点', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter:function(value, row){
|
||
return row.task.name;
|
||
}
|
||
},{
|
||
field: 'assigneeUser', // 返回json数据中的name
|
||
title: '当前处理人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
formatter:function(value, row){
|
||
return row.assigneeUser==null?'未签收':row.assigneeUser.caption+'('+row.assigneeUser.mobile+')';
|
||
}
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 120, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var str = '';
|
||
str += '<button class="btn btn-default btn-sm" onclick="viewTaskTraceFun(\''+row.processInstance.id+'\',\''+row.processDefinition.id+'\',\''+row.task.id+'\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg"> 查看</span></button>'
|
||
if(!row.task.assignee){
|
||
}else{
|
||
if(row.type.indexOf('${Type_Detail}')!=-1){
|
||
str += '<button class="btn btn-default btn-sm" onclick="viewDetailFun(\''+row.processInstance.businessKey+'\')" data-toggle="tooltip" title="查看详情"><i class="fa fa-history"></i><span class="hidden-md hidden-lg"> 查看详情</span></button>'
|
||
}
|
||
}
|
||
str='<div class="btn-group" >'+str+'</div>';
|
||
return str;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
}
|
||
$(function() {
|
||
initDate();
|
||
$.post(ext.contextPath + "/user/getBizsByUserId4Select.do", {}, function(data) {
|
||
var bizId="";
|
||
var selelct =$("#search_code").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.on("change",function(e){
|
||
var value=selelct.select2("val");
|
||
if(value!=""){
|
||
getBizTaskCompleteSituation(value);
|
||
getMaintenanceDetailResult4Pie_finish(value);
|
||
getMaintenanceDetailResult4Pie_handle(value);
|
||
//先销毁,再加载,防止选择公司后表格数据不加载
|
||
$("#table").bootstrapTable('destroy');
|
||
initialTable(value);
|
||
}
|
||
|
||
});
|
||
if(data.length>0){
|
||
selelct.val(data[0].id).trigger("change");
|
||
if(data.length==1){
|
||
$("#search_code").next().css("display", "none");
|
||
selelct.attr("disabled","disabled");
|
||
var companyText = $("#search_code").text();
|
||
$("#companyName").text(companyText);
|
||
}
|
||
|
||
}else{
|
||
selelct.val("").trigger("change");
|
||
$("#company").css("display", "none");
|
||
};
|
||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||
},'json');
|
||
});
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog modal-lg" >
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">维护详情</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" id="maintainerid" value="${maintainerId}" >
|
||
<div class="form-group form-inline">
|
||
<div class="form-group " >
|
||
<label class="form-label" >公司:</label>
|
||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;" ></select>
|
||
<span class="select2-selection select2-selection--single" id="companyName" style="width:220px;border: none;background: transparent;" ></span>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="input-lable" >起止日期:</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="reservationtime" style="width:175px">
|
||
<!-- <div class="input-group-btn ">
|
||
<button type="button" class="btn btn-default" onclick="dosearch();" ><i class="fa fa-search"></i> 查询</button>
|
||
</div> -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="row" >
|
||
<div class="col-lg-4 col-xs-12" style="padding:3px;">
|
||
<div class="box box-primary" style="padding:0px;">
|
||
<div class="box-header ui-sortable-handle">
|
||
<i class="fa fa-pie-chart"></i>
|
||
<h3 class="box-title">总运维完成情况</h3>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body" style="padding:0px;">
|
||
<div id="echartsPie_taskSituation" style="height:280px;"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-4 col-xs-12" style="padding:3px;">
|
||
<div class="box box-primary" style="padding:0px;">
|
||
<div class="box-header ui-sortable-handle">
|
||
<i class="fa fa-pie-chart"></i>
|
||
<h3 class="box-title">已完成运维情况</h3>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body" style="padding:0px;" >
|
||
<div id="echartsPie_finish" style="height:280px;"></div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-4 col-xs-12" style="padding:3px;">
|
||
<div class="box box-primary" style="padding:0px;">
|
||
<div class="box-header ui-sortable-handle">
|
||
<i class="fa fa-pie-chart"></i>
|
||
<h3 class="box-title">处理中运维情况</h3>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body" style="padding:0px;" >
|
||
<div id="echartsPie_handle" style="height:280px;"></div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group ">
|
||
<div class="box box-primary" style="padding:0px">
|
||
<div class="box-header ui-sortable-handle">
|
||
<i class="ion ion-clipboard"></i>
|
||
<h3 class="box-title">处理中运维任务</h3>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body" >
|
||
<table id="table"></table>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|