Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-pm-backlog/mrm-pm-backlog.component.ts (line 44)
Part of: Pams
MrmPmBacklogComponent is an Angular dashboard widget that loads and prepares PM backlog data for display. It responds to lifecycle changes and window resizing, calculates performance values, formats price and month labels, and manages cached widget state.
Methods
| Method | Signature | Returns |
|---|---|---|
ngOnInit | ngOnInit() | void |
ngOnChanges | ngOnChanges() | void |
ngOnDestroy | ngOnDestroy() | void |
getDashboardData | getDashboardData() | void |
initalizingData | initalizingData(value: BranchData[]) | void |
calculatePerformancePer | calculatePerformancePer(month: MonthData) | number |
translateMonthName | translateMonthName(month: MonthData) | string |
getpriceFormatted | getpriceFormatted(x: undefined) | string |
onResize | onResize() | void |
setChaching | setChaching() | void |
getChaching | getChaching() | void |
onValueChanged | onValueChanged(e: undefined) | void |
onChartInit | onChartInit(e: any, index: number) | void |
switchChartTypeHandler | switchChartTypeHandler() | void |
switchBasedOnTendencyHandler | switchBasedOnTendencyHandler() | void |
comparingWithPrevMonth | comparingWithPrevMonth(month: MonthData, bIndex: number, index: number) | string |
comparingBookingWithPrevSumm | comparingBookingWithPrevSumm(month: TotalBookingMonths, index: number) | string |
comparingForecastWithPrevSumm | comparingForecastWithPrevSumm(month: TotalBookingMonths, index: number) | string |
setValue | setValue(value: number) | void |
setForecastValue | setForecastValue(value: number) | void |
setMarginAvarage | setMarginAvarage(value: number) | void |
isForecast | isForecast(month: MonthData) | boolean |
isAchievedOrCurrent | isAchievedOrCurrent(month: MonthData) | boolean |
getpriceForecastAmount | getpriceForecastAmount(month: MonthData) | number |
expectedCurrencyChange | expectedCurrencyChange(e: undefined) | void |
Properties
| Property | Type |
|---|---|
_widget | Widget |
_widgetType | string |
withoutOptionBar | boolean |
bookingOrSales | number |
withNominal | boolean |
selectedTeam | number |
forecastRuleId | number |
allowedtoEdit | boolean |
allowedtoEnableEdting | boolean |
forecastRules | any[] |
selectedYear | number |
numYearsDatasource | any[] |
todayWidgetsEnum | any |
cachingWidgetData | CachingWidgetData |
data | BranchData[] |
originalData | BranchData[] |
singleMonths | MonthData |
branchCurrency | any |
basedOnTendency | boolean |
subscription | Subscription |
SeriseRange | any[] |
echartsIntance | any |
totalBookingMonths | TotalBookingMonths[] |
tempTotalMonth | TotalBookingMonths |
totalTargets | number |
yearBooking | number |
totalForecasts | number |
tempTotalTarget | TotalTargets |
Where it refuses work
MrmPmBacklogComponentstops the work with an early return whenmonth.MonthId == 12.MrmPmBacklogComponentstops the work with an early return whenmonth.TotalValue < this.data[bIndex].MrmBooking[index - 1].TotalValue.MrmPmBacklogComponentstops the work with an early return whenmonth.TotalBookingMonth < this.totalBookingMonths[index - 1].TotalBookingMonth.MrmPmBacklogComponentstops the work with an early return whenmonth.TotalForecastMonth < this.totalBookingMonths[index - 1].TotalForecastMonth.MrmPmBacklogComponentstops the work with an early return whenmonth.MonthId >= new Date().getMonth() + 1.MrmPmBacklogComponentstops the work with an early return whenmonth.MonthId <= new Date().getMonth() + 1.
Diagram
mermaidgraph LR Angular[Angular lifecycle] --> Init[ngOnInit] Angular --> Changes[ngOnChanges] Init --> Data[getDashboardData] Changes --> Data Data --> Initialize[initalizingData] Initialize --> Performance[calculatePerformancePer] Initialize --> Month[translateMonthName] Initialize --> Price[getpriceFormatted] Initialize --> Cache[setChaching] Resize[onResize] --> Initialize Destroy[ngOnDestroy] --> Cleanup[Release component resources]
Usage
tsimport { Component, ViewChild } from '@angular/core';
import { MrmPmBacklogComponent } from './mrm-pm-backlog.component';
@Component({
selector: 'app-dashboard-host',
template: `
<!-- Render MrmPmBacklogComponent in this dashboard view. -->
<button type="button" (click)="refreshBacklog()">Refresh backlog</button>
`
})
export class DashboardHostComponent {
@ViewChild(MrmPmBacklogComponent)
backlogComponent?: MrmPmBacklogComponent;
refreshBacklog(): void {
this.backlogComponent?.getDashboardData();
}
handleResize(): void {
this.backlogComponent?.onResize();
}
}
AI Coding Instructions
- Keep data loading within
getDashboardData()and pass returned data throughinitalizingData()before updating display state. - Preserve Angular lifecycle behavior: initialize data in
ngOnInit(), react to input updates inngOnChanges(), and release subscriptions or listeners inngOnDestroy(). - Keep the existing method names, including
initalizingData()andsetChaching(), unless all callers are updated together. - Recalculate displayed values through
calculatePerformancePer(),translateMonthName(), andgetpriceFormatted()rather than duplicating formatting logic in the template. - Route resize-driven layout or data updates through
onResize()and retain cache updates throughsetChaching().
Used by
2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (2)
TranslateHandler—Pams/Web/Pams.Web/Client/app/app.module.ts:1DashboardTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1
Was this page helpful?