419 lines
15 KiB
Plaintext
419 lines
15 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8"%>
|
||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||
<html>
|
||
<head>
|
||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/xlsx.core.js"></script>
|
||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/FileSaver.js"></script>
|
||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/tableexport.js"></script>
|
||
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
||
<meta name="format-detection" content="telephone=no,email=no,address=no">
|
||
<style type="text/css">
|
||
.statisticsRequest{
|
||
padding:10px 0px 0px 10px;
|
||
width:99%
|
||
}
|
||
.statisticsStatus{
|
||
padding:10px 0px 0px 10px;
|
||
width:99%
|
||
}
|
||
.page{
|
||
padding:8px 0px 5px 0px;
|
||
}
|
||
.tableDiv{
|
||
width:100%;
|
||
overflow-x:auto;
|
||
}
|
||
.table {
|
||
margin-bottom: 0px;
|
||
margin-top: 0px;
|
||
max-width: 100%;
|
||
width: 100%;
|
||
}
|
||
.table > thead > tr > th {
|
||
vertical-align: bottom;
|
||
border-bottom: 2px solid #e7ecf1; }
|
||
.table > caption + thead > tr:first-child > th,
|
||
.table > caption + thead > tr:first-child > td,
|
||
.table > colgroup + thead > tr:first-child > th,
|
||
.table > colgroup + thead > tr:first-child > td,
|
||
.table > thead:first-child > tr:first-child > th,
|
||
.table > thead:first-child > tr:first-child > td {
|
||
border-top: 0;
|
||
background-color: #E9E9E9;
|
||
color: #333333;
|
||
height: 38px;
|
||
line-height: 38px;
|
||
padding-top: 0px;
|
||
padding-right: 10px;
|
||
padding-bottom: 0px;
|
||
padding-left: 10px;
|
||
}
|
||
.table > tbody + tbody {
|
||
border-top: 2px solid #D9D9D9; }
|
||
.table .table {
|
||
background-color: #fff; }
|
||
|
||
.table-condensed > thead > tr > th,
|
||
.table-condensed > thead > tr > td,
|
||
.table-condensed > tbody > tr > th,
|
||
.table-condensed > tbody > tr > td,
|
||
.table-condensed > tfoot > tr > th,
|
||
.table-condensed > tfoot > tr > td {
|
||
padding-left:10px; }
|
||
|
||
.table-bordered {
|
||
border: 1px solid #D9D9D9; }
|
||
.table-bordered > thead > tr > th,
|
||
.table-bordered > thead > tr > td,
|
||
.table-bordered > tbody > tr > th,
|
||
.table-bordered > tbody > tr > td,
|
||
.table-bordered > tfoot > tr > th,
|
||
.table-bordered > tfoot > tr > td {
|
||
border: 1px solid #D9D9D9; }
|
||
.table-bordered > thead > tr > th,
|
||
.table-bordered > thead > tr > td {
|
||
border-bottom-width: 2px; }
|
||
</style>
|
||
|
||
<script type="text/javascript">
|
||
$(function(){
|
||
var hideTd=new Array();
|
||
//如果来函统计数为0,去掉此列
|
||
$(".statisticsRequest").find("table th").each(function(i){
|
||
//第二列开始计算
|
||
if(i > 0){
|
||
var sum=0;
|
||
$(".statisticsRequest").find("table tr").each(function(j){
|
||
if(j>0){
|
||
sum=sum+parseInt($(this).find("td").eq(i).text());
|
||
}
|
||
});
|
||
if(sum < 1){
|
||
hideTd.push(i);
|
||
}
|
||
}
|
||
});
|
||
|
||
for(var k = 0 ; k < hideTd.length; k++){
|
||
$(".statisticsRequest").find("table tr").each(function(h){
|
||
$(this).find("th").eq(hideTd[k]).hide();
|
||
$(this).find("td").eq(hideTd[k]).hide();
|
||
});
|
||
}
|
||
closeTip();
|
||
|
||
// 导出
|
||
$(".export-btn").on("click",function(){
|
||
loading('<spring:message code="onloading"/>');
|
||
var suffix = $(this).data("export-type"); // 导出文件类型
|
||
var tableMark = $(this).data("export-table"); //导出table
|
||
var menuName = $("#menuName").val();
|
||
var fileName = menuName + "_" + getNowFormatDate();
|
||
setTemporaryRows(tableMark);
|
||
var te = $("."+tableMark).tableExport({
|
||
headings:true,
|
||
footers:true,
|
||
formats:[suffix],
|
||
fileName: fileName,
|
||
bootstrap:false
|
||
});
|
||
$("#myexport").click();
|
||
$("caption").remove();
|
||
$(".exportFirst").remove();
|
||
$("."+tableMark+" .count").empty();
|
||
closeTip();
|
||
});
|
||
});
|
||
function setTemporaryRows(tableMark){
|
||
//1. 设置td合计
|
||
var tb=document.getElementsByName(tableMark)[0];
|
||
var rows = tb.rows;
|
||
var cells = tb.cells;
|
||
var colums = tb.rows[0].cells.length;
|
||
$("."+tableMark+" .count").empty();
|
||
$("."+tableMark+" .count").append("<td><spring:message code='report_total' /></td>");
|
||
|
||
for(var j = 1; j < colums; j++){
|
||
var sum = 0;
|
||
for(var i = 1;i<rows.length-1;i++){
|
||
var a = parseInt(rows[i].cells[j].innerHTML.trim());
|
||
sum = sum + a;
|
||
}
|
||
$("."+tableMark+" .count").append("<td>"+sum+"</td>");
|
||
}
|
||
|
||
var table = $("."+tableMark);
|
||
//2. 设置导出第一行
|
||
if(tableMark == "cfgMenuTable"){
|
||
var title = table.parent("div:first").siblings("font").text().trim().replace(/\s/g,'');
|
||
}else{
|
||
var title = table.siblings("font").text().trim().replace(/\s/g,'');
|
||
}
|
||
var addTr = "<tr class='exportFirst' class='hidden'><td>"+title+"</td></tr>";
|
||
$("."+tableMark+"> thead").prepend(addTr);
|
||
|
||
}
|
||
function getNowFormatDate() {
|
||
var date = new Date();
|
||
var year = date.getFullYear();
|
||
var month = date.getMonth() + 1;
|
||
var strDate = date.getDate();
|
||
var hours = date.getHours();
|
||
var minutes = date.getMinutes();
|
||
var seconds = date.getSeconds();
|
||
if (month >= 1 && month <= 9) {
|
||
month = "0" + month;
|
||
}
|
||
if (strDate >= 0 && strDate <= 9) {
|
||
strDate = "0" + strDate;
|
||
}
|
||
if (hours >= 1 && hours <= 9) {
|
||
hours = "0" + hours;
|
||
}
|
||
if (minutes >= 1 && minutes <= 9) {
|
||
minutes = "0" + minutes;
|
||
}
|
||
if (seconds >= 1 && seconds <= 9) {
|
||
seconds = "0" + seconds;
|
||
}
|
||
var currentdate = year+""+ month+""+strDate+""+ hours+""+ minutes+""+seconds;
|
||
return currentdate;
|
||
}
|
||
//来函和业务配置统计打印
|
||
function cfgMenuPrint(){
|
||
$.ajax({
|
||
type:'post',
|
||
async:false,
|
||
cache:false,
|
||
url:'${ctx}/configure/statistics/configureStateStatisticsPrint',//
|
||
dataType:"json",
|
||
success:function(data){
|
||
if(data !=null){
|
||
var menu=data.menuList;
|
||
var dataList=data.requestStatisticList;
|
||
|
||
var userTableStr='';
|
||
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap logTb">';
|
||
userTableStr += '<thead>';
|
||
userTableStr += '<tr>';
|
||
userTableStr += '<th class="sort-column"><spring:message code="letter"/></th>';
|
||
for (var i = 0; i < menu.length; i++) {
|
||
if (menu[i].functionId == 8) {
|
||
userTableStr += '<th class="sort-column">HTTP '+menu[i].code+'</th>';
|
||
} else if(menu[i].functionId == 35){
|
||
userTableStr += '<th class="sort-column">MAIL '+menu[i].code+'</th>';
|
||
}else {
|
||
userTableStr += '<th class="sort-column">'+menu[i].code+'</th>';
|
||
}
|
||
}
|
||
userTableStr += '</tr>';
|
||
userTableStr += '</thead>';
|
||
userTableStr += '<tbody>';
|
||
for(var j=0;j<dataList.length;j++){
|
||
userTableStr += '<tr>';
|
||
userTableStr += '<td>';
|
||
userTableStr += dataList[j].request;
|
||
userTableStr += '</td>';
|
||
for (var k = 0; k < menu.length; k++) {
|
||
userTableStr += '<td>';
|
||
var sss=menu[k].functionId+'_'+menu[k].functionId;
|
||
userTableStr += dataList[j][sss];
|
||
userTableStr += '</td>';
|
||
}
|
||
userTableStr += '<tr>';
|
||
}
|
||
userTableStr +='</tbody>';
|
||
userTableStr +='</table>';
|
||
$("#contentPrintTable").html(userTableStr);
|
||
}
|
||
}
|
||
});
|
||
$("#contentPrintTable").css('display','block');
|
||
$("#contentPrintTable").print({
|
||
globalStyles: true,
|
||
iframe: true,
|
||
append: null
|
||
});
|
||
$("#contentPrintTable").css('display','none');
|
||
/* $(".cfgMenuTable").print({
|
||
globalStyles: true,
|
||
iframe: true,
|
||
append: null
|
||
}); */
|
||
}
|
||
//配置业务和状态统计打印
|
||
function statisticsPrint() {
|
||
$(".statisticsStatusTable").print({
|
||
globalStyles: true,
|
||
iframe: true,
|
||
append: null
|
||
});
|
||
}
|
||
</script>
|
||
</head>
|
||
<title>index</title>
|
||
</head>
|
||
|
||
<body class="page-full-width">
|
||
<input id="menuName" type="hidden" value="<spring:message code="config_service_statistics"/>">
|
||
<div class="statisticsRequest">
|
||
<form id="searchForm" action="${ctx}/configure/statistics/configureStateStatistics" >
|
||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||
<font size="4"><i class="fa fa-cogs"> <spring:message code="letter_statistics_info"/>
|
||
[<spring:message code="statistic_time"/>:${requestStatisticTime }]
|
||
</i>
|
||
</font>
|
||
<a style="color:#333333" href="javascript:page(${page.pageNo},${page.pageSize});" class="icon-refresh"> </a>
|
||
<div class="pull-right">
|
||
<div class="btn-group">
|
||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" style="margin-top: -5px;">
|
||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||
<i class="fa fa-angle-down"></i>
|
||
</button>
|
||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||
<li><a href="javascript:;" class="export-btn" data-export-type="xlsx" data-export-table="cfgMenuTable"><i class="fa fa-download"> <spring:message code="Excel"/></i></a></li>
|
||
<li><a href="javascript:;" class="export-btn" data-export-type="csv" data-export-table="cfgMenuTable"><i class="fa fa-download"> <spring:message code="CSV"/></i></a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="btn-group">
|
||
<button type="button" class="btn btn-default css-print" onClick="cfgMenuPrint()" style="margin-top: -5px;">
|
||
<i class="fa glyphicon glyphicon-print" style="top:3px;margin-right: 3px;"></i><spring:message code="print"/></button>
|
||
</div>
|
||
</div>
|
||
<h5 class="page-header"></h5>
|
||
<div class="tableDiv">
|
||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap cfgMenuTable" name="cfgMenuTable">
|
||
<thead>
|
||
<tr>
|
||
<th><spring:message code="letter"/></th>
|
||
<c:forEach items="${fns:getMenuCfgList() }" var="functionDict" varStatus="status" step="1">
|
||
<th>
|
||
<c:choose>
|
||
<c:when test="${functionDict.functionId eq 8}">
|
||
HTTP <spring:message code="${functionDict.code }"/>
|
||
</c:when>
|
||
<c:when test="${functionDict.functionId eq 35}">
|
||
MAIL <spring:message code="${functionDict.code }"/>
|
||
</c:when>
|
||
<c:otherwise>
|
||
<spring:message code="${functionDict.code }"/>
|
||
</c:otherwise>
|
||
</c:choose>
|
||
</th>
|
||
</c:forEach>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<c:forEach items="${page.list }" var="requestStatistics" varStatus="statusRequest" step="1">
|
||
<tr>
|
||
<td>
|
||
${requestStatistics['request']}
|
||
</td>
|
||
<c:forEach items="${fns:getMenuCfgList() }" var="functionDict" varStatus="status" step="1">
|
||
<td>
|
||
<c:set var="functionId" value="${functionDict.functionId}_${functionDict.functionId}"></c:set>
|
||
${requestStatistics[functionId]}
|
||
</<td>
|
||
</c:forEach>
|
||
|
||
</tr>
|
||
</c:forEach>
|
||
<tr class="count"></tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</form>
|
||
<div class="page">${page}</div>
|
||
<div id="contentPrintTable" style="display: none;"></div>
|
||
</div>
|
||
<div id="statisticsStatus" class="statisticsStatus">
|
||
<font size="4">
|
||
<i class="fa fa-cogs"> <spring:message code="configure_statistics_info"/>
|
||
[<spring:message code="statistic_time"/>:${configStatisticTime }]</i>
|
||
</font>
|
||
<a style="color:#333333" href="javascript:page(${page.pageNo},${page.pageSize});" class="icon-refresh "> </a>
|
||
<div class="pull-right">
|
||
<div class="btn-group">
|
||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" style="margin-top: -5px;">
|
||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||
<i class="fa fa-angle-down"></i>
|
||
</button>
|
||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||
<li><a href="javascript:;" class="export-btn" data-export-type="xlsx" data-export-table="statisticsStatusTable"><i class="fa fa-download"> <spring:message code="Excel"/></i></a></li>
|
||
<li><a href="javascript:;" class="export-btn" data-export-type="csv" data-export-table="statisticsStatusTable"><i class="fa fa-download"> <spring:message code="CSV"/></i></a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="btn-group">
|
||
<button type="button" class="btn btn-default css-print" onClick="statisticsPrint()" style="margin-top: -5px;">
|
||
<i class="fa glyphicon glyphicon-print" style="top:3px;margin-right: 3px;"></i><spring:message code="print"/></button>
|
||
</div>
|
||
</div>
|
||
<h5 class="page-header"></h5>
|
||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap statisticsStatusTable" name="statisticsStatusTable">
|
||
<thead>
|
||
<tr>
|
||
<th><spring:message code="service_name"/></th>
|
||
<th><spring:message code="approved"/></th>
|
||
<th><spring:message code="unapproved"/></th>
|
||
<th><spring:message code="cancel_approved"/></th>
|
||
<th><spring:message code="created"/></th>
|
||
<th><spring:message code="deleted"/></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<c:forEach items="${configStatistics }" var="statistics" varStatus="status" step="1">
|
||
<%-- <c:set var="serviceName" value=""></c:set>
|
||
<c:forEach items="${serviceList }" var="serviceDict" varStatus="status" step="1">
|
||
<c:if test="${serviceDict.serviceId eq statistics.service }">
|
||
<c:set var="serviceName" value="${serviceDict.serviceName }"></c:set>
|
||
</c:if>
|
||
</c:forEach> --%>
|
||
<c:set var="functionName" value=""></c:set>
|
||
<c:forEach items="${fns:getMenuCfgList() }" var="functionDict" varStatus="status" step="1">
|
||
<c:if test="${(functionDict.functionId eq statistics.functionId)}">
|
||
<c:choose>
|
||
<c:when test="${functionDict.functionId eq 8 && functionDict.code eq 'advanced'}">
|
||
<c:set var="functionName" value="HTTP ${functionDict.code }"></c:set>
|
||
</c:when>
|
||
<c:when test="${functionDict.functionId eq 35 && functionDict.code eq 'advanced'}">
|
||
<c:set var="functionName" value="MAIL ${functionDict.code }"></c:set>
|
||
</c:when>
|
||
<c:otherwise>
|
||
<c:set var="functionName" value="${functionDict.code }"></c:set>
|
||
</c:otherwise>
|
||
</c:choose>
|
||
</c:if>
|
||
</c:forEach>
|
||
<%-- <c:if test="${!empty serviceName }"> --%>
|
||
<c:if test="${!empty functionName }">
|
||
<tr>
|
||
<td>
|
||
<%-- <spring:message code="${serviceName }"/>${serviceName } --%>
|
||
<spring:message code="${functionName }"/>
|
||
</td>
|
||
<td>
|
||
${statistics.approved }
|
||
</td>
|
||
<td>
|
||
${statistics.unapproved }
|
||
</td>
|
||
<td>
|
||
${statistics.cancle_approved }
|
||
</td>
|
||
<td>
|
||
${statistics.created }
|
||
</td>
|
||
<td>
|
||
${statistics.deleted }
|
||
</td>
|
||
</tr>
|
||
</c:if>
|
||
</c:forEach>
|
||
<tr class="count"></tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</body>
|
||
</html>
|