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
64c113be
Commit
64c113be
authored
Jan 25, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
右键编辑
parent
51f420c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
Table.tsx
src/util/Component/Table.tsx
+6
-2
update-task.jsx
src/view/Manage/ModelCompare/update-task.jsx
+15
-3
No files found.
src/util/Component/Table.tsx
View file @
64c113be
...
@@ -41,7 +41,7 @@ function FC<RowType extends object = any>({ width, maxHeight, pageSize, pageNum,
...
@@ -41,7 +41,7 @@ function FC<RowType extends object = any>({ width, maxHeight, pageSize, pageNum,
const
MENU_ID
=
generateUUID
()
const
MENU_ID
=
generateUUID
()
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
)
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
)
const
{
show
}
=
useContextMenu
({
const
{
show
,
hideAll
}
=
useContextMenu
({
id
:
MENU_ID
,
id
:
MENU_ID
,
})
})
...
@@ -154,7 +154,11 @@ function FC<RowType extends object = any>({ width, maxHeight, pageSize, pageNum,
...
@@ -154,7 +154,11 @@ function FC<RowType extends object = any>({ width, maxHeight, pageSize, pageNum,
tip=
{
rightClickNode
?.[
`${item}`
]?.
tip
}
tip=
{
rightClickNode
?.[
`${item}`
]?.
tip
}
permissions=
{
rightClickNode
?.
permissions
||
menuPermissions
}
permissions=
{
rightClickNode
?.
permissions
||
menuPermissions
}
permissionKey=
{
item
}
permissionKey=
{
item
}
onClick=
{
()
=>
onMenuItemClick
?.(
item
,
rightClickNode
)
}
>
onClick=
{
({
event
})
=>
{
event
?.
stopPropagation
()
hideAll
()
onMenuItemClick
?.(
item
,
rightClickNode
)
}
}
>
{
item
}
{
item
}
</
PermissionRcItem
>)
</
PermissionRcItem
>)
}
}
...
...
src/view/Manage/ModelCompare/update-task.jsx
View file @
64c113be
...
@@ -362,6 +362,7 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
...
@@ -362,6 +362,7 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
const
[
editingKey
,
setEditingKey
]
=
React
.
useState
(
''
)
const
[
editingKey
,
setEditingKey
]
=
React
.
useState
(
''
)
const
[
editingModelKey
,
setEditingModelKey
]
=
React
.
useState
(
''
)
const
[
editingModelKey
,
setEditingModelKey
]
=
React
.
useState
(
''
)
const
[
selectablePropertyTypes
,
setSelectablePropertyTypes
]
=
React
.
useState
()
const
[
selectablePropertyTypes
,
setSelectablePropertyTypes
]
=
React
.
useState
()
const
[
rightRow
,
setRightRow
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
const
tableRef
=
React
.
useRef
()
const
tableRef
=
React
.
useRef
()
...
@@ -396,6 +397,14 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
...
@@ -396,6 +397,14 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
}
}
},
[
type
])
},
[
type
])
const
menuData
=
React
.
useMemo
(()
=>
{
if
(
rightRow
)
{
return
isEditing
(
rightRow
)
?
[
'删除'
]
:
[
'编辑'
,
'删除'
]
}
return
[]
},
[
rightRow
,
isEditing
])
const
getPropertyTypes
=
()
=>
{
const
getPropertyTypes
=
()
=>
{
setLoadingPropertyTypes
(
true
)
setLoadingPropertyTypes
(
true
)
dispatch
({
dispatch
({
...
@@ -532,7 +541,9 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
...
@@ -532,7 +541,9 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
}
}
const
onRightMenuItemClick
=
(
key
,
record
)
=>
{
const
onRightMenuItemClick
=
(
key
,
record
)
=>
{
if
(
key
===
'删除'
)
{
if
(
key
===
'编辑'
)
{
onEditClick
(
record
)
}
else
if
(
key
===
'删除'
)
{
onRightDeleteClick
(
record
)
onRightDeleteClick
(
record
)
}
}
}
}
...
@@ -627,10 +638,11 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
...
@@ -627,10 +638,11 @@ const Strategy = React.forwardRef(function ({ type, task }, ref) {
}
}
}
}
pagination=
{
false
}
pagination=
{
false
}
shouldRowContextMenu=
{
(
record
)
=>
{
shouldRowContextMenu=
{
(
record
)
=>
{
setRightRow
(
record
)
return
true
return
true
}
}
}
}
menuData=
{
[
'删除'
]
}
menuData=
{
menuData
}
menuPermissions=
{
[
'删除'
]
}
menuPermissions=
{
menuData
}
onMenuItemClick=
{
onRightMenuItemClick
}
onMenuItemClick=
{
onRightMenuItemClick
}
/>
/>
</
Form
>
</
Form
>
...
...
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