Table.html
3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<div class="ant-table-wrapper">
<es-spin spinning="{{loading}}">
<div ng-class="'ant-table ant-table-'+state.size">
<div class="ant-table-content">
<table>
<thead class="ant-table-thead">
<tr>
<th ng-if="rowSelection" class="ant-table-selection-column">
<span class="ant-table-header-column">
<div>
<span class="ant-table-column-title">
<div class="ant-table-selection">
<es-checkbox on-change="handleSelectAll(event)" checked="{{state.isSelectAll}}" />
</div>
</span>
</div>
</span>
</th>
<th ng-repeat="(key, column) in columns track by key" class="ant-table-cell ant-table-column-has-sorters" ng-style="{width:column.width}">
<span ng-if="!column.sorter">{{column.title}}</span>
<div ng-if="column.sorter" class="ant-table-column-sorters" ng-click="handleSorter(column.key)">
<span class="ant-table-column-title">{{column.title}}</span>
<span class="ant-table-column-sorter ant-table-column-sorter-full">
<span class="ant-table-column-sorter-inner">
<es-icon type="CaretUpOutlined" ng-class="'ant-table-column-sorter-up'+(state.sorter.field===column.key&&state.sorter.order==='ascend'?' active':'')"></es-icon>
<es-icon type="CaretDownOutlined" ng-class="'ant-table-column-sorter-down'+(state.sorter.field===column.key&&state.sorter.order==='descend'?' active':'')"></es-icon>
</span>
</span>
</div>
</th>
</tr>
</thead>
<tbody class="ant-table-tbody">
<tr ng-repeat="(key, record) in state.dataSource track by record[state.rowKey]" class="ant-table-row">
<td ng-if="rowSelection" class="ant-table-selection-column">
<span>
<es-checkbox checked="record.checked" disabled="record.disabled" on-change="handleSelect(event,$index)" />
</span>
</td>
<td ng-repeat="(key, column) in columns track by key" data-key="{{column.key}}">
<es-slot content="{{record[column.key]}}" context="esTable.getContext().$parent" />
</td>
</tr>
<tr ng-if="state.dataSource.length===0" class="ant-table-placeholder">
<td colspan="{{rowSelection?columns.length+1:columns.length}}">
<es-empty image="presented_image_simple"></es-empty>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</es-spin>
</div>