ng-environment-setup
Version:
ng environment setup
133 lines (132 loc) • 6 kB
HTML
<!-- ng-zorro-antd version 9.0.0 -->
<nz-table
class="page-table"
[]="tableData.data || []"
[]="tableData.frontPagination || true"
[]="tableData.total"
[(nzPageIndex)]="tableData.pageIndex"
[(nzPageSize)]="tableData.pageSize"
[]="tableData.showPagination || true"
[]="tableData.paginationPosition || 'bottom'"
[]="tableData.bordered || false"
[]="tableData.widthConfig || []"
[]="tableData.size || 'default'"
[]="tableData.loading || false"
[]="tableData.loadingIndicator"
[]="tableData.loadingDelay || 0"
[]="tableData.scroll"
[]="tableData.title"
[]="tableData.footer"
[]="tableData.noResult"
[]="tableData.pageSizeOptions || [ 10, 20, 30, 40, 50 ]"
[]="tableData.showQuickJumper || false"
[]="tableData.showSizeChanger || false"
[]="tableData.showTotal || total"
[]="tableData.itemRender"
[]="tableData.hideOnSinglePage || false"
[]="tableData.simple"
[]="tableData.virtualItemSize || 0"
[]="tableData.virtualMaxBufferPx || 200"
[]="tableData.virtualMinBufferPx || 100"
[]="tableData.virtualForTrackBy"
(nzPageIndexChange)="indexChange($event)"
(nzPageSizeChange)="sizeChange($event)"
(nzCurrentPageDataChange)="dataChange($event)"
(nzQueryParams)="params($event)">
<ng-template
<span class="color-999 mg-r8">共{{tableData.data.length}}条</span>
</ng-template>
<thead>
<tr *ngFor="let columns of tableColumns">
<ng-container *ngFor="let c of columns">
<th
*ngIf="c.thShowCheckbox"
[]="c.check ? !!(tableData.data.length) : c.thShowCheckbox"
[]="c.thDisabled"
[]="c.check ? checkData.hasChecked : c.thIndeterminate"
[(nzChecked)]="c.check ? checkData.allChecked : c.thChecked"
(nzCheckedChange)="c.check ? checkAll($event) : c.thCheckedChange($event)"
[]="c.check ? !!(tableData.data.length) : c.showRowSelection"
[]="c.check ? checkData.selection : c.selections"
[]="c.width"
[]="c.left || false"
[]="c.right || false"
[]="c.align"
[]="c.breakWord || false"
[]="c.ellipsis || false"
[]="[c.thClass || '']"
[]="c.colspan"
[]="c.rowspan">
<ng-container *ngTemplateOutlet="c.thTemplate ? customTpl : thTpl; context: { $implicit: c, type: 'th' }"></ng-container>
<ng-template
<span [innerHtml]="c.thRender ? sanitize.bypassSecurityTrustHtml(c.thRender(c)) : c.label"></span>
</ng-template>
</th>
<th
*ngIf="!c.showCheckbox"
[]="c.showSort"
[]="c.sortFn"
[]="c.sortDirections || ['ascend', 'descend', null]"
[(nzSortOrder)]="c.sortOrder"
(nzSortOrderChange)="c.sortOrderChange($event)"
[]="c.showFilter"
[]="c.filterFn"
[]="c.filters"
[]="c.filterMultiple || true"
(nzFilterChange)="c.filterChange($event)"
[]="c.width"
[]="c.left || false"
[]="c.right || false"
[]="c.align"
[]="c.breakWord || false"
[]="c.ellipsis || false"
[]="c.columnKey"
[]="[c.thClass || '']"
[]="c.colspan"
[]="c.rowspan">
<ng-container *ngTemplateOutlet="c.thTemplate ? customTpl : thTpl; context: { $implicit: c, type: 'th' }"></ng-container>
<ng-template
<span [innerHtml]="c.thRender ? sanitize.bypassSecurityTrustHtml(c.thRender(c)) : c.label"></span>
</ng-template>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let item of tableData.data">
<tr
[]="tableData.active === item.id"
(click)="changeActive(item.id)">
<td
*ngFor="let c of realColumns"
[]="c.check || c.showCheckbox"
[]="c.disabled"
[]="c.indeterminate"
[(nzChecked)]="c.check ? checkData.ids[item.id] : c.checked"
(nzCheckedChange)="c.check ? refreshStatus() : c.checkedChange($event)"
[]="c.showExpand"
[(nzExpand)]="c.expand"
(nzExpandChange)="c.expandChange($event)"
[]="c.left || false"
[]="c.right || false"
[]="c.align"
[]="c.breakWord || false"
[]="c.ellipsis || false"
[]="c.indentSize"
[]="[c.class || '']">
<ng-container *ngTemplateOutlet="c.template ? customTpl : tdTpl; context: { $implicit: item, column: c, type: 'td' }"></ng-container>
<ng-template
<span [innerHtml]="c.render ? sanitize.bypassSecurityTrustHtml(c.render(item)) : item[c.value]"></span>
</ng-template>
</td>
</tr>
<tr [nzExpand]="item.expand || item.nzExpand">
<ng-container *ngTemplateOutlet="item.expandTemplate ? customTpl : expandTpl; context: { $implicit: item, type: 'expand' }"></ng-container>
<ng-template
<span [innerHtml]="item.expandRender ? sanitize.bypassSecurityTrustHtml(item.expandRender(item)) : item.expandText"></span>
</ng-template>
</tr>
</ng-container>
</tbody>
</nz-table>