diff --git a/ng6-seed/src/app/dashboard/dashboard.component.html b/ng6-seed/src/app/dashboard/dashboard.component.html index 2c2ec5601..3aaba9a19 100755 --- a/ng6-seed/src/app/dashboard/dashboard.component.html +++ b/ng6-seed/src/app/dashboard/dashboard.component.html @@ -1,212 +1,162 @@
- - -
- {{dashboardTitle}} - -
-
- -
-
- - - - {{myControl.value != null && myControl.value != '' ? myControl.value[0].name : ''}} - - (+{{myControl.value.length - 1}} {{myControl.value?.length === 2 ? 'other' : 'others'}}) - - - {{ cd.name }} / {{cd.state_name}} - - - - -
-
- - - - - {{myControl2.value != null && myControl2.value != '' ? myControl2.value[0].short_name : ''}} - - (+{{myControl2.value.length - 1}} {{myControl2.value?.length === 2 ? 'other' : 'others'}}) - - - - {{ ld.full_name }} ({{ ld.short_name }}) - - - -
- -
- - -
-
- -
Full - {{total1}}
-
- -
- -
Smart - {{total2}}
-
-
- -
Tele - {{total3}}
-
-
- -
- -
-
    -
  •        Draft
  • -
  •        Triggered
  • -
  •        Allocated
  • -
  •        Scheduled
  • -
  •        InProgress
  • -
  •        Completed
  • -
  •        QC Completed
  • -
-
-
- -
-
- PD Report + {{dashboardTitle}} - +
-
-
-
+
+
+

Full - {{total1}}

+
+ + +

{{doughnutChartDataForFullPD[0]}}

+
Triggered
+
+
+ + +

{{doughnutChartDataForFullPD[1]}}

+
Allocated
+
+
+ + +

{{doughnutChartDataForFullPD[2]}}

+
Scheduled
+
+
+ + +

{{doughnutChartDataForFullPD[3]}}

+
InProgress
+
+
+ + +

{{doughnutChartDataForFullPD[4]}}

+
Completed
+
+
+ + +

{{doughnutChartDataForFullPD[5]}}

+
QC Completed
+
+
+ + + +
+ +
+
+

Smart - {{total2}}

+
- + + + +

{{doughnutChartDataForSmartPD[0]}}

+
Triggered
+
+
+ + +

{{doughnutChartDataForSmartPD[1]}}

+
Allocated
+
+
+ + +

{{doughnutChartDataForSmartPD[2]}}

+
Scheduled
+
+
+ + +

{{doughnutChartDataForSmartPD[3]}}

+
InProgress
+
+
+ + +

{{doughnutChartDataForSmartPD[4]}}

+
Completed
+
+
+ + +

{{doughnutChartDataForSmartPD[5]}}

+
QC Completed
+
+
- -
-
-
-
- - - -

892

-
Draft
-
-
- - -

265

-
Triggered
-
-
- - -

452

-
Allocated
-
-
- - -

56

-
Scheduled
-
-
- - -

56

-
InProgress
-
-
- - -

56

-
Completed
-
-
- - -

56

-
QC Completed
-
-
- - -
-
-
-
+
+ +
+
+

Tele - {{total3}}

+
+ + + + +

{{doughnutChartDataForTelePD[0]}}

+
Triggered
+
+
+ + +

{{doughnutChartDataForTelePD[1]}}

+
Allocated
+
+
+ + +

{{doughnutChartDataForTelePD[2]}}

+
Scheduled
+
+
+ + +

{{doughnutChartDataForTelePD[3]}}

+
InProgress
+
+
+ + +

{{doughnutChartDataForTelePD[4]}}

+
Completed
+
+
+ + +

{{doughnutChartDataForTelePD[5]}}

