1.统计报表模块打印添加标题和合计行 2.Website Statistics页面unique改为client IP

3.Logs-HTTP-KeywordLogToURL和实时统计-Statistics-Packet,Stream,Protocol,multimedia,Anti
DDos,Proxy页面自定义列全部隐藏时,不允许导出,提示用户
This commit is contained in:
shangguanyanfei
2019-01-14 17:34:20 +08:00
parent e94c448fb1
commit d4270894b5
20 changed files with 699 additions and 171 deletions

View File

@@ -395,7 +395,32 @@ public class NtcEventBlockController extends BaseController {
list = data.getList();
}
}
//计算合计,并添加在集合的最后位置
Properties msgProp = getMsgProp();
NtcEventMonitorOrBlockReport ntcEventMonitorOrBlockReport = new NtcEventMonitorOrBlockReport();
long ipNum = 0;
long httpNum = 0;
long mailNum = 0;
long vedioNum = 0;
long agentNum = 0;
for (NtcEventMonitorOrBlockReport entity : list) {
ipNum += entity.getIpNum();
httpNum += entity.getHttpNum();
mailNum += entity.getMailNum();
vedioNum += entity.getVedioNum();
agentNum += entity.getAgentNum();
}
String report_total = msgProp.getProperty("report_total");
ntcEventMonitorOrBlockReport.setIpNum(ipNum);
ntcEventMonitorOrBlockReport.setHttpNum(httpNum);
ntcEventMonitorOrBlockReport.setMailNum(mailNum);
ntcEventMonitorOrBlockReport.setVedioNum(vedioNum);
ntcEventMonitorOrBlockReport.setAgentNum(agentNum);
ntcEventMonitorOrBlockReport.setTaskIds(report_total);
ntcEventMonitorOrBlockReport.setTaskName("    一   ");
ntcEventMonitorOrBlockReport.setTaskTime("    一   ");
ntcEventMonitorOrBlockReport.setReportTime("    一   ");
list.add(ntcEventMonitorOrBlockReport);
return list;
} catch (Exception e) {
logger.error("ntc_event_block_report print failed", e);

View File

@@ -386,6 +386,30 @@ public class NtcEventKeyProtectionController extends BaseController {
list = data.getList();
}
}
//计算合计,并填加到集合最后
Properties msgProp = getMsgProp();
NtcEventKeyProtectionReport ntcEventKey=new NtcEventKeyProtectionReport();
long letterNum=0;
long configNum=0;
long monitorNum=0;
long controlNum=0;
for (NtcEventKeyProtectionReport entity : list) {
letterNum += entity.getLetterNum();
configNum += entity.getConfigNum();
monitorNum += entity.getMonitorNum();
controlNum += entity.getControlNum();
}
String report_total=msgProp.getProperty("report_total");
ntcEventKey.setLetterNum(letterNum);
ntcEventKey.setConfigNum(configNum);
ntcEventKey.setMonitorNum(monitorNum);
ntcEventKey.setControlNum(controlNum);
ntcEventKey.setTaskIds(report_total);
ntcEventKey.setTaskName("    一   ");
ntcEventKey.setTaskTime("    一   ");
ntcEventKey.setReportTime("    一   ");
list.add(ntcEventKey);
return list;
} catch (Exception e) {
logger.error("ntc_event_key_protection_report print failed", e);

View File

@@ -393,6 +393,32 @@ public class NtcEventMonitorController extends BaseController {
list = data.getList();
}
}
//计算合计,并添加到集合的最后
Properties msgProp = getMsgProp();
NtcEventMonitorOrBlockReport ntcEventMonitorOrBlockReport = new NtcEventMonitorOrBlockReport();
long ipNum = 0;
long httpNum = 0;
long mailNum = 0;
long vedioNum = 0;
long agentNum = 0;
for (NtcEventMonitorOrBlockReport entity : list) {
ipNum += entity.getIpNum();
httpNum += entity.getHttpNum();
mailNum += entity.getMailNum();
vedioNum += entity.getVedioNum();
agentNum += entity.getAgentNum();
}
String report_total = msgProp.getProperty("report_total");
ntcEventMonitorOrBlockReport.setIpNum(ipNum);
ntcEventMonitorOrBlockReport.setHttpNum(httpNum);
ntcEventMonitorOrBlockReport.setMailNum(mailNum);
ntcEventMonitorOrBlockReport.setVedioNum(vedioNum);
ntcEventMonitorOrBlockReport.setAgentNum(agentNum);
ntcEventMonitorOrBlockReport.setTaskIds(report_total);
ntcEventMonitorOrBlockReport.setTaskName("    一   ");
ntcEventMonitorOrBlockReport.setTaskTime("    一   ");
ntcEventMonitorOrBlockReport.setReportTime("    一   ");
list.add(ntcEventMonitorOrBlockReport);
return list;
} catch (Exception e) {
logger.error("ntc_event_monitor_report print failed", e);

View File

@@ -613,6 +613,23 @@ public class ReportController extends BaseController {
list = data.getList();
}
}
Properties msgProp = getMsgProp();
NtcAsnRecord ntcAsnRecord = new NtcAsnRecord();
double pps = 0;
double bps = 0;
for (NtcAsnRecord entity : list) {
if (null != entity.getBps() && !"".equals(entity.getBps())) {
bps += Double.valueOf(entity.getBps());
}
if (null != entity.getPps() && !"".equals(entity.getPps())) {
pps += Double.valueOf(entity.getPps());
}
}
String report_total = msgProp.getProperty("report_total");
ntcAsnRecord.setAsn(report_total);
ntcAsnRecord.setBps(String.format("%.2f", bps));
ntcAsnRecord.setPps(String.format("%.2f", pps));
list.add(ntcAsnRecord);
return list;
} catch (Exception e) {
logger.error("Ntc_Asn_Record print failed", e);
@@ -664,6 +681,19 @@ public class ReportController extends BaseController {
list = data.getList();
}
}
Properties msgProp = getMsgProp();
NtcURLReport ntcURLReport = new NtcURLReport();
long ipCount=0;
long connCount=0;
for (NtcURLReport entity : list) {
ipCount += entity.getIpCount();
connCount += entity.getConnCount();
}
String report_total = msgProp.getProperty("report_total");
ntcURLReport.setIpCount(ipCount);
ntcURLReport.setConnCount(connCount);
ntcURLReport.setUrl(report_total);
list.add(ntcURLReport);
return list;
} catch (Exception e) {
logger.error("Ntc_HTTPS_Report print failed", e);

View File

@@ -415,6 +415,10 @@ function cancelPassOpt(url){
url+="&"+$("#exportType").val()+"="+$("#exportValue").val();
}
}
if(column.toString()!="" && column.toString() =="<spring:message code='log'/>"){
top.$.jBox.tip("<spring:message code='all_columns_hidden'/>", "<spring:message code='info'/>");
return;
}
if(column.toString()!=""){
url+="&columns="+column.toString();
}else{

View File

@@ -212,11 +212,25 @@ function ajaxAppList(start,end,entranceId){
//打印列表
function doPrint() {
getPageData(1,999999);// 设置打印条数
//统计数据
var tb=document.getElementById("contentTable");
var rows=tb.rows;
$("#contentTable tbody tr").removeClass("hidden");
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"contentTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="App"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$("#beginDate").val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$("#endDate").val()+'</div>';
$('.tr-total').addClass("tc");
$("#contentTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$('.tr-total').addClass("hidden");
getPageData(1,10);
pageJuan(10);//初始化分页
}
@@ -343,6 +357,7 @@ function htmlData(fileDataS){
if(index==fileDataS.length-1){
html+="<tr class='tr-total hidden'>"
html+= "<td class='tc'>"+"<spring:message code='report_total'/>"+"</td>";
html+= "<td class='tc'>" +"--"+"</td>"
html+= "<td class='tc'>"+totalLink+"</td>";
html+= "<td class='tc'>" +"100%"+"</td>";
html+= "<td class='tc'>"+Math.round(totalPackets*100)/100+"</td>";

View File

@@ -173,11 +173,25 @@ function ajaxProtocolList(start,end){
//打印列表
function doPrint() {
getPageData(1,999999);// 设置打印条数
//统计数据
var tb=document.getElementById("contentTable");
var rows=tb.rows;
$("#contentTable tbody tr").removeClass("hidden");
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"contentTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="service"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$("#beginDate").val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$("#endDate").val()+'</div>';
$('.tr-total').addClass("tc");
$("#contentTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$('.tr-total').addClass("hidden");
getPageData(1,10);
pageJuan(10);//初始化分页
}

View File

@@ -150,11 +150,24 @@ $(document).ready(function(){
});
//打印列表
function doPrint() {
//统计数据
var tb=document.getElementById("contentTable");
var rows=tb.rows;
$("#contentTable tbody tr").removeClass("hidden");
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"contentTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="traffic_ipactive_hour_max"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$("#beginDate").val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$("#endDate").val()+'</div>';
$("#contentTable").print({
globalStyles: true,
iframe: true,
append: null
});
append: null,
prepend: title
});
$('.tr-total').addClass("hidden");
}
//导出列表
$(".export-btn").click(function(){

View File

@@ -203,11 +203,25 @@ function ajaxProtocolList(start,end,entranceId){
//打印列表
function doPrint() {
getPageData(1,999999);// 设置打印条数
//统计数据
var tb=document.getElementById("contentTable");
var rows=tb.rows;
$("#contentTable tbody tr").removeClass("hidden");
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"contentTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="protocol_type"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$("#beginDate").val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$("#endDate").val()+'</div>';
$('.tr-total').addClass("tc");
$("#contentTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$('.tr-total').addClass("hidden");
getPageData(1,10);
pageJuan(10);//初始化分页
}

View File

@@ -144,7 +144,7 @@
<tr>
<th><spring:message code="trend"/></th>
<th><spring:message code="domain_name"/></th>
<th><spring:message code="unique_num"/></th>
<th><spring:message code="client_ip"/></th>
<th><spring:message code="area_id"/></th>
<th><spring:message code="packets"/></th>
<th><spring:message code="percentage"/> (<spring:message code="packets"/>)</th>
@@ -255,11 +255,25 @@
//打印列表
function doPrint() {
getPageData(1,999999);// 设置打印条数
//统计数据
var tb=document.getElementById("contentTable");
var rows=tb.rows;
$("#contentTable tbody tr").removeClass("hidden");
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"contentTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="domain_name"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$("#beginDate").val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$("#endDate").val()+'</div>';
$('.tr-total').addClass("tc");
$("#contentTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$('.tr-total').addClass("hidden");
getPageData(1,10);
pageJuan(10);//初始化分页
}
@@ -388,11 +402,12 @@
if(index==fileDataS.length-1){
html+="<tr class='tr-total hidden'>"
html+= "<td class='tc'>"+"<spring:message code='report_total'/>"+"</td>";
html+= "<td class='tc'>" +"--"+"</td>"
html+= "<td class='tc'>"+totalunique+"</td>";
html+= "<td class='tc'>" +"--"+"</td>";
html+= "<td class='tc'>"+totalPackets+"</td>";
html+= "<td class='tc'>"+parseInt(totalPackets).toFixed(2)+"</td>";
html+= "<td class='tc'>"+"100%"+"</td>";
html+= "<td class='tc'>"+totalGbyte+"</td>";
html+= "<td class='tc'>"+parseInt(totalGbyte).toFixed(2)+"</td>";
html+= "<td class='tc'>"+"100%"+"</td>";
html+="</tr>"
}

View File

@@ -193,7 +193,7 @@
var dataList=data.requestStatisticList;
var userTableStr='';
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr +='<table id="printTable" 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>';
@@ -217,7 +217,11 @@
for (var k = 0; k < menu.length; k++) {
userTableStr += '<td>';
var sss=menu[k].functionId+'_'+menu[k].functionId;
userTableStr += dataList[j][sss];
if(dataList[j][sss] !=undefined && dataList[j][sss] !=null &&dataList[j][sss] !=""){
userTableStr += dataList[j][sss];
}else{
userTableStr += "0";
}
userTableStr += '</td>';
}
userTableStr += '<tr>';
@@ -228,26 +232,69 @@
}
}
});
//计算合计行
var tb=document.getElementById("printTable");
var rows = tb.rows;
var colums = tb.rows[0].cells.length;
var trtotal="";
trtotal+="<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++){
if(rows[i].cells[j] !=undefined && rows[i].cells[j].innerHTML !=""){
var a = parseInt(rows[i].cells[j].innerHTML.trim());
sum = sum + a;
}
}
trtotal+="<td>"+sum+"</td>";
}
$('#total').remove();
$('#printTable tbody').append("<tr id='total'></tr>");
$('#total').html(trtotal);
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"printTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="letter_statistics_info"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="statistic_time"/>&nbsp;&nbsp;&nbsp;'+$("#requestStatisticTime").val()+'</div>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
/* $(".cfgMenuTable").print({
globalStyles: true,
iframe: true,
append: null
}); */
}
//配置业务和状态统计打印
function statisticsPrint() {
function statisticsPrint() {
$('.count').removeClass("hidden");
//计算合计行
var tb=document.getElementsByName("statisticsStatusTable")[0];
var rows = tb.rows;
var colums = tb.rows[0].cells.length;
$(".statisticsStatusTable .count").empty();
$(".statisticsStatusTable .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;
}
$(".statisticsStatusTable .count").append("<td>"+sum+"</td>");
}
//为某一列或者 某一行 添加样式
addPrintTableCss(rows.length-1,0,"contentTable2","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="configure_statistics_info"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="statistic_time"/>&nbsp;&nbsp;&nbsp;'+$("#configStatisticTime").val()+'</div>';
//打印
$(".statisticsStatusTable").print({
globalStyles: true,
iframe: true,
append: null
});
append: null,
prepend: title
});
//隐藏合计行
$('.count').addClass("hidden");
}
@@ -323,6 +370,7 @@
<body class="page-full-width">
<input id="menuName" type="hidden" value="<spring:message code="config_service_statistics"/>">
<input id="requestStatisticTime" type="hidden" value="${requestStatisticTime }" />
<div class="statisticsRequest">
<form id="searchForm" action="${ctx}/configure/statistics/configureStateStatistics" >
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
@@ -398,6 +446,7 @@
<div id="contentPrintTable" style="display: none;"></div>
</div>
<div id="statisticsStatus" class="statisticsStatus">
<input id="configStatisticTime" type="hidden" value="${configStatisticTime }" />
<font size="4">
<i class="fa fa-cogs" id="statusTitle"><spring:message code="configure_statistics_info"/> [<spring:message code="statistic_time"/>${configStatisticTime }]</i>
</font>
@@ -419,7 +468,7 @@
</div>
</div>
<h5 class="page-header"></h5>
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap statisticsStatusTable" name="statisticsStatusTable">
<table id="contentTable2" class="table table-striped table-bordered table-condensed text-nowrap statisticsStatusTable" name="statisticsStatusTable">
<thead>
<tr>
<th><spring:message code="service_name"/></th>

View File

@@ -68,40 +68,65 @@
dataType:"json",
success:function(data){
if(data !=null){
var thData=$('#contentTable thead tr th');
var userTableStr='';
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr +='<table id="printTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr += '<thead>';
userTableStr += '<tr>';
userTableStr += '<th class="sort-column s_asn"><spring:message code="asn"/></th>';
userTableStr += '<th class="sort-column pps"><spring:message code="pps"/></th>';
userTableStr += '<th class="sort-column bps"><spring:message code="bps"/></th>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='asn'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="asn"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='pps'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="pps"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='bps'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="bps"/></td>';
}
}
userTableStr += '</tr>';
userTableStr += '</thead>';
userTableStr += '<tbody>';
for(var j=0;j<data.length;j++){
userTableStr += '<tr>';
userTableStr += '<td>';
userTableStr += data[j].asn;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].pps;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].bps;
userTableStr += '</td>';
userTableStr += '<tr>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='asn'/>") {
userTableStr += '<td>';
userTableStr += data[j].asn;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='pps'/>") {
userTableStr += '<td>';
userTableStr += data[j].pps;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='bps'/>") {
userTableStr += '<td>';
userTableStr += data[j].bps;
userTableStr += '</td>';
}
}
userTableStr += '</tr>';
}
userTableStr +='</tbody>';
userTableStr +='</table>';
$("#contentPrintTable").html(userTableStr);
//为某一列或者 某一行 添加样式
addPrintTableCss(data.length,0,"printTable","print-title");
}
}
});
//为某一列或者 某一行 添加样式
// addPrintTableCss(5,2,"printTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="asn_conn_report"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$('[name="searchFoundStartTime"]').val()+'&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$('[name="searchFoundEndTime"]').val()+'</div>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
}

