|
@@ -1186,14 +1186,21 @@ function getCalendarDate(info) {
|
|
function downloadExportedData(data, fileName) {
|
|
function downloadExportedData(data, fileName) {
|
|
// var blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}); //type表示xlsx类型
|
|
// var blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}); //type表示xlsx类型
|
|
var blob = new Blob([data], {type: 'application/vnd.ms-excel'}); //type表示xlsx类型
|
|
var blob = new Blob([data], {type: 'application/vnd.ms-excel'}); //type表示xlsx类型
|
|
- var downloadElement = document.createElement('a');
|
|
|
|
- var href = window.URL.createObjectURL(blob); //创建下载的链接
|
|
|
|
- downloadElement.href = href;
|
|
|
|
- downloadElement.download = fileName; //下载后文件名
|
|
|
|
- document.body.appendChild(downloadElement);
|
|
|
|
- downloadElement.click(); //点击下载
|
|
|
|
- document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
|
- window.URL.revokeObjectURL(href);
|
|
|
|
|
|
+ var href = window.URL.createObjectURL(blob);//创建下载的链接
|
|
|
|
+ // 为兼容FF26 (不支持a标签的模拟点击事件)
|
|
|
|
+ if (navigator.userAgent.indexOf("Firefox") > -1){
|
|
|
|
+ //window.open(requestUrl);
|
|
|
|
+ window.location.href = href;
|
|
|
|
+ }else {
|
|
|
|
+ var downloadElement = document.createElement('a');
|
|
|
|
+ downloadElement.href = href;
|
|
|
|
+ downloadElement.download = fileName; //下载后文件名
|
|
|
|
+ document.body.appendChild(downloadElement);
|
|
|
|
+ downloadElement.click(); //点击下载
|
|
|
|
+ document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
|
+ window.URL.revokeObjectURL(href);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function getStatusImg(type,val,status){
|
|
function getStatusImg(type,val,status){
|