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

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

  // tab
  tagList:any = [];

  ngOnInit(): void {}

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

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

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