View File

@@ -92,54 +92,114 @@
dataType:"json",
success:function(data){
if(data !=null){
var thData=$('#contentTable thead tr th');
var userTableStr='';
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr +='<table id="printTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr += '<thead>';
userTableStr += '<tr>';
userTableStr += '<th class="sort-column"><spring:message code="task_id"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="task_name"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="ip_count"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="http_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="mail_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="vedio_count"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="agent_count"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="task_time"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="stat_time"/></th>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_id'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_id"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_name'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_name"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="ip_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='http_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="http_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='mail_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="mail_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='vedio_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="vedio_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='agent_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="agent_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_time'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_time"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='stat_time'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="stat_time"/></td>';
}
}
userTableStr += '</tr>';
userTableStr += '</thead>';
userTableStr += '<tbody>';
for(var j=0;j<data.length;j++){
userTableStr += '<tr><td>';
userTableStr += data[j].taskIds;
userTableStr += '</td><td>';
userTableStr += data[j].taskName;
userTableStr += '</td><td>';
userTableStr += data[j].ipNum;
userTableStr += '</td><td>';
userTableStr += data[j].httpNum;
userTableStr += '</td><td>';
userTableStr += data[j].mailNum;
userTableStr += '</td><td>';
userTableStr += data[j].vedioNum;
userTableStr += '</td><td>';
userTableStr += data[j].agentNum;
userTableStr += '</td><td>';
userTableStr += data[j].taskTime;
userTableStr += '</td><td>';
userTableStr += data[j].reportTime;
userTableStr += '</td><tr>';
userTableStr += '<tr>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_id'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskIds;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_name'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskName;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].ipNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='http_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].httpNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='mail_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].mailNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='vedio_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].vedioNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='agent_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].agentNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_time'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskTime;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='stat_time'/>") {
userTableStr += '<td>';
userTableStr += data[j].reportTime;
userTableStr += '</td>';
}
}
userTableStr += '</tr>';
}
userTableStr +='</tbody>';
userTableStr +='</table>';
$("#contentPrintTable").html(userTableStr);
//为某一列或者 某一行 添加样式
addPrintTableCss(data.length,0,"printTable","print-title");
}
}
});
//为某一列或者 某一行 添加样式
// addPrintTableCss(4,2,"printTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="ntc_event_block_report"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="task_time"/>:'+$('[name="searchTaskStartTime"]').val()+'—'+$('[name="searchTaskEndTime"]').val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="stat_time"/>:'+$('[name="searchReportStartTime"]').val()+'—'+$('[name="searchReportEndTime"]').val()+'</div>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
}

