import { Component, OnInit, AfterViewInit } from "@angular/core";
import { Location } from '@angular/common';

@Component({
  selector: "app-data-generate",
  templateUrl: "./data-generate.component.html",
  styleUrls: ["./data-generate.component.less"],
})
export class DataGenerateComponent implements OnInit, AfterViewInit {
  constructor(
    private _location: Location,
  ){}

  // tab
  tagList:any = [
    // { id: 1, name: '标本',},
  ];

  ngOnInit(): void {}

  ngAfterViewInit(){
    setTimeout(() => {
      let menus = JSON.parse(localStorage.getItem("menu"));
      let dataGenerate = menus.find(item => item.link == 'dataGenerate');
      this.tagList = dataGenerate ? (dataGenerate.childrens || []) : [];
      this.tagList.length && this.clickTag(this.tagList[0]);
    }, 0)
  }

  // 点击tab
  activeTagLink:any = 1;
  clickTag(tag){
    this.activeTagLink = tag.link;
  }

  // 返回
  goBack(){
    this._location.back();
  }
}
