Commit ea845316 authored by chenshouchao's avatar chenshouchao

表格相关最小高度调整

parent af42433b
......@@ -120,7 +120,7 @@ const MyTable = (props: IMyTableProps) => {
MuiPaper: {
styleOverrides: {
root: {
minHeight: "200px",
// minHeight: "200px",
position: "relative",
"&.MuiTableContainer-root": {
boxShadow: "none",
......@@ -142,6 +142,7 @@ const MyTable = (props: IMyTableProps) => {
MuiTableBody: {
styleOverrides: {
root: {
minHeight: "200px",
position: "relative",
"& .MuiTableRow-root:nth-last-of-type(1) .MuiTableCell-root": {
// 有分页的话 表格最后一行就不要下边框
......@@ -316,7 +317,13 @@ const MyTable = (props: IMyTableProps) => {
const randerTableBody = useMemo(() => {
if (rows.length === 0) {
if (loading) {
return null;
return (
<tbody>
<tr>
<td></td>
</tr>
</tbody>
);
}
return (
<tbody>
......@@ -437,7 +444,7 @@ const MyTable = (props: IMyTableProps) => {
<ThemeProvider theme={theme}>
{!fixedHead && (
<>
<TableContainer component={Paper}>
<TableContainer component={Paper} sx={{ minHeight: "200px" }}>
{randerCircularProgress}
<Table>
{randerTableHead}
......@@ -456,10 +463,13 @@ const MyTable = (props: IMyTableProps) => {
position: "relative",
}}
>
<TableContainer component={Paper}>
<TableContainer component={Paper} sx={{ minHeight: "45px" }}>
<Table>{randerTableHead}</Table>
</TableContainer>
<TableContainer component={Paper} sx={{ flex: 1 }}>
<TableContainer
component={Paper}
sx={{ flex: 1, minHeight: "200px" }}
>
<Table>{randerTableBody}</Table>
</TableContainer>
{randerTableFooter}
......
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