View File

@@ -93,51 +93,104 @@
dataType:"json",
success:function(data){
if(data !=null){
var thData=$('#contentTable thead tr th');
var userTableStr='';
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr +='<table id="printTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr += '<thead>';
userTableStr += '<tr>';
userTableStr += '<th class="sort-column"><spring:message code="task_id"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="task_name"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="letter_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="config_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="monitor_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="control_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="task_time"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="stat_time"/></th>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_id'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_id"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_name'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_name"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='letter_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="letter_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='config_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="config_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='monitor_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="monitor_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='control_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="control_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_time'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_time"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='stat_time'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="stat_time"/></td>';
}
}
userTableStr += '</tr>';
userTableStr += '</thead>';
userTableStr += '<tbody>';
for(var j=0;j<data.length;j++){
userTableStr += '<tr><td>';
userTableStr += data[j].taskIds;
userTableStr += '</td><td>';
userTableStr += data[j].taskName;
userTableStr += '</td><td>';
userTableStr += data[j].letterNum;
userTableStr += '</td><td>';
userTableStr += data[j].configNum;
userTableStr += '</td><td>';
userTableStr += data[j].monitorNum;
userTableStr += '</td><td>';
userTableStr += data[j].controlNum;
userTableStr += '</td><td>';
userTableStr += data[j].taskTime;
userTableStr += '</td><td>';
userTableStr += data[j].reportTime;
userTableStr += '</td><tr>';
userTableStr += '<tr>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_id'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskIds;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_name'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskName;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='letter_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].letterNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='config_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].configNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='monitor_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].monitorNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='control_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].controlNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_time'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskTime;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='stat_time'/>") {
userTableStr += '<td>';
userTableStr += data[j].reportTime;
userTableStr += '</td>';
}
}
userTableStr += '</tr>';
}
userTableStr +='</tbody>';
userTableStr +='</table>';
$("#contentPrintTable").html(userTableStr);
//为某一列或者 某一行 添加样式
addPrintTableCss(data.length,0,"printTable","print-title");
}
}
});
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="ntc_event_key_protection_report"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="task_time"/>:'+$('[name="searchTaskStartTime"]').val()+'—'+$('[name="searchTaskEndTime"]').val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="stat_time"/>:'+$('[name="searchReportStartTime"]').val()+'—'+$('[name="searchReportEndTime"]').val()+'</div>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
}

