Blame view

src/Table/Table.html 3.87 KB
3a3ecabe   Imshann   init
1
2
3
4
  <div className="ant-table-wrapper">
      <es-spin spinning="{{loading}}">
          <div className="ant-table ant-table-default">
              <div className="ant-table-content">
dd962f77   Imshann   优化
5
6
7
8
9
10
11
12
13
14
                  <table>
                      <thead className="ant-table-thead">
                          <tr>
                              {rowSelection &&<th className="ant-table-selection-column">
                                  <span className="ant-table-header-column">
                                      <div>
                                          <span className="ant-table-column-title">
                                              <div className="ant-table-selection">
                                                  <es-checkbox onChange={this.handleSelectAll.bind(this, event)}
                                                      checked={state.isSelectAll} />
3a3ecabe   Imshann   init
15
16
                                              </div>
                                          </span>
dd962f77   Imshann   优化
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
                                      </div>
                                  </span>
                              </th>}
                              {columns.map(function (column, key) {
                                  return <th className="ant-table-cell ant-table-column-has-sorters" key="key" style={{ width: column.width }}>
                                      {!column.sorter && <span>{column.title}</span>}
                                      {column.sorter && <div className="ant-table-column-sorters" onClick={this.handleSorter.bind(this, column.key)}>
                                          <span className="ant-table-column-title">{column.title}</span>
                                          <span className="ant-table-column-sorter ant-table-column-sorter-full">
                                              <span className="ant-table-column-sorter-inner">
                                                  <es-icon type="CaretUpOutlined" className={"ant-table-column-sorter-up"+(state.sorter.field===column.key&&state.sorter.order==="ascend"?" active":"")}></es-icon>
                                                  <es-icon type="CaretDownOutlined" className={"ant-table-column-sorter-down"+(state.sorter.field===column.key&&state.sorter.order==="descend"?" active":"")}></es-icon>
                                              </span>
                                          </span>
                                      </div>}
                                  </th>
3a3ecabe   Imshann   init
33
                              })}
dd962f77   Imshann   优化
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
                          </tr>
                      </thead>
                      <tbody className="ant-table-tbody">
                          {state.dataSource.map(function (record, key) {
                              return <tr className="ant-table-row" key="record[state.rowKey]">
                              {rowSelection && <td className="ant-table-selection-column">
                                  <span>
                                      <es-checkbox checked="record.checked" disabled="record.disabled"
                                          onChange={this.handleSelect.bind(this, event, $index)} />
                                  </span>
                              </td>}
                                  {columns.map(function (column, key) {
                                      return <td data-key="{{column.key}}" key="key">
                                          <es-slot content="{{record[column.key]}}" context="esTable.getContext().$parent" />
                                      </td>
                                  })}
                          </tr>
                          })}
                          {state.dataSource.length === 0 && <tr className="ant-table-placeholder">
1b6f912f   Imshann   优化
53
54
55
                              <td colspan={columns.length}>
                                  <es-empty image="presented_image_simple"></es-empty>
                              </td>
dd962f77   Imshann   优化
56
57
58
                          </tr>}
                      </tbody>
                  </table>
3a3ecabe   Imshann   init
59
60
61
62
              </div>
          </div>
      </es-spin>
  </div>