Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
af103dad
Commit
af103dad
authored
Jun 08, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改表格样式 达到和样式稿一致的效果
parent
8c142a1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
Table.jsx
src/components/Material.Ui/Table.jsx
+13
-2
EnhancedTableHead.jsx
src/components/Material.Ui/Table/EnhancedTableHead.jsx
+7
-1
index.tsx
src/views/Project/ProjectData/index.tsx
+3
-8
No files found.
src/components/Material.Ui/Table.jsx
View file @
af103dad
...
...
@@ -90,7 +90,9 @@ export default function EnhancedTable(props) {
return
(
<
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} /> */
}
{
toolbar
&&
toolbar
}
<
TableContainer
style=
{
{
...
tableContainerStyle
}
}
>
...
...
@@ -111,6 +113,9 @@ export default function EnhancedTable(props) {
{
(
rows
.
length
===
0
&&
!
load
)
&&
<
TableRow
>
<
TableCell
sx=
{
{
borderBottom
:
'1px solid #F0F2F5'
}
}
colSpan=
{
headCells
?.
filter
(
k
=>
k
.
id
===
"checkbox"
)?.
length
===
0
?
headCells
?.
length
:
headCells
?.
length
+
1
}
className=
{
classes
.
TypographyStyle
}
style=
{
{
minHeight
:
minHeight
,
height
:
minHeight
,
borderBottom
:
borderBottom
,
padding
:
TableNodataPadding
,
lineHeight
:
TableNodataLineHeight
}
}
...
...
@@ -143,19 +148,25 @@ export default function EnhancedTable(props) {
>
{
headCells
.
filter
(
k
=>
k
.
id
===
"checkbox"
).
length
>
0
&&
<
TableCell
sx=
{
{
borderBottom
:
'1px solid #F0F2F5'
}
}
onClick=
{
(
event
)
=>
{
// if (!row[disabledparam]) return;
onRowClick
&&
onRowClickDefault
(
row
[
param
||
"id"
])
headCells
.
filter
(
k
=>
k
.
id
===
"checkbox"
).
length
>
0
&&
handleClick
(
event
,
row
[
param
||
"id"
])
}
}
padding=
"checkbox"
>
<
Checkbox
color=
{
"primary"
}
checked=
{
isItemSelected
}
inputProps=
{
{
"aria-labelledby"
:
labelId
}
}
/>
<
Checkbox
sx=
{
{
color
:
'#D1D6DE'
}
}
color=
{
"primary"
}
checked=
{
isItemSelected
}
inputProps=
{
{
"aria-labelledby"
:
labelId
}
}
/>
</
TableCell
>
}
{
headCells
.
filter
(
item
=>
item
.
id
!==
'checkbox'
).
map
((
item
,
k
)
=>
{
return
(
<
TableCell
key=
{
k
}
component=
"th"
id=
{
labelId
+
k
}
sx=
{
{
borderBottom
:
'1px solid #F0F2F5'
}
}
// align=
{}
style=
{
{
width
:
CellWidth
,
textAlign
:
item
.
numeric
?
"right"
:
"left"
,
paddingRight
:
item
.
sort
&&
item
.
numeric
?
"40px"
:
""
,
border
:
tablecellstyle
}
}
scope=
"row"
...
...
src/components/Material.Ui/Table/EnhancedTableHead.jsx
View file @
af103dad
...
...
@@ -30,8 +30,11 @@ const EnhancedTableHead = (props) => {
}
}
>
<
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
sx=
{
{
color
:
'#D1D6DE'
}
}
color=
{
'primary'
}
indeterminate=
{
numSelected
>
0
&&
numSelected
<
rowCount
}
checked=
{
rowCount
>
0
&&
numSelected
===
rowCount
}
...
...
@@ -42,6 +45,9 @@ const EnhancedTableHead = (props) => {
}
{
headCells
.
map
((
headCell
,
k
)
=>
(
<
TableCell
sx=
{
{
border
:
'none'
}
}
key=
{
headCell
.
id
}
style=
{
{
width
:
headCell
.
width
?
headCell
.
width
:
""
,
textAlign
:
headCell
.
numeric
?
"right"
:
"left"
,
display
:
headCell
.
id
!==
"checkbox"
?
""
:
"none"
}
}
padding=
{
headCell
.
disablePadding
?
"none"
:
"normal"
}
...
...
src/views/Project/ProjectData/index.tsx
View file @
af103dad
...
...
@@ -107,13 +107,13 @@ const ProjectData = () => {
const
renderButtons
=
(
item
:
any
)
=>
{
return
(
<
span
>
<
Button
variant=
"text"
size=
"small"
>
<
Button
sx=
{
{
position
:
'relative'
,
left
:
'-18px'
}
}
variant=
"text"
size=
"small"
>
下载
</
Button
>
<
Button
variant=
"text"
size=
"small"
>
<
Button
sx=
{
{
position
:
'relative'
,
left
:
'-18px'
}
}
variant=
"text"
size=
"small"
>
移动至
</
Button
>
<
Button
variant=
"text"
size=
"small"
color=
"error"
>
<
Button
sx=
{
{
position
:
'relative'
,
left
:
'-18px'
}
}
variant=
"text"
size=
"small"
color=
"error"
>
删除
</
Button
>
</
span
>
...
...
@@ -210,11 +210,6 @@ const ProjectData = () => {
headCells=
{
versionsHeadCells
}
nopadding=
{
true
}
footer=
{
false
}
// elevation1={classes.elevation1}
tableStyle=
{
{
minWidth
:
"auto"
}
}
borderBottom=
{
"none"
}
renderExpandPanel=
{
(
e
:
any
)
=>
<
div
>
111111
</
div
>
}
// headTableCellCheckbox={classes.HeadTableCell}
></
Table
>
</
div
>
{
selectIds
.
length
>
0
&&
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment