Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
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
web_component
submodule
Commits
94406b3f
You need to sign in or sign up before continuing.
Commit
94406b3f
authored
Jun 28, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加行hover效果
parent
52c7858a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
Cell.tsx
components/apolloTable/component/Cell.tsx
+17
-0
Table.less
components/apolloTable/component/Table.less
+3
-1
Table.tsx
components/apolloTable/component/Table.tsx
+1
-1
No files found.
components/apolloTable/component/Cell.tsx
View file @
94406b3f
...
...
@@ -5,6 +5,7 @@ import _ from 'lodash';
import
{
config
}
from
'./base/config'
;
import
{
getEditComponent
,
getFormat
,
setFormat
}
from
'./base'
;
import
s
from
'./Cell.less'
;
import
tableStyle
from
'./Table.less'
;
import
{
CellProps
,
CellDataProps
}
from
'./interface'
;
import
FormHelper
from
'../utils/formHelper'
;
import
firstIcon
from
'../assets/first.png'
;
...
...
@@ -103,6 +104,20 @@ const Cell = (props: CellProps) => {
}
setStatus
(
'detail'
);
};
// 添加行hover样式
const
onMouseEnter
=
()
=>
{
const
doms
=
document
.
querySelectorAll
(
`.row_
${
rowIndex
}
`
);
doms
.
forEach
((
dom
)
=>
{
dom
.
classList
.
add
(
tableStyle
.
hover
);
});
};
// 去除行hover样式
const
onMouseLeave
=
()
=>
{
const
doms
=
document
.
querySelectorAll
(
`.row_
${
rowIndex
}
`
);
doms
.
forEach
((
dom
)
=>
{
dom
.
classList
.
remove
(
tableStyle
.
hover
);
});
};
const
selfRenderDetailCell
=
()
=>
{
let
empty
=
...
...
@@ -169,6 +184,8 @@ const Cell = (props: CellProps) => {
const
detail
=
(
<
div
onMouseEnter=
{
onMouseEnter
}
onMouseLeave=
{
onMouseLeave
}
className=
{
selectedCell
===
`${position}_${cellKey}`
?
classNames
(
s
.
detailCell
,
s
.
selected
)
:
s
.
detailCell
}
...
...
components/apolloTable/component/Table.less
View file @
94406b3f
...
...
@@ -69,7 +69,9 @@
color: @textGeneralColor;
font-weight: @weightRegular;
}
.hover {
background: @tableHoverBgColor;
}
.headerGrid {
width: 100%;
overflow: hidden !important;
...
...
components/apolloTable/component/Table.tsx
View file @
94406b3f
...
...
@@ -393,7 +393,7 @@ export default class AirTable extends Component<TableProps, TableState> {
columnData=
{
columnData
}
record=
{
record
}
emitChangeCell=
{
emitChangeCell
}
cellClassName=
{
classNames
(
rowClassNameStr
,
cellClassNameStr
)
}
cellClassName=
{
classNames
(
`row_${rowIndex}`
,
rowClassNameStr
,
cellClassNameStr
)
}
cellStyle=
{
{
...
rowStyleObj
,
...
cellStyleObj
}
}
columns=
{
columns
}
paginationConfig=
{
paginationConfig
}
...
...
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