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
cbfbd076
Commit
cbfbd076
authored
Jun 15, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务
parent
93fe8351
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+4
-0
index.jsx
src/view/Manage/ResizeableTable/index.jsx
+5
-5
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
cbfbd076
...
...
@@ -608,6 +608,9 @@ const ModelTable = (props) => {
let newCols = [...cols];
if ((visibleColNames||[]).length > 0) {
newCols = newCols.filter(col => visibleColNames.indexOf(col.title)!==-1 || col.title==='序号' || col.title==='操作');
if ((visibleColNames||[]).indexOf('服务描述') === -1) {
newCols[newCols.length-2].width = null;
}
}
if (modelId) {
newCols.filter(col => col.title !=='序号');
...
...
@@ -935,6 +938,7 @@ const ModelTable = (props) => {
<Table
rowSelection={view!=='grant'?rowSelection:undefined}
rowKey={'id'}
extraColWidth={80}
columns={columns||[]}
dataSource={modelId?(subData||[]):(filterData||[])}
pagination={false}
...
...
src/view/Manage/ResizeableTable/index.jsx
View file @
cbfbd076
...
...
@@ -36,7 +36,7 @@ const ResizeableHeaderCell = props => {
};
const
ResizeableTable
=
(
props
)
=>
{
const
{
columns
,
...
restProps
}
=
props
const
{
columns
,
extraColWidth
,
...
restProps
}
=
props
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
)
...
...
@@ -61,7 +61,7 @@ const ResizeableTable = (props) => {
useEffect
(()
=>
{
if
(
!!
columns
&&
tableWidth
>
0
)
{
const
contentWidth
=
getWidth
(
tableWidth
)
const
contentWidth
=
getWidth
(
tableWidth
,
extraColWidth
)
setDefaultWidth
(
columns
,
contentWidth
)
paddingCol
.
current
.
width
=
0
...
...
@@ -80,7 +80,7 @@ const ResizeableTable = (props) => {
})
setCols
(
cols
)
}
},
[
columns
,
tableWidth
])
},
[
columns
,
tableWidth
,
extraColWidth
])
const
cols1
=
useMemo
(()
=>
!!
cols
?
[...
cols
,
paddingCol
.
current
]
:
undefined
,
[
cols
])
...
...
@@ -105,9 +105,9 @@ const ResizeableTable = (props) => {
export
default
ResizeableTable
;
function
getWidth
(
tableWidth
)
{
function
getWidth
(
tableWidth
,
extraColWidth
)
{
// FIXME 判断没有选择列时,32为0
return
tableWidth
-
scrollbarWidth
-
32
// scrollbar width, checkbox column
return
tableWidth
-
scrollbarWidth
-
extraColWidth
// scrollbar width, checkbox column
}
function
setDefaultWidth
(
columns
,
width
)
{
...
...
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