diff --git a/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts index faf61852..13b560f4 100644 --- a/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts +++ b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts @@ -4,6 +4,7 @@ import { TranslatorService } from '../../hmg-common/services/translator/translat import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service'; import { GetSubordinatesAttdStatusRequest } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { GetSubordinatesAttdStatusResponse } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'; @Component({ @@ -12,22 +13,22 @@ import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbore styleUrls: ['./monthly-attendance.component.scss'], }) export class MonthlyAttendanceComponent implements OnInit { - gaugeType = "full"; + + constructor( + private cs: CommonService, + public ts: TranslatorService, + public sharedData: SharedDataService, + public DS: DashboredService) { } + gaugeType = 'full'; gaugeValue = 28.3; - gaugeLabel = "Days"; + gaugeLabel = 'Days'; // gaugeAppendText = "km/hr"; currentMonth: any; - currentDate; - - constructor(private cs: CommonService, public ts: TranslatorService, public sharedData: SharedDataService, public DS :DashboredService) { } - ngOnInit() {} - - ionViewWillEnter(){ - this.currentMonth = this.sharedData.getSharedData("currentMonth"); - } - public options = { + todayYear: any; + todayMonth: any; + public options = { cutoutPercentage: 80, @@ -39,43 +40,62 @@ export class MonthlyAttendanceComponent implements OnInit { - public data = { +public data = { datasets: [ - { + { - data: [120,50], + data: [120, 50], - backgroundColor: [ + backgroundColor: [ - '#22c6b3', + '#22c6b3', - '#094875', - ], + '#094875', + ], - borderWidth: 2 + borderWidth: 2 - }] + }] - }; + }; + ngOnInit() { } + + ionViewWillEnter() { + this.currentMonth = this.sharedData.getSharedData("currentMonth"); + console.log(this.currentMonth); + let day = this.currentMonth.split(" "); + this.todayMonth =day[0]; + this.todayYear = day[1]; + this.todayYear = parseInt(this.todayYear); + console.log("MONTH: " +this.todayMonth); + console.log("YEAR: " +this.todayYear); + this.getSubordinatesAttStatus() + } - getSubordinatesAttStatus(){ + getSubordinatesAttStatus() { let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest(); - request.P_SCHEDULE_DATE_FROM="/Date(1578603600000+0300)/"; //test - request.P_SCHEDULE_DATE_TO="/Date(1576011600000+0300)/";//test - - this.DS.getSubordinatesAttStatus( request,()=> {console.log("Error ");} ).subscribe((result:GetSubordinatesAttdStatusResponse)=>{ + // request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; //test + // request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/";//test + console.log(this.currentMonth); + request.SearchMonth = this.todayMonth; + request.SearchYear = 2019//this.todayYear; + + this.DS.getSubordinatesAttStatus(request, () => { console.log("Error "); }).subscribe((result: GetSubordinatesAttdStatusResponse) => { if (this.cs.validResponse(result)) { console.log("response"); console.log(result); } - }); } + x(){ + console.log("ENAD CHANge") + } + } diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts index 740656b8..858449b3 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts @@ -2,6 +2,9 @@ import { Request } from '../../../services/models/request' export class GetSubordinatesAttdStatusRequest extends Request{ //public static SHARED_DATA = ''; - public P_SCHEDULE_DATE_FROM :any; - public P_SCHEDULE_DATE_TO :any; + public P_SCHEDULE_DATE_FROM: any; + public P_SCHEDULE_DATE_TO: any; + public SearchMonth: string; + public SearchYear: number; + } \ No newline at end of file diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 643dab2c..b720c4cc 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -938,8 +938,9 @@ border:0px + .monthview-selected { - background-color: #76cfb7 !important; + background-color: gray !important; color: #fff !important; }