公共表格组件-title传null隐藏头部显示
This commit is contained in:
@@ -1,4 +1,14 @@
|
|||||||
<nz-card nzSize="small" [nzExtra]="refresh" [nzTitle]="cardTitle" [nzLoading]="loading">
|
<nz-card *ngIf="cardTitle" nzSize="small" [nzExtra]="refresh" [nzTitle]="cardTitle" [nzLoading]="loading">
|
||||||
|
<ng-container *ngTemplateOutlet="table"></ng-container>
|
||||||
|
</nz-card>
|
||||||
|
|
||||||
|
<ng-container [ngTemplateOutlet]="table" *ngIf="!cardTitle"></ng-container>
|
||||||
|
|
||||||
|
<ng-template #refresh>
|
||||||
|
<i nz-icon nzType="reload" nzTheme="outline" (click)="getData()" title="刷新" style="cursor: pointer"></i>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #table>
|
||||||
<nz-table nzTableLayout="fixed"
|
<nz-table nzTableLayout="fixed"
|
||||||
[nzData]="dataList.list"
|
[nzData]="dataList.list"
|
||||||
[nzTotal]="dataList.total"
|
[nzTotal]="dataList.total"
|
||||||
@@ -57,9 +67,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</nz-table>
|
</nz-table>
|
||||||
</nz-card>
|
|
||||||
|
|
||||||
|
|
||||||
<ng-template #refresh>
|
|
||||||
<i nz-icon nzType="reload" nzTheme="outline" (click)="getData()" title="刷新" style="cursor: pointer"></i>
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
|
|||||||
*/
|
*/
|
||||||
@Input() headData: Data<T>[];
|
@Input() headData: Data<T>[];
|
||||||
@Input() request: RequestObj;
|
@Input() request: RequestObj;
|
||||||
@Input() cardTitle: string;
|
@Input() cardTitle: string | null;
|
||||||
@Input() template: {
|
@Input() template: {
|
||||||
[fieldValue: string]: {
|
[fieldValue: string]: {
|
||||||
temp: TemplateRef<any>,
|
temp: TemplateRef<any>,
|
||||||
|
|||||||
Reference in New Issue
Block a user