|
|
@@ -21,7 +21,24 @@ let rptTplObj = {
|
|
|
let canvas = document.getElementById("rptCanvas");
|
|
|
canvas.onclick = canvasOprObj.canvasOnClick;
|
|
|
canvas.onmousemove = canvasOprObj.canvasOnMouseMove;
|
|
|
+ if (JpcJsPDFHelper.doc === null) {
|
|
|
+ JpcJsPDFHelper.initialize('p', 'pt', 'a4');
|
|
|
+ }
|
|
|
+ dynamicLoadJs('/lib/jspdf/SmartSimsun-normal.js');
|
|
|
+ dynamicLoadJs('/lib/jspdf/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
|
}
|
|
|
+ },
|
|
|
+ pdfFontSimsunCallBack: function() {
|
|
|
+ rptTplObj.pdfFont['SmartSimsun'].push('normal');
|
|
|
+ rptTplObj.pdfFont['SmartSimsun'].push('bold');
|
|
|
+ },
|
|
|
+ pdfFontSimkaiCallBack: function() {
|
|
|
+ rptTplObj.pdfFont['simkai'].push('normal');
|
|
|
+ rptTplObj.pdfFont['simkai'].push('bold');
|
|
|
+ },
|
|
|
+ pdfFontSimheiCallBack: function() {
|
|
|
+ rptTplObj.pdfFont['simhei'].push('normal');
|
|
|
+ rptTplObj.pdfFont['simhei'].push('bold');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -507,17 +524,9 @@ let rptControlObj = {
|
|
|
params.rpt_ids = rptIds.join(",");
|
|
|
CommonAjax.postEx("report_api/getMultiReports", params, 30000, true,
|
|
|
function(result){
|
|
|
- // sessionStorage.multiRptsData = JSON.stringify(result);
|
|
|
- // sessionStorage.pageSize = rptControlObj.getCurrentPageSize();
|
|
|
- // sessionStorage.orientation = rptControlObj.getCurrentOrientation();
|
|
|
- // sessionStorage.scaleFactor = 1;
|
|
|
- // window.open('/rpt_print');
|
|
|
- // console.log(result);
|
|
|
let pageSize = rptControlObj.getCurrentPageSize();
|
|
|
for (let idx = 0; idx < result.length; idx++) {
|
|
|
let pageData = result[idx];
|
|
|
- // let orientation = (pageData[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE][0] < pageData[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE][1])?"portrait":"landscape";
|
|
|
- // showPreviewData(svgArr, actArea, scaleFactor, sessionStorage.pageSize, orientation, orgPixelSize);
|
|
|
JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rpt_names[idx]);
|
|
|
}
|
|
|
},
|
|
|
@@ -656,3 +665,28 @@ function downloadReport(urls) {
|
|
|
}
|
|
|
private_download();
|
|
|
}
|
|
|
+
|
|
|
+function dynamicLoadJs(url, 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;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ head.appendChild(script);
|
|
|
+}
|
|
|
+
|
|
|
+function dynamicLoadCss(url) {
|
|
|
+ let head = document.getElementsByTagName('head')[0];
|
|
|
+ let link = document.createElement('link');
|
|
|
+ link.type='text/css';
|
|
|
+ link.rel = 'stylesheet';
|
|
|
+ link.href = url;
|
|
|
+ head.appendChild(link);
|
|
|
+}
|