Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
673845c2
Commit
673845c2
authored
May 26, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型虚拟滚动问题
parent
e74484de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
84 deletions
+66
-84
craco.config.js
craco.config.js
+0
-18
index.less
src/view/Manage/VirtualTable/index.less
+55
-0
index.tsx
src/view/Manage/VirtualTable/index.tsx
+6
-10
mixins.less
src/view/Manage/VirtualTable/mixins.less
+5
-56
No files found.
craco.config.js
View file @
673845c2
...
@@ -7,24 +7,6 @@ module.exports = {
...
@@ -7,24 +7,6 @@ module.exports = {
{
{
plugin
:
CracoLessPlugin
,
plugin
:
CracoLessPlugin
,
options
:
{
options
:
{
modifyLessRule
(
lessRule
,
context
)
{
// You have to exclude these file suffixes first,
// if you want to modify the less module's suffix
lessRule
.
exclude
=
/
\.
m
\.
less$/
;
return
lessRule
;
},
modifyLessModuleRule
(
lessModuleRule
,
context
)
{
// Configure the file suffix
lessModuleRule
.
test
=
/
\.
m
\.
less$/
;
// Configure the generated local ident name.
const
cssLoader
=
lessModuleRule
.
use
.
find
(
loaderByName
(
"css-loader"
));
cssLoader
.
options
.
modules
=
{
localIdentName
:
"[local]_[hash:base64:5]"
,
};
return
lessModuleRule
;
},
lessLoaderOptions
:
{
lessLoaderOptions
:
{
lessOptions
:
{
lessOptions
:
{
modifyVars
:
{
modifyVars
:
{
...
...
src/view/Manage/VirtualTable/index.less
0 → 100644
View file @
673845c2
.virtual-table {
.rdg {
border: none !important;
}
.rdg-header-row {
.rdg-cell {
box-shadow: none !important;
background-color: #f2f5fc!important;
border-block-end: none !important;
border-inline-end: none !important;
font-weight: normal !important;
outline: none !important;
top: 0 !important;
padding-inline: 0 !important;
padding-left: 8px !important;
padding-right: 8px !important;
&:before {
position: absolute;
top: 50%;
right: 0;
width: 1px;
height: 1.6em;
background-color: rgba(0,0,0,.06);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
transition: background-color .3s;
content: "";
}
}
}
.rdg-row {
&:hover {
background-color: #fafafa;
}
.rdg-cell {
box-shadow: none !important;
color: #363636 !important;
border-block-end: 1px solid #f0f0f0 !important;
border-inline-end: none !important;
outline: none !important;
padding-inline: 0 !important;
padding-left: 8px !important;
padding-right: 8px !important;
}
}
.react-contextmenu-wrapper {
display: contents;
}
}
\ No newline at end of file
src/view/Manage/VirtualTable/index.tsx
View file @
673845c2
...
@@ -10,6 +10,8 @@ import { DownOutlined, UpOutlined } from '@ant-design/icons';
...
@@ -10,6 +10,8 @@ import { DownOutlined, UpOutlined } from '@ant-design/icons';
import
{
nanoid
}
from
'nanoid'
;
import
{
nanoid
}
from
'nanoid'
;
import
{
downNode
,
upNode
}
from
'./virtual-table-helper'
;
import
{
downNode
,
upNode
}
from
'./virtual-table-helper'
;
import
'./index.less'
;
export
enum
RowAction
{
export
enum
RowAction
{
None
,
Expand
,
Select
None
,
Expand
,
Select
}
}
...
@@ -209,10 +211,9 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
...
@@ -209,10 +211,9 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
const
contextMenuId
=
contextMenu
?.
id
??
nanoid
()
const
contextMenuId
=
contextMenu
?.
id
??
nanoid
()
return
(
return
(
<
React
.
Fragment
>
<
div
className=
'virtual-table'
>
<
DataGrid
<
DataGrid
ref=
{
gridRef
}
ref=
{
gridRef
}
{
...
rest
}
{
...
rest
}
columns=
{
cols
}
columns=
{
cols
}
rows=
{
_rows
}
rows=
{
_rows
}
...
@@ -244,14 +245,9 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
...
@@ -244,14 +245,9 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
}
}
}
}
onRowsChange=
{
onRowsChange
}
onRowsChange=
{
onRowsChange
}
// headerRowHeight={45
}
headerRowHeight=
{
38
}
rowHeight=
{
(
args
)
=>
(
args
.
type
===
'ROW'
&&
args
.
row
.
__type__
===
RowType
.
Detail
?
(
expandable
?.
expandedRowHeight
||
100
)
:
rowHeight
)
}
rowHeight=
{
(
args
)
=>
(
args
.
type
===
'ROW'
&&
args
.
row
.
__type__
===
RowType
.
Detail
?
(
expandable
?.
expandedRowHeight
||
100
)
:
rowHeight
)
}
// defaultColumnOptions={{
// sortable: true,
// resizable: true
// }}
// 排序
// 排序
sortColumns=
{
sortColumns
}
sortColumns=
{
sortColumns
}
onSortColumnsChange=
{
setSortColumns
}
onSortColumnsChange=
{
setSortColumns
}
...
@@ -270,7 +266,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
...
@@ -270,7 +266,7 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
,
,
document
.
body
document
.
body
)
}
)
}
</
React
.
Fragment
>
</
div
>
);
);
}
}
...
...
src/view/Manage/VirtualTable/mixins.less
View file @
673845c2
.rdg {
border: none !important;
}
.rdg-header-row {
.rdg-cell {
box-shadow: none !important;
background-color: #f2f5fc!important;
border-block-end: none !important;
border-inline-end: none !important;
font-weight: normal !important;
outline: none !important;
top: 0 !important;
padding-inline: 0 !important;
padding-left: 8px !important;
padding-right: 8px !important;
&:before {
position: absolute;
top: 50%;
right: 0;
width: 1px;
height: 1.6em;
background-color: rgba(0,0,0,.06);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
transition: background-color .3s;
content: "";
}
}
}
.rdg-row {
&:hover {
background-color: #fafafa;
}
.rdg-cell {
box-shadow: none !important;
color: #363636 !important;
border-block-end: 1px solid #f0f0f0 !important;
border-inline-end: none !important;
outline: none !important;
padding-inline: 0 !important;
padding-left: 8px !important;
padding-right: 8px !important;
}
}
.react-contextmenu-wrapper {
display: contents;
}
.react-contextmenu {
.react-contextmenu {
background-color: #fff;
background-color: #fff;
background-clip: padding-box;
background-clip: padding-box;
...
@@ -65,7 +12,8 @@
...
@@ -65,7 +12,8 @@
min-inline-size: 160px;
min-inline-size: 160px;
outline: none;
outline: none;
opacity: 0;
opacity: 0;
padding-block: 5px;
padding-top: 5px;
padding-bottom: 5px;
padding-inline: 0;
padding-inline: 0;
pointer-events: none;
pointer-events: none;
text-align: start;
text-align: start;
...
@@ -82,8 +30,9 @@
...
@@ -82,8 +30,9 @@
cursor: pointer;
cursor: pointer;
font-weight: 400;
font-weight: 400;
line-height: 1.5;
line-height: 1.5;
padding-block: 3px;
padding-top: 3px;
padding-inline: 20px;
padding-bottom: 3px;
padding-left: 20px;
text-align: inherit;
text-align: inherit;
white-space: nowrap;
white-space: nowrap;
}
}
...
...
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