Table.html 3.35 KB
<div class="ant-table-wrapper">
    <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 ng-if="!rowSelection.hideSelectAll" class="ant-table-header-column">
                                <div>
                                    <span class="ant-table-column-title">
                                        <div class="ant-table-selection">
                                            <antd-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">
                                            <antd-icon type="CaretUpOutlined" ng-class="'ant-table-column-sorter-up'+(state.sorter.field===column.key&&state.sorter.order==='ascend'?' active':'')"></antd-icon>
                                            <antd-icon type="CaretDownOutlined" ng-class="'ant-table-column-sorter-down'+(state.sorter.field===column.key&&state.sorter.order==='descend'?' active':'')"></antd-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]+'-'+$index" class="ant-table-row">
                        <td ng-if="rowSelection" class="ant-table-selection-column">
                            <span>
                                <antd-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}}">
                                    <antd-slot content="{{record[column.key]}}" context="antdTable.getContext().$parent" />
                                </td>
                    </tr>
                    <tr ng-if="state.dataSource.length===0" class="ant-table-placeholder">
                        <td colspan="{{rowSelection?columns.length+1:columns.length}}">
                            <antd-empty image="presented_image_simple"></antd-empty>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>