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 b1e531660..24d9a3d95 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -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--) { diff --git a/src/main/java/com/nis/web/security/CacheSessionDAO.java b/src/main/java/com/nis/web/security/CacheSessionDAO.java index 7326e5a1a..4cd46fc97 100644 --- a/src/main/java/com/nis/web/security/CacheSessionDAO.java +++ b/src/main/java/com/nis/web/security/CacheSessionDAO.java @@ -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; } // 符合登陆者条件。 diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index a3d19d346..ae0399ed6 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -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 newline at end of file +no_need_input=Attributes no need to be filled in +close_link=Close Link \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 65026b5d2..be04d9d20 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -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 newline at end of file +no_need_input=Attributes no need to be filled in +close_link=Close Link \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index dcdd544f5..383029823 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 889254622..7e03dfc07 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -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+= ""+start+"--"+ end +""; htmlTitle+="" $("#contentTable thead").prepend(htmlTitle); - var te = $("#contentTable").tableExport({ - headings:true, - footers:true, - formats:[dataType], - fileName:""+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:""+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; i0){ /* 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(''); + var title=[]; + rows.push(total) + title.push('',start+"--"+end); + map["titleTime"]=title; + map["heard"]=heard; + map["book"]=rows; + map["titleCode"]=''+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)); diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp index 988fbbea9..9524e375d 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficHttpStatisticList.jsp @@ -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+=""; @@ -194,19 +196,50 @@ $(".export-btn").click(function(){ htmlTitle+= ""+start+"--"+ end +""; htmlTitle+="" $("#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:""+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"; + html+= ""+data.name+""; html+= ""+data.linkNum+""; html+= ""+(data.linkNum/data.allLink*100).toFixed(2)+"%"+""; html+= ""+data.packets+""; diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index a2932c3fd..b7a5ea356 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -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+=""; - htmlTitle+= ""+""+""; + htmlTitle+= ""+""+""; htmlTitle+= ""+start+"--"+ end +""; htmlTitle+="" $("#contentTable thead").prepend(htmlTitle); - var te = $("#contentTable").tableExport({ - headings:true, - footers:true, - formats:[dataType], - fileName:"", - bootstrap:false - }); - $("#myexport").click(); - $("caption").remove(); + if(dataType=="xlsx"){ + getTableContent("contentTable"); + }else{ + var te = $("#contentTable").tableExport({ + headings:true, + footers:true, + formats:[dataType], + fileName:""+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.shift(); // 删除一个重复行 + var heard = rows.shift(); // 删除一个重复行 + rows.push(total) + var title=[]; + title.push('',start+"--"+end); + map["titleTime"]=title; + map["heard"]=heard; + map["book"]=rows; + map["titleCode"]=''+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:"", num2:total }) - var start = $("#beginDate").val(); - var end = $("#endDate").val(); + var start = $("#beginDateh").val(); + var end = $("#endDateh").val(); exportCsv({ title:["",start+"--"+end], titleForKey:["num1","num2"], diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index ee31c6193..20aad6b29 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -57,7 +57,7 @@ -
+
@@ -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 = ""; - html+= ""+rs.ipAddr+""; - html+= ""+(rs.areaId==1? "Astana":"Alamty")+""; - html+= ""+rs.c2sByteLen+""; - html+= ""+rs.s2cByteLen+""; - html+= ""+byteNum+""; - html+= ""+rs.linkNum+""; - html+= ""+rs.c2sPktNum+""; - html+= ""+rs.s2cPktNum+""; - html+= ""+packetNum+""; - html+= ""+rs.statTime+""; - html+="" - - if(i==data.length-1){ - html+="" - html+= ""+""+""; - html+= ""+"--"+""; - html+= ""+totalc2sByte+""; - html+= ""+totals2cByte+""; - html+= ""+totalByte+""; - html+= ""+totalLink+""; - html+= ""+totalc2sPkt+""; - html+= ""+totals2cPkt+""; - html+= ""+totalpacket+""; - html+= ""+beginDate+"--"+ endDate +""; - html+="" - } - $("#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(''); + rows.shift(); // 删除一个重复行 + var heard = rows.shift(); // 删除一个重复行 + rows.push(total) + var title=[]; + title.push('',start+"--"+end); + map["titleTime"]=title; + map["heard"]=heard; + map["book"]=rows; + map["titleCode"]=''+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) { diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 3f2d50484..6d62ecac5 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -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+=""; htmlTitle+= ""+""+""; htmlTitle+= ""+start+"--"+ end +""; htmlTitle+="" $("#contentTable thead").prepend(htmlTitle); - var te = $("#contentTable").tableExport({ - headings:true, - footers:true, - formats:[dataType], - fileName:""+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:""+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"; htmlTitle+="" $("#contentTable thead").prepend(htmlTitle); - var te = $("#contentTable").tableExport({ - headings:true, - footers:true, - formats:[dataType], - fileName:""+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:""+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