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

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

  // tab
  tagList:any = [
    // { id: 1, name: '快捷按钮配置',},
  ];

  // 数据字典
  dictionaryKeyList:any[] = [
    { id: 1, name: '携带设备', key: "goods"},
		{ id: 2, name: '业务类型', key: "business_type"},
  ]

  // 院区配置
  hospitalTabList:any[] = [
    { id: 2, name: '评价', key: "evaluate"}
  ]
	
	// 自定义业务
	customBusinessList:any[] = [
	  { id: 1, name: '一键交接', key: "one_connect"}
	]
	
  ngOnInit(): void {}

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

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

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