Angular LMS app
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

attendance.component.ts 1.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { Component, OnInit } from '@angular/core';
  2. import { Location } from '@angular/common';
  3. import { DemoService } from '../services/demo.service';
  4. @Component({
  5. selector: 'app-attendance',
  6. templateUrl: './attendance.component.html',
  7. styleUrls: ['./attendance.component.scss']
  8. })
  9. export class AttendanceComponent implements OnInit {
  10. selectedList: number = 1;
  11. selectedSegment: any;
  12. selectedSegmentTab: any;
  13. selectedReportYear: any;
  14. demoType: string;
  15. attendanceList = [];
  16. constructor(
  17. private location: Location,
  18. private demoService: DemoService
  19. ) { }
  20. ngOnInit(): void {
  21. this.demoType = localStorage.demoType;
  22. this.attendanceList = this.demoService.attendanceList;
  23. if (this.demoType === 'Teacher') {
  24. this.selectedList = 1;
  25. this.selectedSegment = this.attendanceList[0];
  26. this.selectedSegmentTab = this.attendanceList[0].subjects[0];
  27. this.selectedReportYear = this.attendanceList[0].subjects[0].attendance[0].year;
  28. } else {
  29. this.selectedList = 1;
  30. this.selectedSegment = 'ALL';
  31. this.selectedSegmentTab = 'report';
  32. this.selectedReportYear = 2020;
  33. }
  34. }
  35. back() {
  36. this.location.back();
  37. }
  38. }