View File

@@ -101,54 +101,112 @@
dataType:"json",
success:function(data){
if(data !=null){
var thData=$('#contentTable thead tr th');
var userTableStr='';
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr +='<table id="printTable" class="table table-striped table-bordered table-condensed text-nowrap logTb">';
userTableStr += '<thead>';
userTableStr += '<tr>';
userTableStr += '<th class="sort-column"><spring:message code="task_id"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="task_name"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="ip_count"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="http_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="mail_num"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="vedio_count"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="agent_count"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="task_time"/></th>';
userTableStr += '<th class="sort-column"><spring:message code="stat_time"/></th>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_id'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_id"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_name'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_name"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="ip_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='http_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="http_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='mail_num'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="mail_num"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='vedio_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="vedio_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='agent_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="agent_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_time'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="task_time"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='stat_time'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="stat_time"/></td>';
}
}
userTableStr += '</tr>';
userTableStr += '</thead>';
userTableStr += '<tbody>';
for(var j=0;j<data.length;j++){
userTableStr += '<tr><td>';
userTableStr += data[j].taskIds;
userTableStr += '</td><td>';
userTableStr += data[j].taskName;
userTableStr += '</td><td>';
userTableStr += data[j].ipNum;
userTableStr += '</td><td>';
userTableStr += data[j].httpNum;
userTableStr += '</td><td>';
userTableStr += data[j].mailNum;
userTableStr += '</td><td>';
userTableStr += data[j].vedioNum;
userTableStr += '</td><td>';
userTableStr += data[j].agentNum;
userTableStr += '</td><td>';
userTableStr += data[j].taskTime;
userTableStr += '</td><td>';
userTableStr += data[j].reportTime;
userTableStr += '</td><tr>';
userTableStr += '<tr>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_id'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskIds;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_name'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskName;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].ipNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='http_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].httpNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='mail_num'/>") {
userTableStr += '<td>';
userTableStr += data[j].mailNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='vedio_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].vedioNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='agent_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].agentNum;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='task_time'/>") {
userTableStr += '<td>';
userTableStr += data[j].taskTime;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='stat_time'/>") {
userTableStr += '<td>';
userTableStr += data[j].reportTime;
userTableStr += '</td>';
}
}
userTableStr += '</tr>';
}
userTableStr +='</tbody>';
userTableStr +='</table>';
$("#contentPrintTable").html(userTableStr);
//为某一列或者 某一行 添加样式
addPrintTableCss(data.length,0,"printTable","print-title");
}
}
});
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="ntc_event_monitor_report"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="task_time"/>:'+$('[name="searchTaskStartTime"]').val()+'—'+$('[name="searchTaskEndTime"]').val();
title+='&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="stat_time"/>:'+$('[name="searchReportStartTime"]').val()+'—'+$('[name="searchReportEndTime"]').val()+'</div>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
}

