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
ae6f95ad
Commit
ae6f95ad
authored
Apr 28, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关联关系跳转
parent
431e28dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
13 deletions
+82
-13
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+22
-3
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+54
-6
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+6
-4
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
ae6f95ad
...
@@ -10,6 +10,7 @@ import { AppContext } from '../../../../App';
...
@@ -10,6 +10,7 @@ import { AppContext } from '../../../../App';
import
Tag
from
'../../Tag'
;
import
Tag
from
'../../Tag'
;
import
Separate
from
'./Separate'
;
import
Separate
from
'./Separate'
;
import
AssetTagModal
from
'./AssetTagModal'
;
import
AssetTagModal
from
'./AssetTagModal'
;
import
{
AnchorId
,
AnchorDirId
}
from
'../../../../util/constant'
;
import
{
CancelSvg
,
EditSvg
,
SaveSvg
,
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
{
CancelSvg
,
EditSvg
,
SaveSvg
,
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
...
@@ -184,13 +185,31 @@ const AssetAction = (props) => {
...
@@ -184,13 +185,31 @@ const AssetAction = (props) => {
const
jumpToPath
=
()
=>
{
const
jumpToPath
=
()
=>
{
setFullScreen
(
false
);
setFullScreen
(
false
);
LocalStorage
.
set
(
'assetDirChange'
,
!
(
LocalStorage
.
get
(
'assetDirChange'
)
||
false
));
let
event
=
new
Event
(
'storage'
);
let
event
=
new
Event
(
'storage'
);
event
.
key
=
'assetDirChange'
;
event
.
key
=
'assetDirChange
Event
'
;
event
.
dirId
=
dirId
||
''
;
event
.
dirId
=
dirId
||
''
;
window
?.
dispatchEvent
(
event
);
window
?.
dispatchEvent
(
event
);
}
}
const
jumpToRelation
=
(
relation
)
=>
{
if
(
!
readOnly
)
{
let
event
=
new
Event
(
'storage'
);
event
.
key
=
'assetRelationOnClickEvent'
;
event
.
relation
=
relation
;
window
?.
dispatchEvent
(
event
);
}
else
{
const
timestamp
=
new
Date
().
getTime
();
if
(
relation
.
resourceType
===
'innerSource'
||
relation
.
resourceType
===
'outerSource'
)
{
window
.
open
(
'/center-home/menu/'
+
`asset-resource-browse?
${
AnchorId
}
=
${
relation
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
relation
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`);
} else if (relation.resourceType==='dataAsset') {
window.open('/center-home/menu/' + `
asset
-
browse
?
$
{
AnchorId
}
=
$
{
relation
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
relation
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`);
} else {
showMessage('warn', '资产类型不是资源也不是资产!');
}
}
}
const onOk = async() => {
const onOk = async() => {
try {
try {
const row = await form?.validateFields();
const row = await form?.validateFields();
...
@@ -382,7 +401,7 @@ const AssetAction = (props) => {
...
@@ -382,7 +401,7 @@ const AssetAction = (props) => {
{
{
(resourceRelations||[]).map((item, key) => {
(resourceRelations||[]).map((item, key) => {
return (
return (
<
span
key=
{
key
}
>
{
item
?.
dataAssetName
||
''
}
</
span
>
<
a key={key} onClick={() => { jumpToRelation(item); }}>{item?.dataAssetName||''}</a
>
);
);
})
})
}
}
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
ae6f95ad
...
@@ -14,7 +14,7 @@ import AssetEdit from './AddAssetModel';
...
@@ -14,7 +14,7 @@ import AssetEdit from './AddAssetModel';
import
AssetDetailDrawer
from
"./AssetDetailDrawer"
;
import
AssetDetailDrawer
from
"./AssetDetailDrawer"
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../../model'
;
import
{
showMessage
,
showNotifaction
,
getQueryParam
,
inputWidth
,
isSzseEnv
}
from
'../../../../util'
;
import
{
showMessage
,
showNotifaction
,
getQueryParam
,
inputWidth
,
isSzseEnv
}
from
'../../../../util'
;
import
{
AnchorId
,
AnchorTimestamp
,
AssetBrowseReference
,
AssetManageReference
,
AssetRecycleReference
,
ResourceBrowseReference
}
from
'../../../../util/constant'
;
import
{
AnchorId
,
Anchor
DirId
,
Anchor
Timestamp
,
AssetBrowseReference
,
AssetManageReference
,
AssetRecycleReference
,
ResourceBrowseReference
}
from
'../../../../util/constant'
;
import
{
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
{
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
"./AssetTable.less"
;
import
"./AssetTable.less"
;
...
@@ -146,11 +146,23 @@ const AssetTable = (props) => {
...
@@ -146,11 +146,23 @@ const AssetTable = (props) => {
const
[
compact
,
setCompact
]
=
useState
(
false
);
const
[
compact
,
setCompact
]
=
useState
(
false
);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
anchorId
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
const
anchorId
=
getQueryParam
(
AnchorId
,
props
?.
location
?.
search
);
const
timestamp
=
getQueryParam
(
AnchorTimestamp
,
props
.
location
.
search
);
const
timestamp
=
getQueryParam
(
AnchorTimestamp
,
props
?.
location
?.
search
);
const
anchorDid
=
getQueryParam
(
AnchorDirId
,
props
?.
location
?.
search
);
const
shouldScrollRef
=
useRef
(
false
);
const
shouldScrollRef
=
useRef
(
false
);
const
metadataIndexRef
=
useRef
(
''
);
const
metadataIndexRef
=
useRef
(
''
);
const
remoteRelationRef
=
useRef
(
null
);
useEffect
(()
=>
{
window
?.
addEventListener
(
"storage"
,
storageChange
);
return
()
=>
{
window
?.
removeEventListener
(
"storage"
,
storageChange
);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
nodeId
||
''
)
!==
''
)
{
if
((
nodeId
||
''
)
!==
''
)
{
...
@@ -160,7 +172,12 @@ const AssetTable = (props) => {
...
@@ -160,7 +172,12 @@ const AssetTable = (props) => {
if
(
shouldScrollRef
.
current
===
true
)
{
if
(
shouldScrollRef
.
current
===
true
)
{
shouldScrollRef
.
current
=
false
;
shouldScrollRef
.
current
=
false
;
if
(
remoteRelationRef
.
current
)
{
getDataAssetLocationByRelation
();
}
else
{
getDataAssetLocation
();
getDataAssetLocation
();
}
}
else
{
}
else
{
setPagination
({
...
pagination
,
pageNum
:
1
});
setPagination
({
...
pagination
,
pageNum
:
1
});
...
@@ -200,12 +217,44 @@ const AssetTable = (props) => {
...
@@ -200,12 +217,44 @@ const AssetTable = (props) => {
}
}
})
})
const
storageChange
=
(
e
)
=>
{
if
(
e
.
key
===
'assetRelationOnClickEvent'
)
{
remoteRelationRef
.
current
=
e
.
relation
;
shouldScrollRef
.
current
=
true
;
}
}
const
getDataAssetLocationByRelation
=
()
=>
{
setLoading
(
true
);
dispatch
({
type
:
'assetmanage.getDataAssetLocation'
,
payload
:
{
dataAssetId
:
remoteRelationRef
.
current
?.
dataAssetId
,
dirId
:
remoteRelationRef
.
current
?.
dirId
,
},
callback
:
data
=>
{
remoteRelationRef
.
current
=
null
;
const
anchorLocation
=
data
.
offset
;
const
_pageNum
=
parseInt
(
anchorLocation
/
pageSize
+
((
anchorLocation
%
pageSize
===
0
)?
0
:
1
));
setPagination
({
...
pagination
,
pageNum
:
_pageNum
});
},
error
:
()
=>
{
setLoading
(
false
);
remoteRelationRef
.
current
=
null
;
setPagination
({
...
pagination
,
pageNum
:
1
});
}
});
}
const
getDataAssetLocation
=
()
=>
{
const
getDataAssetLocation
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.getDataAssetLocation'
,
type
:
'assetmanage.getDataAssetLocation'
,
payload
:
{
payload
:
{
dataAssetId
:
anchorId
dataAssetId
:
anchorId
,
dirId
:
anchorDid
,
},
},
callback
:
data
=>
{
callback
:
data
=>
{
const
anchorLocation
=
data
.
offset
;
const
anchorLocation
=
data
.
offset
;
...
@@ -285,9 +334,8 @@ const AssetTable = (props) => {
...
@@ -285,9 +334,8 @@ const AssetTable = (props) => {
<
Tooltip
title=
{
text
||
''
}
>
<
Tooltip
title=
{
text
||
''
}
>
<
Text
ellipsis=
{
true
}
>
<
Text
ellipsis=
{
true
}
>
<
a
onClick=
{
()
=>
{
<
a
onClick=
{
()
=>
{
LocalStorage
.
set
(
'assetDirChange'
,
!
(
LocalStorage
.
get
(
'assetDirChange'
)
||
false
));
let
event
=
new
Event
(
'storage'
);
let
event
=
new
Event
(
'storage'
);
event
.
key
=
'assetDirChange'
;
event
.
key
=
'assetDirChange
Event
'
;
event
.
dirId
=
record
.
dirId
||
''
;
event
.
dirId
=
record
.
dirId
||
''
;
window
?.
dispatchEvent
(
event
);
window
?.
dispatchEvent
(
event
);
}
}
>
}
}
>
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
ae6f95ad
...
@@ -64,10 +64,10 @@ const AssetTree = (props) => {
...
@@ -64,10 +64,10 @@ const AssetTree = (props) => {
},
[])
},
[])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
id
||
''
)
!==
''
)
{
if
((
did
||
''
)
!==
''
)
{
getDataAssetLocationThenGetTreeData
();
}
else
if
((
did
||
''
)
!==
''
)
{
getAllDirectoryAsTree
(
true
,
did
);
getAllDirectoryAsTree
(
true
,
did
);
}
else
if
((
id
||
''
)
!==
''
)
{
getDataAssetLocationThenGetTreeData
();
}
else
{
}
else
{
getAllDirectoryAsTree
(
true
);
getAllDirectoryAsTree
(
true
);
}
}
...
@@ -89,10 +89,12 @@ const AssetTree = (props) => {
...
@@ -89,10 +89,12 @@ const AssetTree = (props) => {
},
[
centerId
])
},
[
centerId
])
const
storageChange
=
(
e
)
=>
{
const
storageChange
=
(
e
)
=>
{
if
(
e
.
key
===
'assetDirChange'
)
{
if
(
e
.
key
===
'assetDirChange
Event
'
)
{
if
((
e
.
dirId
||
''
)
!==
''
)
{
if
((
e
.
dirId
||
''
)
!==
''
)
{
treeDirectoryChanged
(
e
.
dirId
);
treeDirectoryChanged
(
e
.
dirId
);
}
}
}
else
if
(
e
.
key
===
'assetRelationOnClickEvent'
)
{
treeDirectoryChanged
(
e
.
relation
?.
dirId
);
}
}
}
}
...
...
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