+
QC Completed
+
+
+ + + +
+
+
+
diff --git a/ng6-seed/src/app/dashboard/dashboard.component.scss b/ng6-seed/src/app/dashboard/dashboard.component.scss index 540704696..dd4db76c5 100755 --- a/ng6-seed/src/app/dashboard/dashboard.component.scss +++ b/ng6-seed/src/app/dashboard/dashboard.component.scss @@ -1,74 +1,16 @@ -$red: #f5515f; -$blue: #05abe0; -$grey: #343434; -$p: 12px; - -::ng-deep .ngx-mat-drp-date-input{text-overflow:ellipsis !important;color:#fff !important;} - mat-card-title{ background-color:#E00201 !important; color:#fff; } -.mat-input-wrapper { - background: #fff; -} - -li -{ - display:inline-block; - //float:left; -} - - -.example-full-width { - width: 95%; -} -.oval { - height: 13px; - width: 25px; - border-radius: 50%; -} - -// .ngx-mat-drp-date-input[_ngcontent-c17] { -// text-overflow: ellipsis; -// color: #fff; -// } - -//.lengend-list { - // list-style-type: none; - //margin: 0; - // padding: 0; - // overflow: hidden; - // text-align:justify; -//} - -.lengend-element { - font-size: 1rem !important; - padding-right: 3%; -} - -.donut-inner{ - margin-top: -165px; - // margin-left: 120px; - -} - -.donut-inner h5 { - margin-bottom: 5px; - margin-top: 0; - - } -.donut-inner span{ - font-size:1rems; -} - mat-card-content{ -min-height: 400px; + min-height: 400px; } -.chart{ - padding: 0.8rem; -} -::ng-deep .body-container{ - padding: 0rem !important; + +.ReportTileCard{ + color: #fff; + height: 100px; + width: 125px; + text-align: center; + margin: 1px; } \ No newline at end of file diff --git a/ng6-seed/src/app/dashboard/dashboard.component.ts b/ng6-seed/src/app/dashboard/dashboard.component.ts index 4817ce7a2..418e9c518 100755 --- a/ng6-seed/src/app/dashboard/dashboard.component.ts +++ b/ng6-seed/src/app/dashboard/dashboard.component.ts @@ -15,26 +15,10 @@ import { BaseChartDirective } from 'ng2-charts/ng2-charts'; export class DashboardComponent { - /** Declaration Part Of DataRange Picker */ - range:Range = {fromDate:new Date(), toDate: new Date()}; - options:NgxDrpOptions; - presets:Array = []; - - @ViewChild('dateRangePicker') dateRangePicker; - /* RefLINK: https://www.npmjs.com/package/ngx-mat-daterange-picker */ - /** End Of Date Range Declaration */ - dashboardTitle = 'PD Status'; /** Declaration Part Of Doughnut Chart */ - //@ViewChild('BaseChartDirective') canvas ; - @ViewChild(BaseChartDirective) FullCanvas: BaseChartDirective; - @ViewChild(BaseChartDirective) TeleCanvas: BaseChartDirective; - @ViewChild(BaseChartDirective) SmartCanvas: BaseChartDirective; - //myChart: BaseChartDirective; - - doughnutChartType = 'doughnut'; - doughnutChartLabels: string[] = ['Draft','Triggered','Allocated','Scheduled','InProgress','Completed','QC Completed']; + doughnutChartLabels: string[] = ['Triggered','Allocated','Scheduled','InProgress','Completed','QC Completed']; doughnutChartDataForFullPD:any[]=[]; doughnutChartDataForSmartPD:any[]=[]; @@ -47,150 +31,21 @@ export class DashboardComponent { total1: number = 0; total2: number = 0; total3: number = 0; - flag : number = 0; - evt:Range - - // doughnutChartColors: any[] = [{ - // backgroundColor: ['#f44336', '#3f51b5', '#ffeb3b', '#4caf50', '#2196f3','#673ab7'] - // backgroundColor: ['#c1c1c1','#f44336','#3f51b5','#ffeb3b','#4caf50','#2196f3','#673ab7'] + + // doughnutChartColors: any[] = [{ + // backgroundColor: ['#c1c1c1','#f44336','#ffa500','#ffeb3b','#3f51b5','#00ff00','#4caf50'] // }]; - doughnutChartColors: any[] = [{ - backgroundColor: ['#c1c1c1','#f44336','#ffa500','#ffeb3b','#3f51b5','#00ff00','#4caf50'] - }]; - globalChartOptions: any = { - responsive: false, - legend: { - display: true, - position: 'bottom' - } - }; - - - /** Declaration Part Of Title Section */ - - - /** Declaration Part Of Title Form Section */ - myControl = new FormControl(); - myControl2 = new FormControl(); - myControl3 = new FormControl(); - - lenderData : any[]; - cityData : any[]; - - selectedCity : any=[]; - selectedLender : any=[]; - - constructor(private _dashboardService: DashboardService, - private _masterService: MastersService) { - - /** To Display The City Data For City DropDown */ - this._masterService.getAllCity().subscribe( - dataresult => { - if (dataresult.dataStatus == true) { - this.cityData = dataresult.records; - this.cityData = this.cityData.filter(city=>city.isactive == 1 ); - } - - }); - - /** To Display The Entities Data For Entities DropDown */ - this._masterService.getAllMasterData('ENTITY').subscribe( - dataresult => { - if (dataresult.dataStatus == true) { - this.lenderData = dataresult.records; - this.lenderData = this.lenderData.filter(entity=>entity.isactive == 1 ); - } - }); - - } + constructor(private _dashboardService: DashboardService) {} ngOnInit(){ // console.clear(); this.getDoughnutChartData(); - - - const today = new Date(); - const fromMin = new Date(today.getFullYear(), today.getMonth()-2, 1); - const fromMax = new Date(today.getFullYear(), today.getMonth()+1, 0); - const toMin = new Date(today.getFullYear(), today.getMonth()-1, 1); - const toMax = new Date(today.getFullYear(), today.getMonth()+2, 0); - - const LastDateForPreMonth = new Date(today.getFullYear(), today.getMonth(), 0); - const FirstDateForPreMonth = new Date(today.getFullYear(), today.getMonth()-1, 1); - - // console.log('FromDateMin:',fromMin); - // console.log('FromDateMax:',fromMax); - // console.log('ToDateMin',toMin); - // console.log('ToDateMax',toMax); - // console.log('LastDateForPreMonth',LastDateForPreMonth); - // console.log('FirstDateForPreMonth',FirstDateForPreMonth); - -// const resetRange = {fromDate: today, toDate: today}; -// this.dateRangePicker.resetDates(resetRange); // will trigger selectedDateRangeChanged - - - this.setupPresets(); - this.options = { - presets: this.presets, - format: 'mediumDate', - range: {fromDate: today, toDate: today}, - applyLabel: "Submit", - calendarOverlayConfig: { - shouldCloseOnBackdropClick: false, - hasBackdrop:false, - }, - placeholder: "Date", - cancelLabel: "Cancel", - excludeWeekends:false, - fromMinMax: {fromDate:fromMin, toDate:fromMax}, - toMinMax: {fromDate:toMin, toDate:toMax} - }; } - updateRange(range: Range){ - this.range = range; - - if(range.fromDate != range.toDate){ - // console.log('if from Date',range.fromDate); - // console.log('if to date',range.toDate); - this.onChange(this.range,1); - } - else{ - // console.log('else from Date',range.fromDate); - // console.log('else to date',range.toDate); - // console.log('same'); - } - } - setupPresets() { - - const backDate = (numOfDays) => { - const today = new Date(); - return new Date(today.setDate(today.getDate() - numOfDays)); - } - - const today = new Date(); - const yesterday = backDate(1); - const minus7 = backDate(7) - const minus30 = backDate(30); - const currMonthStart = new Date(today.getFullYear(), today.getMonth(), 1); - const currMonthEnd = new Date(today.getFullYear(), today.getMonth()+1, 0); - const lastMonthStart = new Date(today.getFullYear(), today.getMonth()-1, 1); - const lastMonthEnd = new Date(today.getFullYear(), today.getMonth(), 0); - - this.presets = [ - {presetLabel: "Yesterday", range:{ fromDate:yesterday, toDate:today }}, - {presetLabel: "Last 7 Days", range:{ fromDate: minus7, toDate:today }}, - {presetLabel: "Last 30 Days", range:{ fromDate: minus30, toDate:today }}, - {presetLabel: "This Month", range:{ fromDate: currMonthStart, toDate:currMonthEnd }}, - {presetLabel: "Last Month", range:{ fromDate: lastMonthStart, toDate:lastMonthEnd }} - ] -} - - /** * To Get and Display Doughnut Chart Data Based on PDType **/ @@ -202,10 +57,11 @@ getDoughnutChartData(){ let lenderarr = ''; this._dashboardService.getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr).subscribe(data => { - this.flag = 1; + // console.log('data',data); + // console.log(' ***** Doughnut Chart Data *****',data); - let DraftIndexvalue = this.doughnutChartLabels.indexOf('Draft'); + // let DraftIndexvalue = this.doughnutChartLabels.indexOf('Draft'); let TriggedIndexvalue = this.doughnutChartLabels.indexOf('Triggered'); let AllocatedIndexvalue = this.doughnutChartLabels.indexOf('Allocated'); let ScheduledIndexvalue = this.doughnutChartLabels.indexOf('Scheduled'); @@ -221,19 +77,19 @@ getDoughnutChartData(){ let MonthlySmartPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'SMART' ); let MonthlyTelePDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'TELE' ); - let DraftFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'DRAFT'); - if(DraftFullPDvalue.length != '0'){ - //console.log('console triggered value',TriggerFullPDvalue); - for(let FPD of DraftFullPDvalue){ + // let DraftFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'DRAFT'); + // if(DraftFullPDvalue.length != '0'){ + // //console.log('console triggered value',TriggerFullPDvalue); + // for(let FPD of DraftFullPDvalue){ - this.tempDataFullPD[DraftIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataFullPD[DraftIndexvalue] = 0; - } + // this.tempDataFullPD[DraftIndexvalue] = +FPD.count; + // } + // } + // else{ + // this.tempDataFullPD[DraftIndexvalue] = 0; + // } - let TriggerFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); + let TriggerFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); if(TriggerFullPDvalue.length != '0'){ for(let FPD of TriggerFullPDvalue){ @@ -308,17 +164,17 @@ getDoughnutChartData(){ this.tempDataFullPD[QCCompletedIndexvalue] = 0; } - let DraftSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'DRAFT'); - if(DraftSmartPDvalue.length != '0'){ - //console.log('console triggered value',TriggerFullPDvalue); - for(let FPD of DraftSmartPDvalue){ + // let DraftSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'DRAFT'); + // if(DraftSmartPDvalue.length != '0'){ + // //console.log('console triggered value',TriggerFullPDvalue); + // for(let FPD of DraftSmartPDvalue){ - this.tempDataSmartPD[DraftIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataSmartPD[DraftIndexvalue] = 0; - } + // this.tempDataSmartPD[DraftIndexvalue] = +FPD.count; + // } + // } + // else{ + // this.tempDataSmartPD[DraftIndexvalue] = 0; + // } let TriggerSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); if(TriggerSmartPDvalue.length != '0'){ @@ -373,7 +229,7 @@ getDoughnutChartData(){ for(let FPD of CompletedSmartPDvalue){ this.tempDataSmartPD[CompletedIndexvalue] = +FPD.count; - } + } //let y = +CompletedFullPDvalue.count; } @@ -395,17 +251,17 @@ getDoughnutChartData(){ } - let DraftTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'DRAFT'); - if(DraftTelePDvalue.length != '0'){ + // let DraftTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'DRAFT'); + // if(DraftTelePDvalue.length != '0'){ - for(let FPD of DraftTelePDvalue){ + // for(let FPD of DraftTelePDvalue){ - this.tempDataTelePD[DraftIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataTelePD[DraftIndexvalue] = 0; - } + // this.tempDataTelePD[DraftIndexvalue] = +FPD.count; + // } + // } + // else{ + // this.tempDataTelePD[DraftIndexvalue] = 0; + // } let TriggerTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); if(TriggerTelePDvalue.length != '0'){ @@ -484,393 +340,20 @@ getDoughnutChartData(){ } else{ - this.tempDataFullPD = [0,0,0,0,0,0,0]; - this.tempDataSmartPD = [0,0,0,0,0,0,0]; - this.tempDataTelePD = [0,0,0,0,0,0,0]; + this.tempDataFullPD = [0,0,0,0,0,0]; + this.tempDataSmartPD = [0,0,0,0,0,0]; + this.tempDataTelePD = [0,0,0,0,0,0]; } this.doughnutChartDataForFullPD = this.tempDataFullPD; this.doughnutChartDataForSmartPD = this.tempDataSmartPD; this.doughnutChartDataForTelePD = this.tempDataTelePD; + this.total1 = this.tempDataFullPD.reduce((a, b) => a + b, 0); this.total2 = this.tempDataSmartPD.reduce((a, b) => a + b, 0); this.total3 = this.tempDataTelePD.reduce((a, b) => a + b, 0); - // console.log('Final Full Data '+ this.doughnutChartDataForFullPD+'Temp Data'+this.tempDataFullPD+'Full Total '+this.total1); - // console.log('Final Smart Data '+ this.doughnutChartDataForSmartPD+' Temp Data '+this.tempDataSmartPD+'Smart Total '+this.total2); - // console.log('Final Tele Data '+ this.doughnutChartDataForTelePD+' Temp Data'+this.tempDataTelePD+'Tele Total '+this.total3); - }) } - -doughnutOptions: any = Object.assign({ - elements: { - arc: { - borderWidth: 0 - } - }, - centertext:'One' -},this.globalChartOptions); - -// ngOnChanges(){ -// // this.barChartData=this.chartData; -// this.barChartLabel=this.chartLabel; -// } - - -onChange(e: any,flag: any) { - - let fromdate; - let todate; - - if(flag == 1){ - this.evt = e - fromdate = new Date(this.evt.fromDate); - todate = new Date(this.evt.toDate); - - } - - if(flag == 2){ - let data = e.source.value.city_id; - e.source._selected == true ? this.selectedCity.push(data) - : this.selectedCity.splice(this.selectedCity.indexOf(data),1); - - } - - if(flag == 3){ - let data = e.source.value.entity_id; - e.source._selected == true ? this.selectedLender.push(data) - : this.selectedLender.splice(this.selectedLender.indexOf(data),1); - - - - - } - - - - this._dashboardService.getPDDetailForDoughnut(fromdate,todate,this.selectedCity,this.selectedLender).subscribe(data => { - - // console.log(' *****Updated Date Doughnut Chart Data *****',data); - - if(data.records.current_month.length != 0){ - this.total1 = 0; - this.total2 = 0; - this.total3 = 0; - } - - this.doughnutChartDataForFullPD = []; - this.doughnutChartDataForSmartPD = []; - this.doughnutChartDataForTelePD = []; - this.tempDataFullPD = []; - this.tempDataSmartPD =[]; - this.tempDataTelePD = []; - - - let DraftIndexvalue = this.doughnutChartLabels.indexOf('Draft'); - let TriggedIndexvalue = this.doughnutChartLabels.indexOf('Triggered'); - let AllocatedIndexvalue = this.doughnutChartLabels.indexOf('Allocated'); - let ScheduledIndexvalue = this.doughnutChartLabels.indexOf('Scheduled'); - let InProgressIndexvalue = this.doughnutChartLabels.indexOf('InProgress'); - let CompletedIndexvalue = this.doughnutChartLabels.indexOf('Completed'); - let QCCompletedIndexvalue = this.doughnutChartLabels.indexOf('QC Completed'); - - if(data.records.current_month.length != 0){ - //console.log('If Condition monthLY'); - // console.log('Monthly Status',data.records.current_month); - - let MonthlyFullPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'FULL' ); - let MonthlySmartPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'SMART' ); - let MonthlyTelePDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'TELE' ); - - let DraftFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'DRAFT'); - if(DraftFullPDvalue.length != '0'){ - - for(let FPD of DraftFullPDvalue){ - let y = +FPD.count; - this.total1 = this.total1+y; - this.tempDataFullPD[DraftIndexvalue] = y; - } - } - else{ - this.tempDataFullPD[DraftIndexvalue] = 0; - } - - let TriggerFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); - if(TriggerFullPDvalue.length != '0'){ - - for(let FPD of TriggerFullPDvalue){ - - this.tempDataFullPD[TriggedIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataFullPD[TriggedIndexvalue] = 0; - } - - let AllocatedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); - if(AllocatedFullPDvalue.length != '0'){ - for(let FPD of AllocatedFullPDvalue){ - - this.tempDataFullPD[AllocatedIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataFullPD[AllocatedIndexvalue] = 0; - } - - let ScheduledFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); - if(ScheduledFullPDvalue.length != '0'){ - for(let FPD of ScheduledFullPDvalue){ - - this.tempDataFullPD[ScheduledIndexvalue] = +FPD.count; - } - //let y = +ScheduledFullPDvalue.count; - - } - else{ - this.tempDataFullPD[ScheduledIndexvalue] = 0; - } - - let InProgressFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); - if(InProgressFullPDvalue.length != '0'){ - for(let FPD of InProgressFullPDvalue){ - - this.tempDataFullPD[InProgressIndexvalue] = +FPD.count; - } - //let y = +InProgressFullPDvalue.count; - - } - else{ - this.tempDataFullPD[InProgressIndexvalue] = 0; - } - - let CompletedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == 'COMPLETED'); - if(CompletedFullPDvalue.length != '0'){ - for(let FPD of CompletedFullPDvalue){ - - this.tempDataFullPD[CompletedIndexvalue] = +FPD.count; - } - //let y = +CompletedFullPDvalue.count; - - } - else{ - this.tempDataFullPD[CompletedIndexvalue] = 0; - } - - let QCCompletedFullPDvalue = MonthlyFullPDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); - if(QCCompletedFullPDvalue.length != '0'){ - for(let FPD of QCCompletedFullPDvalue){ - - this.tempDataFullPD[QCCompletedIndexvalue] = +FPD.count; - } - //let y = +QCCompletedFullPDvalue.count; - - } - else{ - this.tempDataFullPD[QCCompletedIndexvalue] = 0; - } - - let DraftSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'DRAFT'); - if(DraftSmartPDvalue.length != '0'){ - //console.log('console triggered value',TriggerFullPDvalue); - for(let FPD of DraftSmartPDvalue){ - - this.tempDataSmartPD[DraftIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataSmartPD[DraftIndexvalue] = 0; - } - - let TriggerSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); - if(TriggerSmartPDvalue.length != '0'){ - - for(let FPD of TriggerSmartPDvalue){ - - this.tempDataSmartPD[TriggedIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataSmartPD[TriggedIndexvalue] = 0; - } - - let AllocatedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); - if(AllocatedSmartPDvalue.length != '0'){ - for(let FPD of AllocatedSmartPDvalue){ - - this.tempDataSmartPD[AllocatedIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataSmartPD[AllocatedIndexvalue] = 0; - } - - let ScheduledSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); - if(ScheduledSmartPDvalue.length != '0'){ - for(let FPD of ScheduledSmartPDvalue){ - - this.tempDataSmartPD[ScheduledIndexvalue] = +FPD.count; - } - //let y = +ScheduledFullPDvalue.count; - - } - else{ - this.tempDataSmartPD[ScheduledIndexvalue] = 0; - } - - let InProgressSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); - if(InProgressSmartPDvalue.length != '0'){ - for(let FPD of InProgressSmartPDvalue){ - - this.tempDataSmartPD[InProgressIndexvalue] = +FPD.count; - } - //let y = +InProgressFullPDvalue.count; - - } - else{ - this.tempDataSmartPD[InProgressIndexvalue] = 0; - } - - let CompletedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == 'COMPLETED'); - if(CompletedSmartPDvalue.length != '0'){ - for(let FPD of CompletedSmartPDvalue){ - - this.tempDataSmartPD[CompletedIndexvalue] = +FPD.count; - } - //let y = +CompletedFullPDvalue.count; - - } - else{ - this.tempDataSmartPD[CompletedIndexvalue] = 0; - } - - let QCCompletedSmartPDvalue = MonthlySmartPDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); - if(QCCompletedSmartPDvalue.length != '0'){ - for(let FPD of QCCompletedSmartPDvalue){ - - this.tempDataSmartPD[QCCompletedIndexvalue] = +FPD.count; - } - //let y = +QCCompletedFullPDvalue.count; - - } - else{ - this.tempDataSmartPD[QCCompletedIndexvalue] = 0; - } - - - let DraftTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'DRAFT'); - if(DraftTelePDvalue.length != '0'){ - - for(let FPD of DraftTelePDvalue){ - - this.tempDataTelePD[DraftIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataTelePD[DraftIndexvalue] = 0; - } - - let TriggerTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'TRIGGERED'); - if(TriggerTelePDvalue.length != '0'){ - //console.log('console triggered value',TriggerTelePDvalue); - for(let FPD of TriggerTelePDvalue){ - - this.tempDataTelePD[TriggedIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataTelePD[TriggedIndexvalue] = 0; - } - - let AllocatedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'ALLOCATED'); - if(AllocatedTelePDvalue.length != '0'){ - for(let FPD of AllocatedTelePDvalue){ - - this.tempDataTelePD[AllocatedIndexvalue] = +FPD.count; - } - } - else{ - this.tempDataTelePD[AllocatedIndexvalue] = 0; - } - - let ScheduledTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'SCHEDULED'); - if(ScheduledTelePDvalue.length != '0'){ - for(let FPD of ScheduledTelePDvalue){ - - this.tempDataTelePD[ScheduledIndexvalue] = +FPD.count; - } - //let y = +ScheduledFullPDvalue.count; - - } - else{ - this.tempDataTelePD[ScheduledIndexvalue] = 0; - } - - let InProgressTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'INPROGRESS'); - if(InProgressTelePDvalue.length != '0'){ - for(let FPD of InProgressTelePDvalue){ - - this.tempDataTelePD[InProgressIndexvalue] = +FPD.count; - } - //let y = +InProgressFullPDvalue.count; - - } - else{ - this.tempDataTelePD[InProgressIndexvalue] = 0; - } - - let CompletedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == 'COMPLETED'); - if(CompletedTelePDvalue.length != '0'){ - for(let FPD of CompletedTelePDvalue){ - - this.tempDataTelePD[CompletedIndexvalue] = +FPD.count; - } - //let y = +CompletedFullPDvalue.count; - - } - else{ - this.tempDataTelePD[CompletedIndexvalue] = 0; - } - - let QCCompletedTelePDvalue = MonthlyTelePDArr.filter(arr=>arr.pd_status == "QC_COMPLETED"); - if(QCCompletedTelePDvalue.length != '0'){ - for(let FPD of QCCompletedTelePDvalue){ - - this.tempDataTelePD[QCCompletedIndexvalue] = +FPD.count; - } - //let y = +QCCompletedFullPDvalue.count; - - } - else{ - this.tempDataTelePD[QCCompletedIndexvalue] = 0; - } - } - - else{ - this.tempDataFullPD = [0,0,0,0,0,0,0]; - this.tempDataSmartPD = [0,0,0,0,0,0,0]; - this.tempDataTelePD = [0,0,0,0,0,0,0]; - } - - this.doughnutChartDataForFullPD= this.tempDataFullPD; - this.doughnutChartDataForSmartPD = this.tempDataSmartPD; - this.doughnutChartDataForTelePD = this.tempDataTelePD; - this.doughnutChartLabels = this.doughnutChartLabels; - this.total1 = this.tempDataFullPD.reduce((a, b) => a + b, 0); - this.total2 = this.tempDataSmartPD.reduce((a, b) => a + b, 0); - this.total3 = this.tempDataTelePD.reduce((a, b) => a + b, 0); - - this.FullCanvas.chart.update(); - this.SmartCanvas.chart.update(); - this.TeleCanvas.chart.update(); - - // console.log('Final Full Data '+ this.doughnutChartDataForFullPD+'Temp Data'+this.tempDataFullPD+'Full Total '+this.total1); - // console.log('Final Smart Data '+ this.doughnutChartDataForSmartPD+' Temp Data '+this.tempDataSmartPD+'Smart Total '+this.total2); - // console.log('Final Tele Data '+ this.doughnutChartDataForTelePD+' Temp Data'+this.tempDataTelePD+'Tele Total '+this.total3); - - }) - -} } \ No newline at end of file diff --git a/ng6-seed/src/app/error/404/error-404-component.html b/ng6-seed/src/app/error/404/error-404-component.html index 393d8b84a..16c88e4b1 100755 --- a/ng6-seed/src/app/error/404/error-404-component.html +++ b/ng6-seed/src/app/error/404/error-404-component.html @@ -2,7 +2,7 @@
-

SINEEDGE +

PD Genie

diff --git a/ng6-seed/src/app/error/503/error-503-component.html b/ng6-seed/src/app/error/503/error-503-component.html index e24b6d7a5..d7b028024 100755 --- a/ng6-seed/src/app/error/503/error-503-component.html +++ b/ng6-seed/src/app/error/503/error-503-component.html @@ -2,7 +2,7 @@
-

SINEEDGE +

PD Genie

diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.html b/ng6-seed/src/app/layouts/admin/admin-layout.component.html index b367c8c37..0b8ee9aaf 100755 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.html @@ -15,7 +15,9 @@
@@ -32,6 +34,7 @@
+ {{ menuitem.icon }} @@ -103,10 +106,9 @@ --> - + - {{userDep}} - + {{userDep}}
@@ -154,7 +156,6 @@