mirror of https://github.com/abpframework/abp.git
2 changed files with 80 additions and 49 deletions
@ -1,46 +1,64 @@ |
|||||
<div class="abp-lookup-container position-relative"> |
<div class="abp-lookup-container position-relative"> |
||||
@if (label()) { |
@if (label()) { |
||||
<label class="form-label">{{ label() | abpLocalization }}</label> |
<label class="form-label">{{ label() | abpLocalization }}</label> |
||||
} |
} |
||||
|
|
||||
<div class="input-group"> |
<div class="input-group"> |
||||
<input type="text" class="form-control" [placeholder]="placeholder() | abpLocalization" |
<input |
||||
[ngModel]="displayValue()" (ngModelChange)="onSearchInput($event)" (focus)="onSearchFocus()" |
type="text" |
||||
(blur)="onSearchBlur($event)" [disabled]="disabled()" /> |
class="form-control" |
||||
@if (displayValue() && !disabled()) { |
[placeholder]="placeholder() | abpLocalization" |
||||
<button type="button" class="btn btn-outline-secondary" (mousedown)="clearSelection()" tabindex="-1"> |
[ngModel]="displayValue()" |
||||
<i class="fa fa-times"></i> |
(ngModelChange)="onSearchInput($event)" |
||||
</button> |
(focus)="onSearchFocus()" |
||||
} |
(blur)="onSearchBlur($event)" |
||||
</div> |
[disabled]="disabled()" |
||||
|
/> |
||||
|
@if (displayValue() && !disabled()) { |
||||
|
<button |
||||
|
type="button" |
||||
|
class="btn btn-outline-secondary" |
||||
|
(mousedown)="clearSelection()" |
||||
|
tabindex="-1" |
||||
|
> |
||||
|
<i class="fa fa-times"></i> |
||||
|
</button> |
||||
|
} |
||||
|
</div> |
||||
|
|
||||
@if (showDropdown() && !disabled()) { |
@if (showDropdown() && !disabled()) { |
||||
<div class="abp-lookup-dropdown list-group position-absolute w-100 shadow" |
<div |
||||
style="z-index: 1050; max-height: 200px; overflow-y: auto;"> |
class="abp-lookup-dropdown list-group position-absolute w-100 shadow" |
||||
@if (isLoading()) { |
style="z-index: 1050; max-height: 200px; overflow-y: auto" |
||||
|
> |
||||
|
@if (isLoading()) { |
||||
<div class="list-group-item text-center py-3"> |
<div class="list-group-item text-center py-3"> |
||||
<i class="fa fa-spinner fa-spin me-2"></i> |
<i class="fa fa-spinner fa-spin me-2"></i> |
||||
{{ 'AbpUi::Loading' | abpLocalization }} |
{{ 'AbpUi::Loading' | abpLocalization }} |
||||
</div> |
</div> |
||||
} @else if (searchResults().length > 0) { |
} @else if (searchResults().length > 0) { |
||||
@for (item of searchResults(); track item.key) { |
@for (item of searchResults(); track item.key) { |
||||
<button type="button" class="list-group-item list-group-item-action" (mousedown)="selectItem(item)"> |
<button |
||||
|
type="button" |
||||
|
class="list-group-item list-group-item-action" |
||||
|
(mousedown)="selectItem(item)" |
||||
|
> |
||||
@if (itemTemplate()) { |
@if (itemTemplate()) { |
||||
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item }"></ng-container> |
<ng-container *ngTemplateOutlet="itemTemplate()!; context: { $implicit: item }" /> |
||||
} @else { |
} @else { |
||||
{{ getDisplayValue(item) }} |
{{ getDisplayValue(item) }} |
||||
} |
} |
||||
</button> |
</button> |
||||
} |
} |
||||
} @else if (displayValue()) { |
} @else if (displayValue()) { |
||||
@if (noResultsTemplate()) { |
@if (noResultsTemplate()) { |
||||
<ng-container *ngTemplateOutlet="noResultsTemplate()!"></ng-container> |
<ng-container *ngTemplateOutlet="noResultsTemplate()!" /> |
||||
} @else { |
} @else { |
||||
<div class="list-group-item text-muted"> |
<div class="list-group-item text-muted"> |
||||
{{ 'AbpUi::NoRecordsFound' | abpLocalization }} |
{{ 'AbpUi::NoRecordsFound' | abpLocalization }} |
||||
</div> |
</div> |
||||
} |
|
||||
} |
} |
||||
|
} |
||||
</div> |
</div> |
||||
} |
} |
||||
</div> |
</div> |
||||
|
|||||
@ -1,28 +1,41 @@ |
|||||
<div class="d-grid gap-2 mb-3 d-md-flex justify-content-md-end"> |
<div class="d-grid gap-2 mb-3 d-md-flex justify-content-md-end"> |
||||
<button class="btn btn-sm btn-primary" type="button" (click)="addClicked.emit()"> |
<button class="btn btn-sm btn-primary" type="button" (click)="addClicked.emit()"> |
||||
<i class="fa fa-plus me-1"></i> |
<i class="fa fa-plus me-1"></i> |
||||
{{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }} |
{{ 'AbpPermissionManagement::AddResourcePermission' | abpLocalization }} |
||||
</button> |
</button> |
||||
</div> |
</div> |
||||
|
|
||||
<ng-template #actionsTemplate let-row> |
<ng-template #actionsTemplate let-row> |
||||
<div class="btn-group btn-group-sm" role="group"> |
<div class="btn-group btn-group-sm" role="group"> |
||||
<button class="btn btn-outline-primary" type="button" (click)="editClicked.emit(row)" |
<button |
||||
[title]="'AbpUi::Edit' | abpLocalization"> |
class="btn btn-outline-primary" |
||||
<i class="fa fa-edit"></i> |
type="button" |
||||
</button> |
(click)="editClicked.emit(row)" |
||||
<button class="btn btn-outline-danger" type="button" (click)="deleteClicked.emit(row)" |
[title]="'AbpUi::Edit' | abpLocalization" |
||||
[title]="'AbpUi::Delete' | abpLocalization"> |
> |
||||
<i class="fa fa-trash"></i> |
<i class="fa fa-edit"></i> |
||||
</button> |
</button> |
||||
</div> |
<button |
||||
|
class="btn btn-outline-danger" |
||||
|
type="button" |
||||
|
(click)="deleteClicked.emit(row)" |
||||
|
[title]="'AbpUi::Delete' | abpLocalization" |
||||
|
> |
||||
|
<i class="fa fa-trash"></i> |
||||
|
</button> |
||||
|
</div> |
||||
</ng-template> |
</ng-template> |
||||
|
|
||||
@if (state.resourcePermissions().length > 0) { |
@if (state.resourcePermissions().length > 0) { |
||||
<abp-extensible-table [data]="state.resourcePermissions()" [recordsTotal]="state.totalCount()" [list]="list" |
<abp-extensible-table |
||||
[actionsTemplate]="actionsTemplate" actionsText="AbpUi::Actions"></abp-extensible-table> |
[data]="state.resourcePermissions()" |
||||
|
[recordsTotal]="state.totalCount()" |
||||
|
[list]="list" |
||||
|
[actionsTemplate]="actionsTemplate" |
||||
|
actionsText="AbpUi::Actions" |
||||
|
/> |
||||
} @else { |
} @else { |
||||
<div class="alert alert-info"> |
<div class="alert alert-info"> |
||||
{{ 'AbpPermissionManagement::NoPermissionsAssigned' | abpLocalization }} |
{{ 'AbpPermissionManagement::NoPermissionsAssigned' | abpLocalization }} |
||||
</div> |
</div> |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue