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
c307c0dd
Commit
c307c0dd
authored
May 28, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
81507949
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
index.jsx
src/view/Manage/ResizeableTable/index.jsx
+10
-2
No files found.
src/view/Manage/ResizeableTable/index.jsx
View file @
c307c0dd
...
@@ -62,10 +62,18 @@ const ResizeableTable = (props) => {
...
@@ -62,10 +62,18 @@ const ResizeableTable = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!!
columns
&&
tableWidth
>
0
)
{
if
(
!!
columns
&&
tableWidth
>
0
)
{
const
contentWidth
=
getWidth
(
tableWidth
,
extraColWidth
)
const
contentWidth
=
getWidth
(
tableWidth
,
extraColWidth
)
for
(
const
item
of
columns
??[])
{
const
index
=
(
cols
??[]).
findIndex
(
_item
=>
item
.
dataIndex
===
_item
.
dataIndex
&&
item
.
title
===
_item
.
title
)
if
(
index
!==
-
1
)
{
item
.
width
=
cols
[
index
].
width
}
}
setDefaultWidth
(
columns
,
contentWidth
)
setDefaultWidth
(
columns
,
contentWidth
)
paddingCol
.
current
.
width
=
0
paddingCol
.
current
.
width
=
0
const
c
ols
=
columns
const
newC
ols
=
columns
.
map
((
col
,
index
)
=>
{
.
map
((
col
,
index
)
=>
{
const
colWidth
=
col
.
width
??
100
;
const
colWidth
=
col
.
width
??
100
;
return
{
return
{
...
@@ -78,7 +86,7 @@ const ResizeableTable = (props) => {
...
@@ -78,7 +86,7 @@ const ResizeableTable = (props) => {
}),
}),
};
};
})
})
setCols
(
c
ols
)
setCols
(
newC
ols
)
}
}
},
[
columns
,
tableWidth
])
},
[
columns
,
tableWidth
])
...
...
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