incident-config.component.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { Component, OnInit, AfterViewInit } from "@angular/core";
  2. import { Location } from '@angular/common';
  3. @Component({
  4. selector: "app-incident-config",
  5. templateUrl: "./incident-config.component.html",
  6. styleUrls: ["./incident-config.component.less"],
  7. })
  8. export class IncidentConfigComponent implements OnInit, AfterViewInit {
  9. constructor(
  10. private _location: Location,
  11. ){}
  12. // tab
  13. tagList:any = [
  14. // { id: 1, title: '故障现象',},
  15. // { id: 2, title: '优先级',},
  16. // { id: 3, title: '数据字典',},
  17. // { id: 4, title: '消息通知',},
  18. // { id: 5, title: '工时管理',},
  19. // { id: 6, title: '科室绑定人员',},
  20. // { id: 7, title: '院区配置',},
  21. ];
  22. // 数据字典
  23. dictionaryKeyList:any[] = [
  24. { id: 1, name: '积分配置', key: "incident_category_score"},
  25. { id: 2, name: '报修来源', key: "incident_source"},
  26. { id: 3, name: '处理结果', key: "incident_closecode"},
  27. { id: 4, name: '处理方式', key: "incident_handle_type"},
  28. { id: 5, name: '状态', key: "incident_status"},
  29. { id: 6, name: '维修记录', key: "repair_type"},
  30. { id: 7, name: '满意度评价', key: "incident_degree"},
  31. { id: 8, name: '告警紧急度', key: "alarm_urgency"},
  32. ]
  33. // 院区配置
  34. hospitalTabList:any[] = [
  35. { id: 1, name: '资产及耗材', key: "asset_consumables"},
  36. { id: 2, name: '评价', key: "evaluation"},
  37. { id: 3, name: '告警自动建单', key: "alarm"},
  38. ]
  39. // 自动建单
  40. voluntarilyTabList:any[] = [
  41. { id: 1, name: '告警建单', key: "alarmConfig"},
  42. ]
  43. ngOnInit(): void {}
  44. ngAfterViewInit(){
  45. setTimeout(() => {
  46. let menus = JSON.parse(localStorage.getItem("menu"));
  47. let incidentConfig = menus.find(item => item.link == 'incidentConfig');
  48. this.tagList = incidentConfig ? (incidentConfig.childrens || []) : [];
  49. this.tagList.length && this.clickTag(this.tagList[0]);
  50. }, 0)
  51. }
  52. // 点击tab
  53. activeTagLink:any;
  54. clickTag(tag){
  55. this.activeTagLink = tag.link;
  56. }
  57. // 返回
  58. goBack(){
  59. this._location.back();
  60. }
  61. }