Commit d52e5b78 authored by XieZhiXiong's avatar XieZhiXiong

chore: 完善逻辑

parent 9a224de3
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-08-20 16:15:59
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-16 11:45:36
* @LastEditTime: 2021-07-28 17:39:18
* @Description: 可以带查询的表格,内置 formily,如果需要其他Form可以传入 customRenderSearchForm 配合 reload() 实现查询
*/
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
......@@ -90,6 +90,7 @@ const NormalTable: React.ForwardRefRenderFunction<NormalTableRefHandleType, Norm
return {
...prevState,
data: props.dataSource as T[],
totalCount: props.dataSource.length,
}
});
}
......@@ -141,7 +142,7 @@ const NormalTable: React.ForwardRefRenderFunction<NormalTableRefHandleType, Norm
reload,
}));
const totalCount = tableData.totalCount || pagination?.total || 0;
const totalCount = pagination?.total || tableData.totalCount || 0;
const paginationProps: PaginationProps = pagination ? {
current: current,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment