import Print from "@birt/plugins/print"; // 引入js文件
export default {
data() {
return {
isPrint: false,
};
},
computed: {},
methods: {
// 执行打印指定dom
async print(param) {
if (param) {
await this.setParam(param);
}
this.isPrint = true;
this.$nextTick().then(() => {
Print(this.$refs.printPages.$el);
});
},
isRenderPrint() {
return this.renderType === "print";
},
// 获取所有报表页打印sheet集合
getPrintChildren() {
this.loadAllSheet();
let sheets = this.getSheets();
let printSheets = [];
sheets.forEach(curtSheet => {
printSheets = printSheets.concat(curtSheet.children || []);
})
return printSheets;
},
}
}