|
1 | 1 | <nz-table #table |
2 | | - nzSize="small" |
3 | | - [nzData]="datum" |
4 | | - [nzLoading]="loading" |
5 | | - [nzShowPagination]="true" |
6 | | - [nzShowTotal]="totalTemplate" |
7 | | - [nzFrontPagination]="false" |
8 | | - [nzPageIndex]="pageIndex" |
9 | | - [nzPageSize]="pageSize" |
10 | | - [nzTotal]="total" |
11 | | - [nzShowQuickJumper]="true" |
12 | | - [nzShowSizeChanger]="true" |
13 | | - (nzQueryParams)="onQuery($event)"> |
| 2 | + nzSize="small" |
| 3 | + [nzData]="datum" |
| 4 | + [nzLoading]="loading" |
| 5 | + [nzShowPagination]="true" |
| 6 | + [nzShowTotal]="totalTemplate" |
| 7 | + [nzFrontPagination]="false" |
| 8 | + [nzPageIndex]="pageIndex" |
| 9 | + [nzPageSize]="pageSize" |
| 10 | + [nzPageSizeOptions]="[10,20,50,100,500,1000]" |
| 11 | + (nzPageSizeChange)="onPageSizeChange($event)" |
| 12 | + [nzTotal]="total" |
| 13 | + [nzShowQuickJumper]="true" |
| 14 | + [nzShowSizeChanger]="true" |
| 15 | + (nzQueryParams)="onQuery($event)"> |
14 | 16 | <thead> |
15 | | - <tr> |
16 | | - @for (item of columns; track item) { |
17 | | - <th |
18 | | - [nzColumnKey]="item.key" |
19 | | - [nzShowSort]="item.sortable" |
20 | | - [nzSortFn]="true" |
21 | | - [nzShowFilter]="!!item.filter" |
22 | | - [nzFilterFn]="true" |
23 | | - [nzFilters]="item.filter || []"> |
24 | | - {{ item.label }} |
25 | | - </th> |
26 | | - } |
27 | | - @if (operators && operators.length) { |
28 | | - <th>操作</th> |
29 | | - } |
30 | | - </tr> |
| 17 | + <tr> |
| 18 | + @if (batch) { |
| 19 | + <th |
| 20 | + [nzChecked]="true" |
| 21 | + [nzIndeterminate]="indeterminate" |
| 22 | + (nzCheckedChange)="onAllChecked($event)"> |
| 23 | + </th> |
| 24 | + } |
| 25 | + @for (item of columns; track item) { |
| 26 | + <th |
| 27 | + [nzColumnKey]="item.key" |
| 28 | + [nzShowSort]="item.sortable" |
| 29 | + [nzSortFn]="true" |
| 30 | + [nzShowFilter]="!!item.filter" |
| 31 | + [nzFilterFn]="true" |
| 32 | + [nzFilters]="item.filter || []"> |
| 33 | + {{ item.label }} |
| 34 | + </th> |
| 35 | + } |
| 36 | + @if (operators && operators.length) { |
| 37 | + <th>操作</th> |
| 38 | + } |
| 39 | + </tr> |
31 | 40 | </thead> |
32 | 41 | <tbody> |
33 | 42 | @for (data of table.data; track data; let i = $index) { |
34 | 43 | <tr> |
| 44 | + @if (batch) { |
| 45 | + <td |
| 46 | + [nzChecked]="selects.has(data.id)" |
| 47 | + [nzLabel]="data.name" |
| 48 | + (nzCheckedChange)="onItemChecked(data.id, $event)" |
| 49 | + ></td> |
| 50 | + } |
35 | 51 | @for (item of columns; track item) { |
36 | 52 | <td [nzEllipsis]="item.ellipsis" [nzBreakWord]="item.break"> |
37 | 53 | @switch (item.type) { |
|
86 | 102 | <span class="operator"> |
87 | 103 | @if (o.confirm) { |
88 | 104 | <a [title]="o.title||''" nz-popconfirm [nzPopconfirmTitle]="o.confirm" |
89 | | - (nzOnConfirm)="action.emit({action:o.action, data:data, index: i})"> |
| 105 | + (nzOnConfirm)="action.emit({action:o.action, data:data, index: i})"> |
90 | 106 | @if (o.icon) { |
91 | 107 | <i nz-icon [nzType]="o.icon"></i> |
92 | | - }{{ o.label }} |
| 108 | + }{{ o.label }} |
93 | 109 | </a> |
94 | | - } @else { |
95 | | - <a [title]="o.title||''" (click)="action.emit({action:o.action, data:data, index: i})"> |
| 110 | + } @else { |
| 111 | + <a [title]="o.title||''" (click)="action.emit({action:o.action, data:data, index: i})"> |
96 | 112 | @if (o.icon) { |
97 | 113 | <i nz-icon [nzType]="o.icon"></i> |
98 | | - }{{ o.label }} |
| 114 | + }{{ o.label }} |
99 | 115 | </a> |
100 | | - } |
101 | | - </span> |
102 | 116 | } |
103 | | - </td> |
| 117 | + </span> |
104 | 118 | } |
105 | | - </tr> |
| 119 | + </td> |
106 | 120 | } |
107 | | - </tbody> |
108 | | - </nz-table> |
| 121 | + </tr> |
| 122 | + } |
| 123 | + </tbody> |
| 124 | +</nz-table> |
109 | 125 |
|
110 | | - <ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
| 126 | +<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template> |
0 commit comments