View File

@@ -51,36 +51,61 @@
dataType:"json",
success:function(data){
if(data !=null){
var thData=$('#contentTable thead tr th');
var userTableStr='';
userTableStr +='<table class="table table-striped table-bordered table-condensed text-nowrap">';
userTableStr +='<table id="printTable" class="table table-striped table-bordered table-condensed text-nowrap">';
userTableStr += '<thead>';
userTableStr += '<tr>';
userTableStr += '<th class="sort-column"><spring:message code="ip_start"/></td>';
userTableStr += '<th class="sort-column"><spring:message code="ip_end"/></td>';
userTableStr += '<th class="sort-column"><spring:message code="ip_sub"/></td>';
userTableStr += '<th class="sort-column"><spring:message code="country"/></td>';
userTableStr += '<th class="sort-column"><spring:message code="desc"/></td>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_start'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="ip_start"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_end'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="ip_end"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_sub'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="ip_sub"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='country'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="country"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='desc'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="desc"/></td>';
}
}
userTableStr += '</tr>';
userTableStr += '</thead>';
userTableStr += '<tbody>';
for(var j=0;j<data.length;j++){
userTableStr += '<tr>';
userTableStr += '<td>';
userTableStr += data[j].ipStart;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].ipEnd;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].ipSub;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].country;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].desc;
userTableStr += '</td>';
userTableStr += '<tr>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_start'/>") {
userTableStr += '<td>';
userTableStr += data[j].ipStart;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_end'/>") {
userTableStr += '<td>';
userTableStr += data[j].ipEnd;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_sub'/>") {
userTableStr += '<td>';
userTableStr += data[j].ipSub;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='country'/>") {
userTableStr += '<td>';
userTableStr += data[j].country;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='desc'/>") {
userTableStr += '<td>';
userTableStr += data[j].desc;
userTableStr += '</td>';
}
}
userTableStr += '</tr>';
}
userTableStr +='</tbody>';
userTableStr +='</table>';
@@ -88,11 +113,15 @@
}
}
});
//为某一列或者 某一行 添加样式
// addPrintTableCss(4,2,"printTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;"><spring:message code="ip_range_report"/></h3>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
}

