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
ceec2e3c
Commit
ceec2e3c
authored
Aug 15, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
历史版本
parent
6322bf75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
9 deletions
+43
-9
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+43
-9
No files found.
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
ceec2e3c
...
...
@@ -36,6 +36,10 @@ const { Text } = Typography;
const
{
Search
}
=
Input
;
const
{
Column
}
=
Table
;
const
operationMap
=
{
historyVersion
:
'历史版本'
,
}
//资产项
export
const
AssetItem
=
(
props
)
=>
{
const
{
metadata
,
terms
}
=
props
;
...
...
@@ -218,8 +222,12 @@ const AssetTable = (props) => {
{
(
reference
===
AssetManageReference
||
(
reference
===
AssetBrowseReference
&&
record
.
hasPermission
))
&&
<
a
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
handleItemClick
(
'authorization'
,
record
);
}
}
>
授权
</
a
>
if
(
record
.
metadata
?.
metadataTableId
)
{
app
?.
setGlobalState
&&
app
?.
setGlobalState
({
message
:
'data-govern-assets-admit'
,
data
:
record
})
}}
}
>
授权
</
a
>
}
{
// (reference===AssetManageReference||(reference===AssetBrowseReference&&record.hasPermission)) && <a onClick=
{(
e
)
=>
{
...
...
@@ -402,6 +410,16 @@ const AssetTable = (props) => {
return
newAssets
;
},
[
users
,
assets
,
columns
])
const
menuData
=
React
.
useMemo
(()
=>
{
const
newMenuData
=
[]
for
(
const
key
of
contextMenuItem
?.
allowButtons
??[])
{
if
(
operationMap
[
key
])
{
newMenuData
.
push
(
operationMap
[
key
])
}
}
return
newMenuData
},
[
contextMenuItem
])
const
storageChange
=
(
e
)
=>
{
if
(
e
.
key
===
'assetRelationOnClickEvent'
)
{
remoteRelationRef
.
current
=
e
.
relation
;
...
...
@@ -1009,7 +1027,7 @@ const AssetTable = (props) => {
const handleItemClick = ({ event, props, data, triggerEvent }) => {
const key = event.currentTarget.id;
if (key === '
history
') {
if (key === '
历史版本
') {
setHistoryAndVersionParams({
visible: true,
id: contextMenuItem?.id
...
...
@@ -1258,8 +1276,19 @@ const AssetTable = (props) => {
},
onContextMenu: event => {
if (reference===AssetManageReference) {
setContextMenuItem(record);
displayMenu(event);
let allowContextMenu = false
for (const key of (record.allowButtons??[])) {
if (operationMap[key]) {
allowContextMenu = true
break
}
}
if (allowContextMenu) {
setContextMenuItem(record);
displayMenu(event);
}
}
},
}
...
...
@@ -1277,7 +1306,8 @@ const AssetTable = (props) => {
return classNames.join(' ');
}}
loading={loading}
columns={reference===AssetManageReference?[indexCol, ...columns, tagCol, actionCol]:[indexCol, ...columns, actionCol]}
columns={reference===AssetManageReference?[indexCol, ...columns, tagCol]:[indexCol, ...columns]}
// columns={reference===AssetManageReference?[indexCol, ...columns, tagCol, actionCol]:[indexCol, ...columns, actionCol]}
rowKey='id'
dataSource={realAssets}
pagination={false}
...
...
@@ -1406,9 +1436,13 @@ const AssetTable = (props) => {
/>
<RcMenu id={MENU_ID}>
<RcItem id="history" onClick={handleItemClick}>
历史版本
</RcItem>
{
menuData?.map(item => (
<RcItem id={item} onClick={handleItemClick}>
{item}
</RcItem>
))
}
</RcMenu>
{contextHolder}
...
...
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