流量统计文件名导出增加时间后缀

This commit is contained in:
zhanghongqing
2018-12-26 20:29:54 +08:00
parent 58a90993d3
commit 868cc7915e
2 changed files with 10 additions and 8 deletions

View File

@@ -117,7 +117,7 @@
}
// 局点信息
function showActionTransChart(xData,series) {
var nowDate=new Date();
var chart = Highcharts.chart('chart',
{
chart : {
@@ -132,7 +132,7 @@
},
},
exporting : {
filename : '<spring:message code="${searchAction}"></spring:message>',
filename : '<spring:message code="${searchAction}"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(),
scale : 1,
sourceWidth : 1280,
sourceHeight : 500,
@@ -240,7 +240,7 @@
(function(H) {
H.Chart.prototype.downloadXLS = function() {
var div = document.createElement('div'), xlsxRows = [], xlsxColumns = [];
var nowDate=new Date();
div.style.display = 'none';
document.body.appendChild(div);
rows = this.getDataRows(true);
@@ -313,6 +313,7 @@
}(Highcharts));
function exportCsv(obj){
var nowDate=new Date();
//title ["","",""]
var title = obj.title;
//titleForKey ["","",""]
@@ -330,7 +331,7 @@
var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join(""));
var downloadLink = document.createElement("a");
downloadLink.href = uri;
downloadLink.download = "<spring:message code='${searchAction}'/>"+".csv";
downloadLink.download = "<spring:message code='${searchAction}'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv";
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);

View File

@@ -99,13 +99,14 @@ function searchList(){
}
// 局点信息
function showActionTransChart(xData,series){
var nowDate=new Date();
var chart = Highcharts.chart('chart', {
chart:{
// type: 'area',
zoomType: 'x'
},
exporting: {
filename:'<spring:message code="${searchAction}"></spring:message>',
filename:'<spring:message code="${searchAction}"></spring:message>'+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate(),
scale:1,
sourceWidth: 1280,
sourceHeight: 500,
@@ -284,7 +285,6 @@ function showActionTransChart(xData,series){
(function(H) {
H.Chart.prototype.downloadCSV = function() {
var rows = this.getDataRows(true);
var data=new Array();
var total = JSON.parse($("#total").val());
$(rows).each(function (i,d){
if(d!=null){
@@ -312,6 +312,7 @@ function showActionTransChart(xData,series){
}(Highcharts));
function exportCsv(obj){
var nowDate=new Date();
//title ["","",""]
var title = obj.title;
//titleForKey ["","",""]
@@ -329,10 +330,10 @@ function showActionTransChart(xData,series){
var uri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(str.join(""));
var downloadLink = document.createElement("a");
downloadLink.href = uri;
downloadLink.download = "<spring:message code='${searchAction}'/>"+".csv";
downloadLink.download = "<spring:message code='${searchAction}'/>"+nowDate.getFullYear()+(nowDate.getMonth()+1)+nowDate.getDate()+".csv";
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
document.body.removeChild(downloadLink);
}
function sum(arr) {
return arr.reduce(function(prev, curr, idx, arr){