|
|
@@ -30,8 +30,8 @@ let rptTplObj = {
|
|
|
}
|
|
|
// dynamicLoadJs('/lib/jspdf/SmartSimsun-normal.js');
|
|
|
// dynamicLoadJs('/lib/jspdf/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
|
- dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-normal.js');
|
|
|
- dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
|
+ // dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-normal.js');
|
|
|
+ // dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
|
}
|
|
|
},
|
|
|
pdfFontSimsunCallBack: function() {
|
|
|
@@ -957,8 +957,10 @@ let rptControlObj = {
|
|
|
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('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'));
|
|
|
}
|
|
|
},
|
|
|
getPDFEx: function () {
|
|
|
@@ -1149,17 +1151,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);
|