diff --git a/src/table/_example/pagination.jsx b/src/table/_example/pagination.jsx index 36d0163bf..c6f2e29d0 100644 --- a/src/table/_example/pagination.jsx +++ b/src/table/_example/pagination.jsx @@ -9,7 +9,7 @@ const statusNameListMap = { }; const data = []; -const total = 60; +const total = 59; for (let i = 0; i < total; i++) { data.push({ index: i, @@ -26,6 +26,7 @@ for (let i = 0; i < total; i++) { } const columns = [ + { colKey: 'serial-number', width: 80, title: '序号' }, { colKey: 'applicant', title: '申请人', width: '100' }, { colKey: 'status', @@ -42,7 +43,7 @@ const columns = [ }, }, { colKey: 'channel', title: '签署方式', width: '120' }, - { colKey: 'detail.email', title: '邮箱地址', ellipsis: true }, + // { colKey: 'detail.email', title: '邮箱地址', ellipsis: true }, { colKey: 'createTime', title: '申请时间' }, { colKey: 'row-select', type: 'multiple', width: 46 }, ]; @@ -50,6 +51,8 @@ const columns = [ export default function TableBasic() { const [reserveSelectedRowOnPaginate, setReserveSelectedRowOnPaginate] = useState(true); const [selectedRowKeys, setSelectedRowKeys] = useState([]); + // const [current, setCurrent] = useState(2); + // const [pageSize, setPageSize] = useState(5); return ( diff --git a/src/table/hooks/usePagination.tsx b/src/table/hooks/usePagination.tsx index 6f2fc533f..31caae0da 100644 --- a/src/table/hooks/usePagination.tsx +++ b/src/table/hooks/usePagination.tsx @@ -53,12 +53,7 @@ export default function usePagination(props: TdBaseTableProps) { onChange={(pageInfo: PageInfo) => { props.pagination?.onChange?.(pageInfo); setInnerPagination(pageInfo); - let newData = dataSource; - // 如果是非受控情况的分页变化,还需更新分页数据(data) - if (pagination && !pagination.current && pagination.defaultCurrent) { - newData = updateDataSourceAndPaginate(pageInfo.current, pageInfo.pageSize); - } - // TODO: dataSource + const newData = updateDataSourceAndPaginate(pageInfo.current, pageInfo.pageSize); props.onPageChange?.(pageInfo, newData); }} /> diff --git a/test/snap/__snapshots__/csr.test.jsx.snap b/test/snap/__snapshots__/csr.test.jsx.snap index 281f69dc2..8ac456852 100644 --- a/test/snap/__snapshots__/csr.test.jsx.snap +++ b/test/snap/__snapshots__/csr.test.jsx.snap @@ -229629,6 +229629,9 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` class="t-table--layout-fixed" > + @@ -229641,9 +229644,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` - @@ -229652,6 +229652,16 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` class="t-table__header" > + +
+ 序号 +
+ csr test src/table/_example/pagination.jsx 1`] = ` 签署方式 - -
-
- 邮箱地址 -
-
- csr test src/table/_example/pagination.jsx 1`] = ` + + 6 + @@ -229769,15 +229770,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 纸质签署 - -
- p.cumx@rampblpa.ru -
- @@ -229803,6 +229795,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 7 + @@ -229837,15 +229834,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 电子签署 - -
- w.cezkdudy@lhll.au -
- @@ -229871,6 +229859,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 8 + @@ -229905,15 +229898,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 纸质签署 - -
- r.nmgw@peurezgn.sl -
- @@ -229939,6 +229923,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 9 + @@ -229973,15 +229962,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 纸质签署 - -
- p.cumx@rampblpa.ru -
- @@ -230007,6 +229987,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 10 + @@ -230041,15 +230026,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 电子签署 - -
- w.cezkdudy@lhll.au -
- @@ -230088,7 +230064,7 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = `
- Total 60 items + Total 59 items
csr test src/table/_example/pagination.jsx 1`] = ` class="t-table--layout-fixed" > + @@ -230358,9 +230337,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` - @@ -230369,6 +230345,16 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` class="t-table__header" > + +
+ 序号 +
+ csr test src/table/_example/pagination.jsx 1`] = ` 签署方式
- -
-
- 邮箱地址 -
-
- csr test src/table/_example/pagination.jsx 1`] = ` + + 6 + @@ -230486,15 +230463,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 纸质签署 - -
- p.cumx@rampblpa.ru -
- @@ -230520,6 +230488,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 7 + @@ -230554,15 +230527,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 电子签署 - -
- w.cezkdudy@lhll.au -
- @@ -230588,6 +230552,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 8 + @@ -230622,15 +230591,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 纸质签署 - -
- r.nmgw@peurezgn.sl -
- @@ -230656,6 +230616,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 9 + @@ -230690,15 +230655,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 纸质签署 - -
- p.cumx@rampblpa.ru -
- @@ -230724,6 +230680,11 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` + + 10 + @@ -230758,15 +230719,6 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = ` > 电子签署 - -
- w.cezkdudy@lhll.au -
- @@ -230805,7 +230757,7 @@ exports[`csr snapshot test > csr test src/table/_example/pagination.jsx 1`] = `
- Total 60 items + Total 59 items