import { Component, OnInit, ViewChild, Input } from "@angular/core"; import { ENgxPrintComponent } from "e-ngx-print"; import { ChartMenuService } from '../service/chart-menu.service'; @Component({ selector: "bcac-toolbox", templateUrl: "./toolbox.component.html", styleUrls: ["./toolbox.component.scss"], }) export class ToolboxComponent implements OnInit { @ViewChild("print1", { static: false }) print1Component: ENgxPrintComponent; constructor( private chartMenuService: ChartMenuService ) { } @Input() chartInstance; @Input() fileName: string; ngOnInit() { } closePanel(event) { let el = event.target; if (el) { el.setAttribute("style", "display:none"); } } downloadImage(imageType: string, fileName: string) { this.chartMenuService.downloadEchartImage(this.chartInstance, fileName, imageType); } fullScreen(event) { const el = event.path[5]; //菜单下拉框 this.chartMenuService.fullScreen(el); } customPrint() { console.log(this.print1Component) this.chartMenuService.customPrint(this.chartInstance, this.print1Component); } }