Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop

This commit is contained in:
intraUser
2019-01-04 13:12:44 +08:00
13 changed files with 341 additions and 171 deletions

View File

@@ -603,6 +603,7 @@ public class TrafficStatisticsInfoController extends BaseController {
totalLink+=Long.parseLong(lf.format(m.get("linkNum")));
totalPackets+=Long.parseLong(lf.format(m.get("packets")));
totalGByte+=Double.parseDouble(lf.format(m.get("count")));
m.remove("domainData");
Double value1=0d;
if(StringUtil.isBlank(m.get("topicId").toString())){
value1=268435455d;
@@ -616,6 +617,8 @@ public class TrafficStatisticsInfoController extends BaseController {
break;
}
}
}
//将总数据赋值给每个实体 方便计算百分比 如果数据都为空 则不返回给页面展示
for(int i=list.size()-1;i>=0;i--) {

View File

@@ -149,7 +149,7 @@ public class CacheSessionDAO extends RedisSessionDAO {
for (Session session : getActiveSessions()){
boolean isActiveSession = false;
// 不包括离线并符合最后访问时间小于等于3分钟条件。
if (includeLeave || DateUtils.pastMinutes(session.getLastAccessTime()) <= 3){
if (includeLeave || (session!=null&&DateUtils.pastMinutes(session.getLastAccessTime()) <= 3)){
isActiveSession = true;
}
// 符合登陆者条件。

View File

@@ -1445,4 +1445,5 @@ hex_minlength_8=Please enter a hexadecimal string of length 8
hex_minlength_16=Please enter a hexadecimal string of length 16
need_input=Attributes need to be filled in
max_input=Fill in at most four
no_need_input=Attributes no need to be filled in
no_need_input=Attributes no need to be filled in
close_link=Close Link

View File

@@ -1449,4 +1449,5 @@ hex_minlength_8=Please enter a hexadecimal string of length 8
hex_minlength_16=Please enter a hexadecimal string of length 16
need_input=Attributes need to be filled in
max_input=Fill in at most four
no_need_input=Attributes no need to be filled in
no_need_input=Attributes no need to be filled in
close_link=Close Link

View File

@@ -1355,7 +1355,7 @@ show_ips=\u67e5\u770b\u6240\u6709IP
show_available_ips=\u67e5\u770b\u53ef\u7528IP
website_keyword_monit=\u5173\u952e\u5b57\u76d1\u6d4b
website_keyword_reject=\u5173\u952e\u5b57\u963b\u65ad
radius_log=Radius \u65E5\u5FD7
radius_log=Radius \u65e5\u5fd7
message_type=Code
nas_ip=NAS IP Address
framed_ip=Framed IP Address
@@ -1435,14 +1435,15 @@ min_length=\u6700\u5c0f\u957f\u5ea6
length_error=\u957f\u5ea6\u9519\u8bef
duplicate=\u91cd\u590d\u7684
print=\u6253\u5370
traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7
keyword_log_to_url=\u5173\u952E\u5B57\u65E5\u5FD7\u8F6CURL
http_log=HTTP \u65E5\u5FD7
cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177
hex_minlength_3=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A3\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
hex_minlength_4=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A4\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
hex_minlength_8=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A8\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
hex_minlength_16=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A16\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
need_input=\u9700\u8981\u586B\u5199\u5C5E\u6027
max_input=\u6700\u591A\u586B\u5199\u56DB\u4E2A
no_need_input=\u65E0\u9700\u586B\u5199\u5C5E\u6027
traffic_connect_log=\u6d41\u91cf\u65e5\u5fd7
keyword_log_to_url=\u5173\u952e\u5b57\u65e5\u5fd7\u8f6cURL
http_log=HTTP \u65e5\u5fd7
cut_sample_tool=\u6837\u4f8b\u526a\u5207\u5de5\u5177
hex_minlength_3=\u8bf7\u8f93\u5165\u957f\u5ea6\u4e3a3\u7684\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32
hex_minlength_4=\u8bf7\u8f93\u5165\u957f\u5ea6\u4e3a4\u7684\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32
hex_minlength_8=\u8bf7\u8f93\u5165\u957f\u5ea6\u4e3a8\u7684\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32
hex_minlength_16=\u8bf7\u8f93\u5165\u957f\u5ea6\u4e3a16\u7684\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32
need_input=\u9700\u8981\u586b\u5199\u5c5e\u6027
max_input=\u6700\u591a\u586b\u5199\u56db\u4e2a
no_need_input=\u65e0\u9700\u586b\u5199\u5c5e\u6027
close_link=\u5173\u95ed\u8fde\u63a5

View File

@@ -151,6 +151,8 @@ function searchList(){
loading();
var start=$("#beginDate").val();
var end=$("#endDate").val();
$("#beginDateh").val(start);
$("#endDateh").val(end);
if(start==''||end==''||end==null||start==null){
window.location.reload();
}else{
@@ -166,7 +168,7 @@ function ajaxAppList(start,end){
dataType: "json",
data:{"beginDate":start,"endDate":end,"appType":appType},
async:true,
timeout:10000,
timeout:50000,
traditional:true,
success:function (data){
if(data!=null&&data.length>0&&data[0].error!=null){
@@ -218,19 +220,50 @@ $(".export-btn").click(function(){
htmlTitle+= "<th class='tc' colspan='2'>"+start+"--"+ end +"</th>";
htmlTitle+="</tr>"
$("#contentTable thead").prepend(htmlTitle);
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='App'></spring:message>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
if(dataType=="xlsx"){
getTableContent("contentTable");
}else{
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='App'></spring:message>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
}
$(".tr-title").remove();
getPageData(1,10);
pageJuan(10);//初始化分页
});
/**
* 调用后台接口
* @param Int id 表格id
* @return Array
*/
function getTableContent(id){
var mytable = document.getElementById(id);
var nowDate=new Date();
var data = [];
for(var i=0,rows=mytable.rows.length; i<rows; i++){
for(var j=0,cells=mytable.rows[i].cells.length; j<cells; j++){
if(!data[i]){
data[i] = new Array();
}
data[i][j] = mytable.rows[i].cells[j].innerText;
}
}
var title= data.shift();
var heard= data.shift();
var map ={};
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=data;
map["titleCode"]="<spring:message code='App'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
}
/**
* 获取本页数据
* @param currentPage 当前页数 【初次查数据默认第1页】

View File

@@ -143,7 +143,7 @@ function changeBandwidth(unitType,beginDate,endDate){
data:{"beginDate":beginDate,"endDate":endDate,"searchQuotaType":unitType},
dataType:"json",
async:true,
timeout:40000,
timeout:50000,
success:function (data){
var xdata=null;
var ipv4data=null;

View File

@@ -59,13 +59,12 @@ $(document).ready(function(){
dataType:"json",
data:{"beginDate":beginDate,"endDate":endDate,"entranceId":entranceId,"domain":domain},
async:true,
timeout:40000,
timeout:50000,
success:function (rs) {
$("#tbodyData").html("");
var xData=new Array();
var series=new Array();
var total = 0;
console.log(rs)
if(rs!=null&&rs.length>0){
/* xData=rs[0].statTime;
$(rs[0].count).each(function(i,d) {
@@ -191,12 +190,38 @@ function showDomainTrans(xData,series){
}
(function(H) {
H.Chart.prototype.downloadXLS = function() {
var start = $("#beginDate").val();
var end = $("#endDate").val();
var div = document.createElement('div'), xlsxRows = [], xlsxColumns = [];
var nowDate=new Date();
div.style.display = 'none';
document.body.appendChild(div);
rows = this.getDataRows(true);
xlsxRows = H.map(rows.slice(1), function(row) {
/* 调用后台接口导出 */
var total=[];
var totalValue = JSON.parse($("#total").val());
total.push(totalValue)
var map={};
$(rows).each(function(i,d){
// 去掉多余属性
delete d.name;
delete d.x;
delete d.xValues;
})
rows.shift(); // 删除一个重复行
var heard = rows.shift(); // 删除一个重复行
total.unshift('<spring:message code="report_total"/>');
var title=[];
rows.push(total)
title.push('<spring:message code="domain_name"></spring:message>',start+"--"+end);
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=rows;
map["titleCode"]='<spring:message code="domain_name"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
/* xlsxRows = H.map(rows.slice(1), function(row) {
return H.map(row, function(column) {
return {
type : typeof column === 'number' ? 'number' : 'string',
@@ -204,8 +229,7 @@ function showDomainTrans(xData,series){
};
});
});
var start = $("#beginDate").val();
var end = $("#endDate").val();
var b = new Array();
b.push({
type : 'string',
@@ -233,7 +257,7 @@ function showDomainTrans(xData,series){
sheet : {
data : xlsxRows
}
});
}); */
};
}(Highcharts));

View File

@@ -124,6 +124,8 @@ $(document).ready(function(){
function searchList(){
var start=$("#beginDate").val();
var end=$("#endDate").val();
$("#beginDateh").val(start);
$("#endDateh").val(end);
if(start==''||end==''||end==null||start==null){
window.location.reload();
}else{
@@ -137,7 +139,7 @@ function ajaxProtocolList(start,end){
dataType: "json",
data:{"beginDate":start,"endDate":end},
async:true,
timeout:10000,
timeout:50000,
beforeSend:function(){
loading();
},
@@ -185,8 +187,8 @@ function doPrint() {
$(".export-btn").click(function(){
var dataType = $(this).attr("data-type");
getPageData(1,999999);// 设置导出页条数
var start=$("#beginDate").val();
var end=$("#endDate").val();
var start=$("#beginDateh").val();
var end=$("#endDateh").val();
var nowDate=new Date();
var htmlTitle="";
htmlTitle+="<tr class='tr-title'>";
@@ -194,19 +196,50 @@ $(".export-btn").click(function(){
htmlTitle+= "<th class='tc' colspan='2'>"+start+"--"+ end +"</th>";
htmlTitle+="</tr>"
$("#contentTable thead").prepend(htmlTitle);
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"service"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
if(dataType=="xlsx"){
getTableContent("contentTable");
}else{
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='service'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
}
$(".tr-title").remove();
getPageData(1,10);
pageJuan(10);//初始化分页
});
/**
* 调用后台接口
* @param Int id 表格id
* @return Array
*/
function getTableContent(id){
var mytable = document.getElementById(id);
var nowDate=new Date();
var data = [];
for(var i=0,rows=mytable.rows.length; i<rows; i++){
for(var j=0,cells=mytable.rows[i].cells.length; j<cells; j++){
if(!data[i]){
data[i] = new Array();
}
data[i][j] = mytable.rows[i].cells[j].innerHTML;
}
}
var title= data.shift();
var heard= data.shift();
var map ={};
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=data;
map["titleCode"]="<spring:message code='service'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
}
/**
* 获取本页数据
* @param currentPage 当前页数 【初次查数据默认第1页】
@@ -246,7 +279,7 @@ function htmlData(fileDataS){
$.each(fileDataS,function (index,data){
if(data!=null){
var html = "<tr>";
html+= "<td class='tc'>"+data.name+"</td>";
html+= "<td class='tc' title=''>"+data.name+"</td>";
html+= "<td class='tc'>"+data.linkNum+"</td>";
html+= "<td class='tc'>"+(data.linkNum/data.allLink*100).toFixed(2)+"%"+"</td>";
html+= "<td class='tc'>"+data.packets+"</td>";

View File

@@ -153,29 +153,63 @@ function doPrint() {
}
//导出列表
$(".export-btn").click(function(){
var nowDate=new Date();
var dataType = $(this).attr("data-type");
var start=$("#beginDate").val();
var end=$("#endDate").val();
var start=$("#beginDateh").val();
var end=$("#endDateh").val();
var htmlTitle="";
htmlTitle+="<tr class='tr-title'>";
htmlTitle+= "<th class='tc' colspan='1'>"+"<spring:message code='traffic_ipactive_hour_trend'/>"+"</th>";
htmlTitle+= "<th class='tc' colspan='1'>"+"<spring:message code='traffic_ipactive_hour_max'/>"+"</th>";
htmlTitle+= "<th class='tc' colspan='2'>"+start+"--"+ end +"</th>";
htmlTitle+="</tr>"
$("#contentTable thead").prepend(htmlTitle);
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='traffic_ipactive_hour_max'></spring:message>",
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
if(dataType=="xlsx"){
getTableContent("contentTable");
}else{
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='traffic_ipactive_hour_max'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
}
$(".tr-title").remove();
});
/**
* 调用后台接口
* @param Int id 表格id
* @return Array
*/
function getTableContent(id){
var nowDate=new Date();
var mytable = document.getElementById(id);
var data = [];
for(var i=0,rows=mytable.rows.length; i<rows; i++){
for(var j=0,cells=mytable.rows[i].cells.length; j<cells; j++){
if(!data[i]){
data[i] = new Array();
}
data[i][j] = mytable.rows[i].cells[j].innerHTML;
}
}
var title= data.shift();
var heard= data.shift();
var map ={};
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=data;
map["titleCode"]="<spring:message code='traffic_ipactive_hour_max'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
}
function searchList(){
var start=$("#beginDate").val();
var end=$("#endDate").val();
$("#beginDateh").val(start);
$("#endDateh").val(end);
loading();
if(start==''||end==''||end==null||start==null){
window.location.reload();
@@ -304,7 +338,6 @@ function showIpActiveChart(xData,series){
}
});
})
console.log(rs)
}else{
series.push({
name: " ",
@@ -403,14 +436,39 @@ function showIpActiveChart(xData,series){
(function(H) {
H.Chart.prototype.downloadXLS = function() {
var nowDate=new Date();
var start = $("#beginDateh").val();
var end = $("#endDateh").val();
var div = document.createElement('div'),
xlsxRows = [],
xlsxColumns = [];
div.style.display = 'none';
document.body.appendChild(div);
rows = this.getDataRows(true);
xlsxRows = H.map(rows.slice(1), function(row) {
/* 调用后台接口导出 */
var total = JSON.parse($("#total").val());
var map={};
$(rows).each(function(i,d){
// 去掉多余属性
delete d.name;
delete d.x;
delete d.xValues;
})
total.unshift('<spring:message code="report_total"/>');
rows.shift(); // 删除一个重复行
var heard = rows.shift(); // 删除一个重复行
rows.push(total)
var title=[];
title.push('<spring:message code="traffic_ipactive_hour_trend"></spring:message>',start+"--"+end);
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=rows;
map["titleCode"]='<spring:message code="traffic_ipactive_hour_trend"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
/* xlsxRows = H.map(rows.slice(1), function(row) {
return H.map(row, function(column) {
return {
type: typeof column === 'number' ? 'number' : 'string',
@@ -449,7 +507,7 @@ function showIpActiveChart(xData,series){
sheet: {
data: xlsxRows
}
});
}); */
};
}(Highcharts));
(function(H) {
@@ -468,8 +526,8 @@ function showIpActiveChart(xData,series){
num1:"<spring:message code='total'/>",
num2:total
})
var start = $("#beginDate").val();
var end = $("#endDate").val();
var start = $("#beginDateh").val();
var end = $("#endDateh").val();
exportCsv({
title:["<spring:message code='traffic_ipactive_hour_trend'/>",start+"--"+end],
titleForKey:["num1","num2"],

View File

@@ -57,7 +57,7 @@
<!-- 搜索内容与操作按钮栏 -->
</form:form>
</div>
<div id="chart" style="width:95%;height:530px;"></div>
<div id="chart" style="width:95%;height:530px;margin-top:15px"></div>
</div>
<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>
@@ -107,6 +107,8 @@ $(".export-btn").click(function(){
function searchList(){
var start=$("#beginDate").val();
var end=$("#endDate").val();
$("#beginDateh").val(start);
$("#endDateh").val(end);
loading();
if(start==''||end==''||end==null||start==null){
window.location.reload();
@@ -221,7 +223,7 @@ function showPortActiveChart(xData,series){
dataType:"json",
data:{"beginDate":beginDate,"endDate":endDate},
async:true,
timeout:40000,
timeout:50000,
success:function (rs) {
var xData=new Array();
var series=new Array();
@@ -259,86 +261,12 @@ function showPortActiveChart(xData,series){
});
}
//活跃IP一小时统计
/* function portActiveOneHourList(beginDate,endDate){
loading();
$.ajax({
url: '${ctx}/dashboard/ajaxPortActiveList',
type : "get" ,
dataType:"json",
data:{"beginDate":beginDate,"endDate":endDate},
cache:false,
async:false,
timeout:40000,
success:function (data) {
$("#tbodyData").html("");
if(data!=null&&data.length>0){
var totalc2sByte= 0;
var totals2cByte= 0;
var totalByte= 0;
var totalLink= 0;
var totalc2sPkt= 0;
var totals2cPkt= 0;
var totalpacket= 0;
$(data).each(function(i, rs) {
var byteNum=rs.s2cByteLen+rs.c2sByteLen;
var packetNum=rs.s2cPktNum+rs.c2sPktNum;
totalc2sByte=totalc2sByte+(rs.c2sByteLen);
totals2cByte=totals2cByte+(rs.s2cByteLen);
totalByte=totalByte+(byteNum);
totalLink=totalLink+(rs.linkNum);
totalc2sPkt=totalc2sPkt+(rs.c2sPktNum);
totals2cPkt=totals2cPkt+(rs.s2cPktNum);
totalpacket=totalpacket+(packetNum);
var html = "<tr>";
html+= "<td class='tc'>"+rs.ipAddr+"</td>";
html+= "<td class='tc'>"+(rs.areaId==1? "Astana":"Alamty")+"</td>";
html+= "<td class='tc'>"+rs.c2sByteLen+"</td>";
html+= "<td class='tc'>"+rs.s2cByteLen+"</td>";
html+= "<td class='tc'>"+byteNum+"</td>";
html+= "<td class='tc'>"+rs.linkNum+"</td>";
html+= "<td class='tc'>"+rs.c2sPktNum+"</td>";
html+= "<td class='tc'>"+rs.s2cPktNum+"</td>";
html+= "<td class='tc'>"+packetNum+"</td>";
html+= "<td class='tc'>"+rs.statTime+"</td>";
html+="</tr>"
if(i==data.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'>"+totalc2sByte+"</td>";
html+= "<td class='tc'>"+totals2cByte+"</td>";
html+= "<td class='tc'>"+totalByte+"</td>";
html+= "<td class='tc'>"+totalLink+"</td>";
html+= "<td class='tc'>"+totalc2sPkt+"</td>";
html+= "<td class='tc'>"+totals2cPkt+"</td>";
html+= "<td class='tc'>"+totalpacket+"</td>";
html+= "<td class='tc'>"+beginDate+"--"+ endDate +"</td>";
html+="</tr>"
}
$("#tbodyData").append(html);
})
}
closeTip();
},
error: function(data, textStatus, errorThrown){
closeTip();
// warning_prompt("获取实时列表数据失败!",1500);
},
complete:function(XMLHttpRequest,status){//超时设置
closeTip();
}
});
} */
(function(H) {
var nowDate=new Date();
H.Chart.prototype.downloadXLS = function() {
var start=$("#beginDateh").val();
var end=$("#endDateh").val();
var div = document.createElement('div'),
xlsxRows = [],
xlsxColumns = [];
@@ -346,7 +274,29 @@ function showPortActiveChart(xData,series){
div.style.display = 'none';
document.body.appendChild(div);
rows = this.getDataRows(true);
xlsxRows = H.map(rows.slice(1), function(row) {
/* 调用后台接口导出 */
var total = JSON.parse($("#total").val());
var map={};
$(rows).each(function(i,d){
// 去掉多余属性
delete d.name;
delete d.x;
delete d.xValues;
})
total.unshift('<spring:message code="report_total"/>');
rows.shift(); // 删除一个重复行
var heard = rows.shift(); // 删除一个重复行
rows.push(total)
var title=[];
title.push('<spring:message code="active_port"></spring:message>',start+"--"+end);
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=rows;
map["titleCode"]='<spring:message code="active_port"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
/* xlsxRows = H.map(rows.slice(1), function(row) {
return H.map(row, function(column) {
return {
type: typeof column === 'number' ? 'number' : 'string',
@@ -385,7 +335,7 @@ function showPortActiveChart(xData,series){
sheet: {
data: xlsxRows
}
});
}); */
};
}(Highcharts));
(function(H) {

View File

@@ -140,6 +140,8 @@ function searchList(){
loading();
var start=$("#beginDate").val();
var end=$("#endDate").val();
$("#beginDateh").val(start);
$("#endDateh").val(end);
if(start==''||end==''||end==null||start==null){
window.location.reload();
}else{
@@ -155,7 +157,7 @@ function ajaxProtocolList(start,end){
dataType: "json",
data:{"beginDate":start,"endDate":end,"protoType":protoType},
async:true,
timeout:40000,
timeout:50000,
traditional:true,
beforeSend:function(){
loading();
@@ -197,32 +199,63 @@ function doPrint() {
getPageData(1,10);
pageJuan(10);//初始化分页
}
// 导出列表
//导出列表
$(".export-btn").click(function(){
var nowDate=new Date();
var dataType = $(this).attr("data-type");
getPageData(1,999999);// 设置导出页条数
var start=$("#beginDate").val();
var end=$("#endDate").val();
var start=$("#beginDateh").val();
var end=$("#endDateh").val();
var nowDate=new Date();
var htmlTitle="";
htmlTitle+="<tr class='tr-title'>";
htmlTitle+= "<th class='tc' colspan='1'>"+"<spring:message code='protocol_type'/>"+"</th>";
htmlTitle+= "<th class='tc' colspan='2'>"+start+"--"+ end +"</th>";
htmlTitle+="</tr>"
$("#contentTable thead").prepend(htmlTitle);
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='protocol_type'></spring:message>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
if(dataType=="xlsx"){
getTableContent("contentTable");
}else{
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='protocol_type'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
}
$(".tr-title").remove();
getPageData(1,10);
pageJuan(10);//初始化分页
});
/**
* 调用后台接口
* @param Int id 表格id
* @return Array
*/
function getTableContent(id){
var mytable = document.getElementById(id);
var nowDate=new Date();
var data = [];
for(var i=0,rows=mytable.rows.length; i<rows; i++){
for(var j=0,cells=mytable.rows[i].cells.length; j<cells; j++){
if(!data[i]){
data[i] = new Array();
}
data[i][j] = mytable.rows[i].cells[j].innerHTML;
}
}
var title= data.shift();
var heard= data.shift();
var map ={};
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=data;
map["titleCode"]="<spring:message code='protocol_type'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
}
/**
* 获取本页数据
* @param currentPage 当前页数 【初次查数据默认第1页】
@@ -257,8 +290,8 @@ function htmlData(fileDataS){
}else{
$('.none-data').hide();
$('.pageView').show();
var start=$("#beginDate").val();
var end=$("#endDate").val();
var start=$("#beginDateh").val();
var end=$("#endDateh").val();
$.each(fileDataS,function (index,data){
if(data!=null){
var totalLink = data.totalLink;

View File

@@ -202,6 +202,8 @@
function searchList() {
var start = $("#beginDate").val();
var end = $("#endDate").val();
$("#beginDateh").val(start);
$("#endDateh").val(end);
if (start == '' || end == '' || end == null || start == null) {
window.location.reload();
} else {
@@ -277,19 +279,50 @@
htmlTitle+= "<th class='tc' colspan='2'>"+start+"--"+ end +"</th>";
htmlTitle+="</tr>"
$("#contentTable thead").prepend(htmlTitle);
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='domain_name'></spring:message>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
if(dataType=="xlsx"){
getTableContent("contentTable");
}else{
var te = $("#contentTable").tableExport({
headings:true,
footers:true,
formats:[dataType],
fileName:"<spring:message code='domain_name'></spring:message>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds(),
bootstrap:false
});
$("#myexport").click();
$("caption").remove();
}
$(".tr-title").remove();
getPageData(1,10);
pageJuan(10);//初始化分页
});
/**
* 调用后台接口
* @param Int id 表格id
* @return Array
*/
function getTableContent(id){
var mytable = document.getElementById(id);
var nowDate=new Date();
var data = [];
for(var i=0,rows=mytable.rows.length; i<rows; i++){
for(var j=0,cells=mytable.rows[i].cells.length; j<cells; j++){
if(!data[i]){
data[i] = new Array();
}
data[i][j] = mytable.rows[i].cells[j].innerHTML;
}
}
var title= data.shift();
var heard= data.shift();
var map ={};
map["titleTime"]=title;
map["heard"]=heard;
map["book"]=data;
map["titleCode"]="<spring:message code='domain_name'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+nowDate.getHours()+nowDate.getMinutes()+nowDate.getSeconds();
var exports = JSON.stringify(map);
aJaxImportPost("${ctx}/export/ajaxExport",{"exports":exports});
}
$("#print-btn").click(function() {
window.print();
});
@@ -327,8 +360,8 @@
} else {
$('.none-data').hide();
$('.pageView').show();
var start=$("#beginDate").val();
var end=$("#endDate").val();
var start=$("#beginDateh").val();
var end=$("#endDateh").val();
var totalunique=0;
var totalpkt=0;
var totalGbyte=0;
@@ -372,8 +405,8 @@
}
function searchByDomain(domain,domainName){
var beginDate = $("#beginDate").val();
var endDate = $("#endDate").val();
var beginDate = $("#beginDateh").val();
var endDate = $("#endDateh").val();
var entranceId = $("#entranceId").val();
var url= "${ctx}/dashboard/traffic/domainTrans?beginDate="+beginDate+"&endDate="+endDate+"&domain="+domain+"&domainName="+domainName+"&entranceId="+entranceId;
openPicWindow(url);