diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index e788ccec9..a559ed833 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -175,7 +175,8 @@ yAxis : { title : { text : null - } + }, + min:0 }, credits : {//是否有highcharts水印 enabled : false diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index a55169841..f6d66ed71 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -145,7 +145,8 @@ function showActionTransChart(xData,series){ yAxis: { title: { text: null - } + }, + min:0 }, credits:{//是否有highcharts水印 enabled:false @@ -286,6 +287,7 @@ function showActionTransChart(xData,series){ H.Chart.prototype.downloadCSV = function() { var rows = this.getDataRows(true); var total = JSON.parse($("#total").val()); + var data=[]; $(rows).each(function (i,d){ if(d!=null){ if(i>0){ diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index ef254808a..5bc8a8525 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -187,6 +187,7 @@ function ajaxAppList(start,end){ } // 导出列表 $(".export-btn").click(function(){ + var nowDate=new Date(); var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); @@ -201,7 +202,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"", + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); @@ -313,6 +314,7 @@ function pageJuan(showData) { function protocolTypeChart(rs){ //终端用户 分操作系统与浏览器 var data=new Array(); + var nowDate=new Date(); $(rs).each(function(i, d) { data.push({ name: d.appName, @@ -334,7 +336,7 @@ function protocolTypeChart(rs){ }, exporting: { allowHTML:true, - filename:"", + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 1c1d6121e..a604f2a70 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -24,6 +24,8 @@ + +
@@ -138,8 +140,6 @@ function changeBandwidth(unitType,beginDate,endDate){ async:true, timeout:40000, success:function (data){ - console.log(data) - console.log(1111) var xdata=null; var ipv4data=null; var ipv6data=null; @@ -149,6 +149,8 @@ function changeBandwidth(unitType,beginDate,endDate){ var ipv6data2=null; var tcpdata2=null; var udpdata2=null; + var total=[]; + var total2=[]; if(data!=null&&Object.keys(data).length>0){ if(data.ipv4Type1!=undefined&&data.ipv4Type1!=null){ xdata=data.ipv4Type1.statTime; @@ -172,6 +174,7 @@ function changeBandwidth(unitType,beginDate,endDate){ udpdata=data.trans17Type1.linkNum; } } + total.push(sum(ipv4data),sum(ipv6data),sum(tcpdata),sum(udpdata)); } var series=new Array(); series.push({ @@ -187,6 +190,7 @@ function changeBandwidth(unitType,beginDate,endDate){ name: "UDP", data: udpdata }); + $("#total").val(JSON.stringify(total)); showBandwidthChart("chart1",unitType,xdata,series,"Astana"); if(data!=null&&Object.keys(data).length>0){ @@ -212,6 +216,7 @@ function changeBandwidth(unitType,beginDate,endDate){ udpdata2=data.trans17Type2.linkNum; } } + total2.push(sum(ipv4data2),sum(ipv6data2),sum(tcpdata2),sum(udpdata2)); } var series=new Array(); series.push({ @@ -227,6 +232,7 @@ function changeBandwidth(unitType,beginDate,endDate){ name: "UDP", data: udpdata2 }); + $("#total2").val(JSON.stringify(total2)); showBandwidthChart("chart2",unitType,xdata,series,"Alamty"); closeTip(); }, @@ -241,7 +247,7 @@ function changeBandwidth(unitType,beginDate,endDate){ /* 网络带宽时间维度趋势图 */ function showBandwidthChart(id,unitType,xdata,ydata,title){ - + var nowDate=new Date(); var chart = Highcharts.chart(id, { chart:{ // type: 'area', @@ -264,7 +270,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }, }, exporting: { - filename:'Bandwidth', + filename:''+title+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 550, @@ -290,7 +296,10 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }, xAxis:{ type:'category', -// tickmarkPlacement: 'on', + title: { + text: 'time-'+title, + align:'high', + }, labels: { rotation: -45, //倾斜的角度 }, @@ -317,8 +326,8 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ } (function(H) { - var nowDate=new Date(); H.Chart.prototype.downloadXLS = function() { + var nowDate=new Date(); var start=$("#beginDate").val(); var end=$("#endDate").val(); var div = document.createElement('div'), @@ -384,6 +393,71 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ var modifyTime=new Date(chooseDate); $('#endDate').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); } +(function(H) { + H.Chart.prototype.downloadCSV = function() { + var rows = this.getDataRows(true); + var data=new Array(); + var total = []; + $(rows).each(function (i,d){ + if(d!=null){ + if(i==0){ + if(d[0].indexOf("Astana") != -1){ + total=JSON.parse($("#total").val()); + } + if(d[0].indexOf("Alamty") != -1){ + total=JSON.parse($("#total2").val()); + } + } + if(i>0){ + data.push({ + num1:d, + }) + } + } + }) + data.push({ + num1:"", + num2:total + }) + var start = $("#beginDate").val(); + var end = $("#endDate").val(); + exportCsv({ + title:["",start+"--"+end], + titleForKey:["num1","num2","num3"], + data:data + }); + }; + }(Highcharts)); + + function exportCsv(obj){ + var nowDate=new Date(); + //title ["","",""] + var title = obj.title; + //titleForKey ["","",""] + var titleForKey = obj.titleForKey; + var data = obj.data; + var str = []; + str.push(obj.title.join(",")+"\n"); + for(var i=0;i \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 020f5627d..3e53308d0 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -24,6 +24,7 @@ + @@ -39,6 +40,7 @@ <%-- --%> + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index e07489c50..f79884963 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -169,6 +169,7 @@ $(".export-btn").click(function(){ getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); var end=$("#endDate").val(); + var nowDate=new Date(); var htmlTitle=""; htmlTitle+=""; htmlTitle+= ""+""+""; @@ -179,7 +180,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"service", + fileName:"service"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 8bc1272ee..03bf6680d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -167,14 +167,14 @@ function searchList(){ } function showIpActiveChart(xData,series){ - + var nowDate=new Date(); var chart = Highcharts.chart('chart', { chart:{ //type: 'area', zoomType: 'x' }, exporting: { - filename:'', + filename:''+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, @@ -360,8 +360,8 @@ function showIpActiveChart(xData,series){ } (function(H) { - var nowDate=new Date(); H.Chart.prototype.downloadXLS = function() { + var nowDate=new Date(); var div = document.createElement('div'), xlsxRows = [], xlsxColumns = []; @@ -411,6 +411,56 @@ function showIpActiveChart(xData,series){ }); }; }(Highcharts)); + (function(H) { + H.Chart.prototype.downloadCSV = function() { + var rows = this.getDataRows(true); + var data=new Array(); + var total = total = JSON.parse($("#total").val()); + $(rows).each(function (i,d){ + if(d!=null&&i>0){ + data.push({ + num1:d, + }) + } + }) + data.push({ + num1:"", + num2:total + }) + var start = $("#beginDate").val(); + var end = $("#endDate").val(); + exportCsv({ + title:["",start+"--"+end], + titleForKey:["num1","num2"], + data:data + }); + }; + }(Highcharts)); + + function exportCsv(obj){ + var nowDate=new Date(); + //title ["","",""] + var title = obj.title; + //titleForKey ["","",""] + var titleForKey = obj.titleForKey; + var data = obj.data; + var str = []; + str.push(obj.title.join(",")+"\n"); + for(var i=0;i +
@@ -61,6 +62,7 @@ <%-- --%> + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 35bd75e93..b326b08d0 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -181,6 +181,7 @@ function ajaxProtocolList(start,end){ } // 导出列表 $(".export-btn").click(function(){ + var nowDate=new Date(); var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); @@ -195,7 +196,7 @@ $(".export-btn").click(function(){ headings:true, footers:true, formats:[dataType], - fileName:"", + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); @@ -305,6 +306,7 @@ function pageJuan(showData) { } // 比例协议统计图 function protocolTypeChart(rs){ + var nowDate=new Date(); //终端用户 分操作系统与浏览器 var data=new Array(); $(rs).each(function(i, d) { @@ -329,7 +331,7 @@ function protocolTypeChart(rs){ }, exporting: { allowHTML:true, - filename:"", + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 6e9e9c892..1e5e2fc8c 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -249,6 +249,7 @@ } // 导出列表 $(".export-btn").click(function(){ + var nowDate=new Date(); var dataType = $(this).attr("data-type"); getPageData(1,999999);// 设置导出页条数 var start=$("#beginDate").val(); @@ -263,7 +264,7 @@ headings:true, footers:true, formats:[dataType], - fileName:"", + fileName:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), bootstrap:false }); $("#myexport").click(); @@ -395,6 +396,7 @@ // 比例域名统计图 function webTypeChart(rs){ + var nowDate=new Date(); //终端用户 分操作系统与浏览器 var data=new Array(); $(rs).each(function(i, d) { @@ -418,7 +420,7 @@ function webTypeChart(rs){ }, exporting: { allowHTML:true, - filename:"", + filename:""+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(), scale:1, sourceWidth: 1280, sourceHeight: 500,