Commit af103dad authored by chenshouchao's avatar chenshouchao

feat: 修改表格样式 达到和样式稿一致的效果

parent 8c142a1b
...@@ -90,7 +90,9 @@ export default function EnhancedTable(props) { ...@@ -90,7 +90,9 @@ export default function EnhancedTable(props) {
return ( return (
<div className={classes.root}> <div className={classes.root}>
<Paper className={classes.paper} classes={{ elevation1: elevation1 || classes.elevation1 }} > <Paper sx={{
boxShadow: 'none'
}} className={classes.paper} classes={{ elevation1: elevation1 || classes.elevation1 }} >
{/* <Spin spin={spin} /> */} {/* <Spin spin={spin} /> */}
{toolbar && toolbar} {toolbar && toolbar}
<TableContainer style={{ ...tableContainerStyle }}> <TableContainer style={{ ...tableContainerStyle }}>
...@@ -111,6 +113,9 @@ export default function EnhancedTable(props) { ...@@ -111,6 +113,9 @@ export default function EnhancedTable(props) {
{ {
(rows.length === 0 && !load) && <TableRow> (rows.length === 0 && !load) && <TableRow>
<TableCell <TableCell
sx={{
borderBottom: '1px solid #F0F2F5'
}}
colSpan={headCells?.filter(k => k.id === "checkbox")?.length === 0 ? headCells?.length : headCells?.length + 1} colSpan={headCells?.filter(k => k.id === "checkbox")?.length === 0 ? headCells?.length : headCells?.length + 1}
className={classes.TypographyStyle} className={classes.TypographyStyle}
style={{ minHeight: minHeight, height: minHeight, borderBottom: borderBottom ,padding:TableNodataPadding,lineHeight:TableNodataLineHeight}} style={{ minHeight: minHeight, height: minHeight, borderBottom: borderBottom ,padding:TableNodataPadding,lineHeight:TableNodataLineHeight}}
...@@ -143,19 +148,25 @@ export default function EnhancedTable(props) { ...@@ -143,19 +148,25 @@ export default function EnhancedTable(props) {
> >
{ {
headCells.filter(k => k.id === "checkbox").length > 0 && <TableCell headCells.filter(k => k.id === "checkbox").length > 0 && <TableCell
sx={{
borderBottom: '1px solid #F0F2F5'
}}
onClick={(event) => { onClick={(event) => {
// if (!row[disabledparam]) return; // if (!row[disabledparam]) return;
onRowClick && onRowClickDefault(row[param || "id"]) onRowClick && onRowClickDefault(row[param || "id"])
headCells.filter(k => k.id === "checkbox").length > 0 && handleClick(event, row[param || "id"]) headCells.filter(k => k.id === "checkbox").length > 0 && handleClick(event, row[param || "id"])
}} }}
padding="checkbox"> padding="checkbox">
<Checkbox color={"primary"} checked={isItemSelected} inputProps={{ "aria-labelledby": labelId }} /> <Checkbox sx={{ color: '#D1D6DE' }} color={"primary"} checked={isItemSelected} inputProps={{ "aria-labelledby": labelId }} />
</TableCell> </TableCell>
} }
{ {
headCells.filter(item=>item.id !== 'checkbox').map((item, k) => { headCells.filter(item=>item.id !== 'checkbox').map((item, k) => {
return ( return (
<TableCell key={k} component="th" id={labelId + k} <TableCell key={k} component="th" id={labelId + k}
sx={{
borderBottom: '1px solid #F0F2F5'
}}
// align={} // align={}
style={{ width:CellWidth, textAlign: item.numeric ? "right" : "left", paddingRight: item.sort && item.numeric ? "40px" : "",border:tablecellstyle }} style={{ width:CellWidth, textAlign: item.numeric ? "right" : "left", paddingRight: item.sort && item.numeric ? "40px" : "",border:tablecellstyle }}
scope="row" scope="row"
......
...@@ -30,8 +30,11 @@ const EnhancedTableHead = (props) => { ...@@ -30,8 +30,11 @@ const EnhancedTableHead = (props) => {
}}> }}>
<TableRow style={{...RowStyle}}> <TableRow style={{...RowStyle}}>
{ {
headCells.filter(k => k.id === "checkbox").length > 0 && <TableCell padding="checkbox"> headCells.filter(k => k.id === "checkbox").length > 0 && <TableCell sx={{
border: 'none'
}} padding="checkbox">
<Checkbox <Checkbox
sx={{ color: '#D1D6DE' }}
color={'primary'} color={'primary'}
indeterminate={numSelected > 0 && numSelected < rowCount} indeterminate={numSelected > 0 && numSelected < rowCount}
checked={rowCount > 0 && numSelected === rowCount} checked={rowCount > 0 && numSelected === rowCount}
...@@ -42,6 +45,9 @@ const EnhancedTableHead = (props) => { ...@@ -42,6 +45,9 @@ const EnhancedTableHead = (props) => {
} }
{headCells.map((headCell,k) => ( {headCells.map((headCell,k) => (
<TableCell <TableCell
sx={{
border: 'none'
}}
key={headCell.id} key={headCell.id}
style={{ width: headCell.width ? headCell.width : "", textAlign: headCell.numeric ? "right" : "left", display: headCell.id !== "checkbox" ? "" : "none" }} style={{ width: headCell.width ? headCell.width : "", textAlign: headCell.numeric ? "right" : "left", display: headCell.id !== "checkbox" ? "" : "none" }}
padding={headCell.disablePadding ? "none" : "normal"} padding={headCell.disablePadding ? "none" : "normal"}
......
...@@ -107,13 +107,13 @@ const ProjectData = () => { ...@@ -107,13 +107,13 @@ const ProjectData = () => {
const renderButtons = (item: any) => { const renderButtons = (item: any) => {
return ( return (
<span> <span>
<Button variant="text" size="small"> <Button sx={{position: 'relative', left: '-18px'}} variant="text" size="small">
下载 下载
</Button> </Button>
<Button variant="text" size="small"> <Button sx={{position: 'relative', left: '-18px'}} variant="text" size="small">
移动至 移动至
</Button> </Button>
<Button variant="text" size="small" color="error"> <Button sx={{position: 'relative', left: '-18px'}} variant="text" size="small" color="error">
删除 删除
</Button> </Button>
</span> </span>
...@@ -210,11 +210,6 @@ const ProjectData = () => { ...@@ -210,11 +210,6 @@ const ProjectData = () => {
headCells={versionsHeadCells} headCells={versionsHeadCells}
nopadding={true} nopadding={true}
footer={false} footer={false}
// elevation1={classes.elevation1}
tableStyle={{ minWidth: "auto" }}
borderBottom={"none"}
renderExpandPanel={(e: any) => <div>111111</div>}
// headTableCellCheckbox={classes.HeadTableCell}
></Table> ></Table>
</div> </div>
{selectIds.length > 0 && ( {selectIds.length > 0 && (
......
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