|
|
@@ -522,8 +522,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);
|
|
|
+ // $.getScript('http://d2.smartcost.com.cn/cach/SmartSimsun-normal.js', me.getPdfFontCallback('normal'));
|
|
|
+ // $.getScript('http://d2.smartcost.com.cn/cach/SmartSimsun-normal.js', me.getPdfFontCallback('bold'));
|
|
|
}
|
|
|
},
|
|
|
getPDFEx: function () {
|
|
|
@@ -683,17 +685,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);
|