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
4268bb0f
Commit
4268bb0f
authored
Jun 23, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产路径
parent
e8094fc0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
6 deletions
+46
-6
assetmanage.js
src/model/assetmanage.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+38
-6
No files found.
src/model/assetmanage.js
View file @
4268bb0f
...
...
@@ -205,6 +205,10 @@ export function* countResourceState(payload) {
return
yield
call
(
service
.
countResourceState
,
payload
);
}
export
function
*
getAssetPaths
(
payload
)
{
return
yield
call
(
service
.
getAssetPaths
,
payload
);
}
export
function
*
getResourceRelations
(
payload
)
{
return
yield
call
(
service
.
getResourceRelations
,
payload
);
}
...
...
src/service/dataassetmanager.js
View file @
4268bb0f
...
...
@@ -100,6 +100,10 @@ export function recoveryFromRecycleBin(payload) {
return
PostJSON
(
"/dataassetmanager/dataAssetApi/recoveryFromRecycleBin"
,
payload
);
}
export
function
getAssetPaths
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/dataAssetApi/getMultiPath"
,
payload
);
}
export
function
addOrUpdateDirectory
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/directoryApi/addOrUpdateDirectory"
,
payload
);
}
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
4268bb0f
...
...
@@ -23,6 +23,7 @@ const AssetAction = (props) => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
[
assetPaths
,
setAssetPaths
]
=
useState
([]);
const
[
resourceRelations
,
setResourceRelations
]
=
useState
([]);
const
{
assets
,
attributes
,
attributesFoldMap
}
=
assetParams
;
const
[
assetTagModalVisible
,
setAssetTagModalVisible
]
=
useState
(
false
);
...
...
@@ -34,6 +35,7 @@ const AssetAction = (props) => {
}
else
{
setCurrentAction
(
'detail'
);
if
((
id
||
''
)
!==
''
)
{
getAssetPaths
();
getResourceRelations
();
if
(
readOnly
)
{
...
...
@@ -51,6 +53,18 @@ const AssetAction = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
id
])
const
getAssetPaths
=
()
=>
{
dispatch
({
type
:
'assetmanage.getAssetPaths'
,
payload
:
{
dataAssetId
:
id
,
},
callback
:
data
=>
{
setAssetPaths
(
data
||
[]);
}
});
}
const
getResourceRelations
=
()
=>
{
dispatch
({
type
:
'assetmanage.getResourceRelations'
,
...
...
@@ -182,13 +196,25 @@ const AssetAction = (props) => {
}
}
const
jumpToPath
=
()
=>
{
const
jumpToPath
=
(
item
)
=>
{
if
(
!
readOnly
)
{
setFullScreen
(
false
);
let
event
=
new
Event
(
'storage'
);
event
.
key
=
'assetDirChangeEvent'
;
event
.
dirId
=
dirId
||
''
;
event
.
dirId
=
item
.
dirId
||
''
;
window
?.
dispatchEvent
(
event
);
}
else
{
const
timestamp
=
new
Date
().
getTime
();
if
(
item
.
resourceType
===
'innerSource'
||
item
.
resourceType
===
'outerSource'
)
{
window
.
open
(
`/center-home/menu/asset-resource-browse?
${
AnchorId
}
=
${
item
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
item
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`);
} else if (item.resourceType==='dataAsset') {
window.open(`
/
center
-
home
/
menu
/
asset
-
browse
?
$
{
AnchorId
}
=
$
{
item
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
item
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`);
} else {
showMessage('warn', '资产类型不是资源也不是资产!');
}
}
}
const jumpToRelation = (relation) => {
...
...
@@ -380,9 +406,15 @@ const AssetAction = (props) => {
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产路径</div>}
style={{ paddingBottom: 15 }}
>
<a onClick={()=>{jumpToPath();}}>
{assets.currentPath||''}
</a>
<div className='flex' style={{ flexDirection: 'column' }}>
{
(assetPaths||[]).map((item, key) => {
return (
<a key={key} onClick={() => { jumpToPath(item); }}>{highlightSearchContentByTerms(item?.dataAssetName||'',[assets.currentPath])}</a>
);
})
}
</div>
</Descriptions.Item>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}>
<AppContext.Consumer>
...
...
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