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
65b1d92d
Commit
65b1d92d
authored
May 19, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加序号
parent
734c154d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+7
-6
test-table.tsx
src/view/Manage/VirtualTable/test-table.tsx
+6
-0
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
65b1d92d
...
@@ -54,6 +54,7 @@ const ModelNameColumn = (props) => {
...
@@ -54,6 +54,7 @@ const ModelNameColumn = (props) => {
if
(
data
.
digest
)
{
if
(
data
.
digest
)
{
_textComponent
=
<
div
style=
{
{
width
:
500
,
maxHeight
:
300
,
overflow
:
'auto'
}
}
>
_textComponent
=
<
div
style=
{
{
width
:
500
,
maxHeight
:
300
,
overflow
:
'auto'
}
}
>
<
Table
<
Table
rowKey=
'name'
dataSource=
{
data
.
digest
.
attributeDigests
||
[]
}
dataSource=
{
data
.
digest
.
attributeDigests
||
[]
}
columns=
{
cols
}
columns=
{
cols
}
loading=
{
false
}
loading=
{
false
}
...
@@ -113,12 +114,12 @@ const ModelTable = (props) => {
...
@@ -113,12 +114,12 @@ const ModelTable = (props) => {
const
[
subData
,
setSubData
]
=
useState
([]);
const
[
subData
,
setSubData
]
=
useState
([]);
const
cols
=
[
const
cols
=
[
//
{
{
//
name: '序号',
name
:
'序号'
,
// key: 'key
',
key
:
'index
'
,
//
width: 60,
width
:
60
,
//
sortable: false,
sortable
:
false
,
//
},
},
{
{
name
:
'模型名称'
,
name
:
'模型名称'
,
key
:
'name'
,
key
:
'name'
,
...
...
src/view/Manage/VirtualTable/test-table.tsx
View file @
65b1d92d
...
@@ -22,6 +22,7 @@ export enum RowType {
...
@@ -22,6 +22,7 @@ export enum RowType {
export
interface
RowData
{
export
interface
RowData
{
id
:
string
,
id
:
string
,
index
?:
string
;
__pid__
?:
string
__pid__
?:
string
__row__
?:
any
__row__
?:
any
__type__
?:
RowType
__type__
?:
RowType
...
@@ -150,6 +151,11 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
...
@@ -150,6 +151,11 @@ function FC<Row extends RowData, SR, K extends React.Key = React.Key>(props: Dat
const
[
sortColumns
,
setSortColumns
]
=
useState
<
readonly
SortColumn
[]
>
([]);
// 排序列图标状态
const
[
sortColumns
,
setSortColumns
]
=
useState
<
readonly
SortColumn
[]
>
([]);
// 排序列图标状态
const
[
_rows
,
_setRows
]
=
useState
<
readonly
Row
[]
>
([])
const
[
_rows
,
_setRows
]
=
useState
<
readonly
Row
[]
>
([])
useEffect
(()
=>
{
useEffect
(()
=>
{
(
rows
||
[]).
forEach
((
item
,
index
)
=>
{
item
.
index
=
`
${
index
+
1
}
`
;
})
if
(
sortColumns
.
length
===
0
)
{
if
(
sortColumns
.
length
===
0
)
{
_setRows
(
rows
);
_setRows
(
rows
);
}
else
{
}
else
{
...
...
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