Commit ea845316 authored by chenshouchao's avatar chenshouchao

表格相关最小高度调整

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