|
|
@@ -416,16 +416,26 @@ let rptControlObj = {
|
|
|
params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
params.option = "normal";
|
|
|
+ $.bootstrapLoading.start();
|
|
|
CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, 20000, true, function(result){
|
|
|
if (result) {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
let uuIdUrls = [];
|
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
|
uuIdUrls.push(uuIdUrl);
|
|
|
downloadReport(uuIdUrls);
|
|
|
} else {
|
|
|
- //
|
|
|
+ $.bootstrapLoading.end();
|
|
|
}
|
|
|
- }, null, null
|
|
|
+ },
|
|
|
+ function(failRst){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ console.log(failRst);
|
|
|
+ },
|
|
|
+ function(exceptionRst){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ console.log(exceptionRst);
|
|
|
+ }
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
@@ -446,8 +456,10 @@ let rptControlObj = {
|
|
|
params.isOneSheet = true;
|
|
|
params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
params.option = "normal";
|
|
|
+ $.bootstrapLoading.start();
|
|
|
CommonAjax.postEx("report_api/createExcelFiles", params, 20000, true, function(result){
|
|
|
if (result) {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
|
|
|
@@ -455,9 +467,17 @@ let rptControlObj = {
|
|
|
}
|
|
|
downloadReport(uuIdUrls);
|
|
|
} else {
|
|
|
- //
|
|
|
+ $.bootstrapLoading.end();
|
|
|
}
|
|
|
- }, null, null
|
|
|
+ },
|
|
|
+ function(failRst){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ console.log(failRst);
|
|
|
+ },
|
|
|
+ function(exceptionRst){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ console.log(exceptionRst);
|
|
|
+ }
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
@@ -519,11 +539,14 @@ let rptControlObj = {
|
|
|
},
|
|
|
getPDFPre: function () {
|
|
|
let me = rptControlObj;
|
|
|
+ $.bootstrapLoading.start();
|
|
|
if (rptTplObj.pdfFont['SmartSimsun'].length === 2) {
|
|
|
me.getPDFEx();
|
|
|
} else {
|
|
|
- dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-normal.js', me.getPdfFontCallback('normal'));
|
|
|
- dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', me.getPdfFontCallback('bold'));
|
|
|
+ // dynamicLoadJs('/lib/jspdf/SmartSimsun-normal.js',"normal", me.getPdfFontCallback);
|
|
|
+ // dynamicLoadJs('/lib/jspdf/SmartSimsun-bold.js',"bold", me.getPdfFontCallback);
|
|
|
+ dynamicLoadJs('https://d2.smartcost.com.cn/cach/SmartSimsun-normal.js', 'normal', me.getPdfFontCallback);
|
|
|
+ dynamicLoadJs('https://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', 'bold', me.getPdfFontCallback);
|
|
|
}
|
|
|
},
|
|
|
getPDFEx: function () {
|
|
|
@@ -541,6 +564,7 @@ let rptControlObj = {
|
|
|
params.rpt_ids = rptIds.join(",");
|
|
|
CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
|
|
|
function(result){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
let pageSize = rptControlObj.getCurrentPageSize();
|
|
|
for (let idx = 0; idx < result.length; idx++) {
|
|
|
let pageData = result[idx];
|
|
|
@@ -548,10 +572,12 @@ let rptControlObj = {
|
|
|
}
|
|
|
},
|
|
|
function(failRst){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
sessionStorage.currentPageData = null;
|
|
|
console.log(failRst);
|
|
|
},
|
|
|
function(exceptionRst){
|
|
|
+ $.bootstrapLoading.end();
|
|
|
sessionStorage.currentPageData = null;
|
|
|
console.log(exceptionRst);
|
|
|
}
|
|
|
@@ -683,17 +709,18 @@ function downloadReport(urls) {
|
|
|
private_download();
|
|
|
}
|
|
|
|
|
|
-function dynamicLoadJs(url, callback) {
|
|
|
+function dynamicLoadJs(url, type, callback) {
|
|
|
let head = document.getElementsByTagName('head')[0];
|
|
|
let script = document.createElement('script');
|
|
|
script.type = 'text/javascript';
|
|
|
script.src = url;
|
|
|
if(callback) {
|
|
|
- script.onload = script.onreadystatechange = function () {
|
|
|
- if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"){
|
|
|
- callback();
|
|
|
- script.onload = script.onreadystatechange = null;
|
|
|
- }
|
|
|
+ script.onload = script.onreadystatechange = function (event) {
|
|
|
+ // console.log('this.readyState: ' + this.readyState);
|
|
|
+ callback(type);
|
|
|
+ script.onload = script.onreadystatechange = null;
|
|
|
+ // if (this.readyState === "loaded" || this.readyState === "complete"){
|
|
|
+ // }
|
|
|
};
|
|
|
}
|
|
|
head.appendChild(script);
|