Echarts点击legend跳转到系统内其他页面或者外部网站

158 阅读1分钟
import { ActivatedRoute, Router, NavigationEnd } from "@angular/router";
constructor(private route: ActivatedRoute, private router: Router) { }

async ngAfterViewInit() {
    this.speEquipNumProportionChartsChange();
}

speEquipNumProportionChartsChange() {
    let that = this;
    this.speEquipNumProportionCharts.on('legendselectchanged'function (params) {
      console.log('legend被点击了', params);
      switch (params.name) {
        case '槽车':
          that.router.navigate(['/tpl/TankCarMonitoring']);
          // window.open('#/tpl/TankCarMonitoring');
          break;
        case '锅炉':
          that.router.navigate(['/tpl/BoilerMap']);
          // window.open("#/tpl/BoilerMap");
          break;
      }
    })
  }