|
|
@ -14,7 +14,7 @@ import { |
|
|
TemplateRef, |
|
|
TemplateRef, |
|
|
TrackByFunction, |
|
|
TrackByFunction, |
|
|
} from '@angular/core'; |
|
|
} from '@angular/core'; |
|
|
import { AsyncPipe, formatDate, NgComponentOutlet, NgTemplateOutlet } from '@angular/common'; |
|
|
import { AsyncPipe, NgComponentOutlet, NgTemplateOutlet } from '@angular/common'; |
|
|
|
|
|
|
|
|
import { Observable, filter, map } from 'rxjs'; |
|
|
import { Observable, filter, map } from 'rxjs'; |
|
|
|
|
|
|
|
|
@ -24,13 +24,11 @@ import { NgxDatatableModule } from '@swimlane/ngx-datatable'; |
|
|
import { |
|
|
import { |
|
|
ABP, |
|
|
ABP, |
|
|
ConfigStateService, |
|
|
ConfigStateService, |
|
|
getShortDateFormat, |
|
|
|
|
|
getShortDateShortTimeFormat, |
|
|
|
|
|
getShortTimeFormat, |
|
|
|
|
|
ListService, |
|
|
ListService, |
|
|
LocalizationModule, |
|
|
LocalizationModule, |
|
|
PermissionDirective, |
|
|
PermissionDirective, |
|
|
PermissionService, |
|
|
PermissionService, |
|
|
|
|
|
TimezoneService, |
|
|
UtcToLocalPipe, |
|
|
UtcToLocalPipe, |
|
|
} from '@abp/ng.core'; |
|
|
} from '@abp/ng.core'; |
|
|
import { |
|
|
import { |
|
|
@ -79,6 +77,7 @@ export class ExtensibleTableComponent<R = any> implements OnChanges, AfterViewIn |
|
|
protected readonly cdr = inject(ChangeDetectorRef); |
|
|
protected readonly cdr = inject(ChangeDetectorRef); |
|
|
protected readonly locale = inject(LOCALE_ID); |
|
|
protected readonly locale = inject(LOCALE_ID); |
|
|
protected readonly config = inject(ConfigStateService); |
|
|
protected readonly config = inject(ConfigStateService); |
|
|
|
|
|
protected readonly timeZoneService = inject(TimezoneService); |
|
|
protected readonly entityPropTypeClasses = inject(ENTITY_PROP_TYPE_CLASSES); |
|
|
protected readonly entityPropTypeClasses = inject(ENTITY_PROP_TYPE_CLASSES); |
|
|
protected readonly permissionService = inject(PermissionService); |
|
|
protected readonly permissionService = inject(PermissionService); |
|
|
|
|
|
|
|
|
@ -136,10 +135,6 @@ export class ExtensibleTableComponent<R = any> implements OnChanges, AfterViewIn |
|
|
(this.columnWidths as any) = widths; |
|
|
(this.columnWidths as any) = widths; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private getDate(value: Date | undefined, format: string | undefined) { |
|
|
|
|
|
return value && format ? formatDate(value, format, this.locale) : ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private getIcon(value: boolean) { |
|
|
private getIcon(value: boolean) { |
|
|
return value |
|
|
return value |
|
|
? '<div class="text-success"><i class="fa fa-check" aria-hidden="true"></i></div>' |
|
|
? '<div class="text-success"><i class="fa fa-check" aria-hidden="true"></i></div>' |
|
|
@ -158,12 +153,6 @@ export class ExtensibleTableComponent<R = any> implements OnChanges, AfterViewIn |
|
|
switch (prop.type) { |
|
|
switch (prop.type) { |
|
|
case ePropType.Boolean: |
|
|
case ePropType.Boolean: |
|
|
return this.getIcon(value); |
|
|
return this.getIcon(value); |
|
|
case ePropType.Date: |
|
|
|
|
|
return this.getDate(value, getShortDateFormat(this.config)); |
|
|
|
|
|
case ePropType.Time: |
|
|
|
|
|
return this.getDate(value, getShortTimeFormat(this.config)); |
|
|
|
|
|
case ePropType.DateTime: |
|
|
|
|
|
return this.getDate(value, getShortDateShortTimeFormat(this.config)); |
|
|
|
|
|
case ePropType.Enum: |
|
|
case ePropType.Enum: |
|
|
return this.getEnum(value, prop.enumList || []); |
|
|
return this.getEnum(value, prop.enumList || []); |
|
|
default: |
|
|
default: |
|
|
|