diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index 8884d1734..ba2661386 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -270,12 +270,12 @@ public class TrafficStatisticsInfoController extends BaseController { Long totalPackets=0l; Double totalGByte=0d; DecimalFormat lf = new DecimalFormat("0"); - DecimalFormat df = new DecimalFormat("0.00000000"); + DecimalFormat df = new DecimalFormat("0.00"); List appCodeList = CodeDicUtils.getCodeList("appCode"); if(!StringUtil.isEmpty(list)){ for (Object object : list) { Map m=(Map) object; - Double value1 = Double.parseDouble(m.get("protocolType").toString()); + Double value1 = Double.parseDouble(m.get("protoType").toString()); totalGByte+=Double.parseDouble(m.get("GByte").toString()); // String linkNum = df.format(m.get("linkNum")); m.put("GByte", df.format(m.get("GByte"))); @@ -338,7 +338,7 @@ public class TrafficStatisticsInfoController extends BaseController { Long totalPackets=0l; Double totalGByte=0d; DecimalFormat lf = new DecimalFormat("0"); - DecimalFormat df = new DecimalFormat("0.00000000"); + DecimalFormat df = new DecimalFormat("0.00"); if(!StringUtil.isEmpty(list)){ for (Object object : list) { Map m=(Map) object; diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index f002494c9..42d0f755e 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -108,6 +108,7 @@ $(document).ready(function(){ }); }); function searchList(){ + loading(); var start=$("#searchFoundStartTime").val(); var end=$("#searchFoundEndTime").val(); if(start==''||end==''||end==null||start==null){ @@ -321,7 +322,7 @@ function protocolTypeChart(rs){ softConnector: true, // 是否使用曲线 formatter: function () { // 通过函数判断是否显示数据标签,为了防止数据标签过于密集 - return this.percentage > 1 ? '' + this.point.name + ' : ' +this.percentage.toFixed(1)+' %' : null; + return this.percentage > 1 ? '' + this.point.name + ' : ' +this.percentage.toFixed(2)+' %' : null; }, style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' @@ -353,7 +354,7 @@ function protocolTypeChart(rs){ }, tooltip: { headerFormat: '{series.name}
', - pointFormat: '{point.name}: {point.percentage:.1f}%' + pointFormat: '{point.name}: {point.percentage:.2f}%' }, series: [{ name: "App", diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 406ade857..3fad104ac 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -98,6 +98,7 @@ $(document).ready(function(){ }); }); function searchList(){ + loading(); var start=$("#searchFoundStartTime").val(); var end=$("#searchFoundEndTime").val(); if(start==''||end==''||end==null||start==null){ @@ -310,7 +311,7 @@ function protocolTypeChart(rs){ softConnector: true, // 是否使用曲线 formatter: function () { // 通过函数判断是否显示数据标签,为了防止数据标签过于密集 - return this.percentage > 1 ? '' + this.point.name + ' : ' +this.percentage.toFixed(1)+' %' : null; + return this.percentage > 1 ? '' + this.point.name + ' : ' +this.percentage.toFixed(2)+' %' : null; }, style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' @@ -342,7 +343,7 @@ function protocolTypeChart(rs){ }, tooltip: { headerFormat: '{series.name}
', - pointFormat: '{point.name}: {point.percentage:.1f}%' + pointFormat: '{point.name}: {point.percentage:.2f}%' }, series: [{ name: "Protocol", diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index b5acf56e8..833b14a9c 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -133,7 +133,7 @@ mouseOver: function(e) { // 鼠标滑过时动态更新标题 // 标题更新函数,API 地址:https://api.hcharts.cn/highcharts#Chart.setTitle chart.setTitle({ - text:e.target.name.length>10? this.percentage.toFixed(1)+"%
"+e.target.name.substring(0,10)+"...":this.percentage.toFixed(1)+"%
"+e.target.name.substring(0,10)+"", + text:e.target.name.length>10? this.percentage.toFixed(2)+"%
"+e.target.name.substring(0,10)+"...":this.percentage.toFixed(2)+"%
"+e.target.name.substring(0,10)+"", floating:true, y:120, style: {//设置字体颜色 @@ -375,7 +375,7 @@ // inoctetsNum=inoctetsNumG; // }; inoctetsNum=inoctetsNumG; - inoctetsNum=inoctetsNum.toFixed(5) + inoctetsNum=inoctetsNum.toFixed(2) return inoctetsNum; } function changeUnit(inoctetsNum){