流量统计详情增加表格导出excel ,csv ,表格后增加total统计列,图片打印。
This commit is contained in:
@@ -57,8 +57,14 @@
|
||||
<!-- <div class="row">
|
||||
<div id="chart" style="width:98%;height: 510px; -moz-user-select: none; position: relative;"></div>
|
||||
</div> -->
|
||||
<div class="row pull-right">
|
||||
<button type="button" class="btn btn-default" id="export-btn"><i class="fa fa-download"> <spring:message code="export"/></i></button>
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <spring:message code="export"/>
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" style="min-width: 81px;right: -9px;">
|
||||
<li><a class="btn export-btn" data-type="xlsx" id="export-btn"><i class="fa fa-download"> </i> excel </a><li>
|
||||
<li><a class="btn export-btn" data-type="csv" id="export-btn"><i class="fa fa-download"> </i> csv </a><li>
|
||||
</ul>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
@@ -108,7 +114,6 @@ $(document).ready(function(){
|
||||
},500000);// 五分钟调用一次
|
||||
});
|
||||
function searchList(){
|
||||
loading();
|
||||
var start=$("#beginDate").val();
|
||||
var end=$("#endDate").val();
|
||||
if(start==''||end==''||end==null||start==null){
|
||||
@@ -118,7 +123,6 @@ function searchList(){
|
||||
}
|
||||
}
|
||||
function ajaxProtocolList(start,end){
|
||||
loading();
|
||||
$.ajax({
|
||||
url: '${ctx}/dashboard/traffic/statisticList',
|
||||
type: 'get',
|
||||
@@ -126,6 +130,9 @@ function ajaxProtocolList(start,end){
|
||||
data:{"beginDate":start,"endDate":end},
|
||||
async:false,
|
||||
timeout:10000,
|
||||
beforeSend:function(){
|
||||
loading();
|
||||
},
|
||||
success:function (data){
|
||||
if(data!=null&&data.length>0&&data[0].error!=null){
|
||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||
@@ -156,12 +163,13 @@ function ajaxProtocolList(start,end){
|
||||
});
|
||||
}
|
||||
// 导出列表
|
||||
$("#export-btn").click(function(){
|
||||
$(".export-btn").click(function(){
|
||||
var dataType = $(this).attr("data-type");
|
||||
getPageData(1,999999);// 设置导出页条数
|
||||
var te = $("#contentTable").tableExport({
|
||||
headings:true,
|
||||
footers:true,
|
||||
formats:["xlsx"],
|
||||
formats:[dataType],
|
||||
fileName:"service",
|
||||
bootstrap:false
|
||||
});
|
||||
@@ -203,6 +211,8 @@ function htmlData(fileDataS){
|
||||
}else{
|
||||
$('.none-data').hide();
|
||||
$('.M-box').show();
|
||||
var start=$("#beginDate").val();
|
||||
var end=$("#endDate").val();
|
||||
$.each(fileDataS,function (index,data){
|
||||
if(data!=null){
|
||||
var html = "<tr>";
|
||||
@@ -214,6 +224,18 @@ function htmlData(fileDataS){
|
||||
html+= "<td class='tc'>"+(data.count/1073741824).toFixed(2)+"</td>";
|
||||
html+= "<td class='tc'>"+(data.count/data.allGByte*100).toFixed(2)+"%"+"</td>";
|
||||
html+="</tr>"
|
||||
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'>"+(data.allLink).toFixed(2)+"</td>";
|
||||
html+= "<td class='tc'>" +"100%"+"</td>";
|
||||
html+= "<td class='tc'>"+(data.allPackets).toFixed(2)+"</td>";
|
||||
html+= "<td class='tc'>"+"100%"+"</td>";
|
||||
html+= "<td class='tc'>"+(data.allGByte/1073741824).toFixed(2)+"</td>";
|
||||
html+= "<td class='tc'>"+"100%"+"</td>";
|
||||
html+= "<td class='tc'>"+start+"--"+ end +"</td>";
|
||||
html+="</tr>"
|
||||
}
|
||||
}
|
||||
$("#tableData").append(html);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user