View File

@@ -429,28 +429,50 @@ function customColumnClick(){
}
//打印
function doPrint() {
var reportBusinessType=$("#reportBusinessType").val()
var tableId="tagTable";
if(reportBusinessType=="label_report"){
document.getElementById("tabTablePrint").scrollTop = 0;
$('th').css('transform','translateY(0px)');
$('thead tr').css('position','relative');
$('th').css('border','1px solid rgb(255, 255, 255)');
$('th').css('background-clip','padding-box');
var reportBusinessType=$("#reportBusinessType").val()
var tableId="tagTable";
var tabTitleName="<spring:message code='lwhh_report'/>";
if(reportBusinessType=="label_report"){
tableId="tagTable";
}else if(reportBusinessType=="lwhh_report"){
tabTitleName="<spring:message code='label_report'/>";
}else if(reportBusinessType=="lwhh_report"){
tableId="lwhhTable";
tabTitleName="<spring:message code='lwhh_report'/>";
}else if(reportBusinessType=="src_ip_report"){
tableId="contentTable1";
tabTitleName="<spring:message code='src_ip_report'/>";
}else if(reportBusinessType=="attr_type_report"){
tableId="attrTypeTable";
tabTitleName="<spring:message code='attr_type_report'/>";
}else if(reportBusinessType=="dest_ip_report"){
tableId="destIpTable";
tabTitleName="<spring:message code='dest_ip_report'/>";
}else if(reportBusinessType=="isp_report"){
tableId="entranceIdTable";
tabTitleName="<spring:message code='isp_report'/>";
}
$("#"+tableId+" tbody tr").removeAttr("style");
$("#"+tableId).print({
//为某一列或者 某一行 添加样式
addPrintTableCss(1,0,tableId,"print-title");
var timeType = $("#reportType").find("option:selected").text();
var time = $("#intype").val();
var title='<h3 style="text-align: center;font-weight:bold;">'+$("[name=cfgName2]").val()+'<small>(<spring:message code="report_list"/>)</small></h3>';
title+='<div style="text-align:center;font-weight:bold;">'+timeType+'&nbsp;&nbsp;&nbsp;'+time+'&nbsp;&nbsp;&nbsp;'+tabTitleName+'</div>';
$("#"+tableId).print({
globalStyles: true,
iframe: true,
append: null
});
append: null,
prepend: title
});
$("#"+tableId+" tbody td").removeClass("print-title");
pagination(30);
}
@@ -492,6 +514,10 @@ function customColumnClick(){
}
num++;
});
if(column.length ==0 ){
top.$.jBox.tip("<spring:message code='all_columns_hidden'/>", "<spring:message code='info'/>");
return;
}
for(var i=1 ; i<rows.length;i++){
var rowMap=[];
for (var j = 0; j <index.length ; j++) {
@@ -690,7 +716,7 @@ white-space:nowrap;
</c:if>
><a class="lireport" data-bussiness="isp_report" data-toggle="tab" href="#entranceId" title="<spring:message code="isp_report"/>"><spring:message code="isp_report"/></a></li>
</ul>
<div class="tab-content table-responsive">
<div id="tabTablePrint" class="tab-content table-responsive">
<div id="lwhh" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'lwhh_report' or bean.reportBusinessType ==null}">
in active

View File

@@ -72,40 +72,65 @@
dataType:"json",
success:function(data){
if(data !=null){
var thData=$('#contentTable thead tr th');
var userTableStr='';
userTableStr +='<table style="word-wrap:break-word; word-break:break-all;" class="table table-striped table-bordered table-condensed ">';
userTableStr +='<table id="printTable" style="word-wrap:break-word; word-break:break-all;" class="table table-striped table-bordered table-condensed ">';
userTableStr += '<thead>';
userTableStr += '<tr>';
userTableStr += '<th class="sort-column "><spring:message code="url"/></td>';
userTableStr += '<th class="sort-column "><spring:message code="ip_count"/></td>';
userTableStr += '<th class="sort-column "><spring:message code="counnection_count"/></td>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='url'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="url"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="ip_count"/></td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='counnection_count'/>") {
userTableStr += '<td class="sort-column print-title"><spring:message code="counnection_count"/></td>';
}
}
userTableStr += '</tr>';
userTableStr += '</thead>';
userTableStr += '<tbody>';
for(var j=0;j<data.length;j++){
userTableStr += '<tr>';
userTableStr += '<td style="width:700px;">';
userTableStr += data[j].url;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].ipCount;
userTableStr += '</td>';
userTableStr += '<td>';
userTableStr += data[j].connCount;
userTableStr += '</td>';
userTableStr += '<tr>';
for (var i = 0; i < thData.length; i++) {
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='url'/>") {
userTableStr += '<td style="width:700px;">';
userTableStr += data[j].url;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='ip_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].ipCount;
userTableStr += '</td>';
}
if (thData[i].style.display !="none" && thData[i].innerHTML=="<spring:message code='counnection_count'/>") {
userTableStr += '<td>';
userTableStr += data[j].connCount;
userTableStr += '</td>';
}
}
userTableStr += '</tr>';
}
userTableStr +='</tbody>';
userTableStr +='</table>';
$("#contentPrintTable").html(userTableStr);
//为某一列或者 某一行 添加样式
addPrintTableCss(data.length,0,"printTable","print-title");
}
}
});
//为某一列或者 某一行 添加样式
// addPrintTableCss(4,2,"printTable","print-title");
var title='<h3 style="text-align: center;font-weight:bold;" ><spring:message code="https_url_report"/></h3>';
title+='<div style="text-align:center;font-weight:bold;"><spring:message code="begin_date"/>:'+$('[name="searchReportStartTime"]').val()+'&nbsp;&nbsp;&nbsp;&nbsp;';
title+='<spring:message code="end_date"/>:'+$('[name="searchReportEndTime"]').val()+'</div>';
$("#contentPrintTable").css('display','block');
$("#contentPrintTable").print({
globalStyles: true,
iframe: true,
append: null
append: null,
prepend: title
});
$("#contentPrintTable").css('display','none');
}

