// 导出pdf
exportPdf() {
// let img = this.myEcharts1.getDataURL();
let params = {
...this.query,
coursename: this.courseName,
rname: this.className,
lines: this.templateData1,
segments: this.templateData2,
customizes: this.templateData3
};
params.page1 = undefined;
params.page2 = undefined;
params.size = undefined;
this.$postjson(
"/PDF/export",
params
).then(res => {
if (res.data.status === 200) {
if (this.bang > 0) {
const fileDownLoad = {
url: res.data.url,
goNext: "附件下载"
};
//IOS端调用
if (window.webkit) {
window.webkit.messageHandlers.call.postMessage(fileDownLoad);
}
//安卓端调用
if (window.WebViewJavascriptBridge) {
window.WebViewJavascriptBridge.send(fileDownLoad);
} else {
document.addEventListener(
"WebViewJavascriptBridgeReady",
function() {
window.WebViewJavascriptBridge.send(fileDownLoad);
},
false
);
}
} else {
window.open(res.data.data);
// kk = res.data.url;
}
}
});
},