View File

@@ -94,4 +94,8 @@ margin-top: 20px;
/* <20><><EFBFBD><EFBFBD>ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>,<2C><>ӡ<EFBFBD><D3A1>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ʾ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
.css-print{
display: none;
}
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD> */
.print-title{
font-weight:bold;
}

View File

@@ -1681,4 +1681,23 @@ function heightDiv(type){
}
}
window.onresize=heightDiv;
/* 打印时,为列表的某一行或者某一列添加CSS样式
* 例子如果不用添加样式就把行数和列数设置为0
* var rowValue=3; 行数
* var cellValue=2; 列数
* var tableIdValue="printTable"; table的ID的值
* var cssName="print-title print-background-color"; 要添加的class样式的名字
* */
function addPrintTableCss(rowValue,cellValue,tableIdValue,cssName){
var rows=document.getElementById(""+tableIdValue).rows;
for (var i = 0; i < rows.length; i++) {
for (var k = 0; k <rows[i].cells.length ; k++) {
if (rowValue >0 && rowValue <rows.length && rowValue== i) {
rows[i].cells[k].className=cssName;
}
if (cellValue>0 && cellValue<=rows[0].cells.length&& (cellValue-1)==k && i !=0) {
rows[i].cells[k].className=cssName;
}
}
}
}