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
2e7d2114
Commit
2e7d2114
authored
Mar 28, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加关联关系
parent
bc071b02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
assetmanage.js
src/model/assetmanage.js
+5
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+29
-2
No files found.
src/model/assetmanage.js
View file @
2e7d2114
...
@@ -155,4 +155,8 @@ export function* fillElementValueBeforeCreate(payload) {
...
@@ -155,4 +155,8 @@ export function* fillElementValueBeforeCreate(payload) {
export
function
*
countResourceState
(
payload
)
{
export
function
*
countResourceState
(
payload
)
{
return
yield
call
(
service
.
countResourceState
,
payload
);
return
yield
call
(
service
.
countResourceState
,
payload
);
}
export
function
*
getResourceRelations
(
payload
)
{
return
yield
call
(
service
.
getResourceRelations
,
payload
);
}
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
2e7d2114
...
@@ -163,3 +163,7 @@ export function fillElementValueBeforeCreate(payload) {
...
@@ -163,3 +163,7 @@ export function fillElementValueBeforeCreate(payload) {
export
function
countResourceState
(
payload
)
{
export
function
countResourceState
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/countApi/countResourceState"
,
payload
);
return
GetJSON
(
"/dataassetmanager/countApi/countResourceState"
,
payload
);
}
}
export
function
getResourceRelations
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resourceApi/getResourceRelations"
,
payload
);
}
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
2e7d2114
...
@@ -22,7 +22,7 @@ const AssetAction = (props) => {
...
@@ -22,7 +22,7 @@ const AssetAction = (props) => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
[
resourceRelations
,
setResourceRelations
]
=
useState
([]);
const
{
assets
,
attributes
,
attributesFoldMap
}
=
assetParams
;
const
{
assets
,
attributes
,
attributesFoldMap
}
=
assetParams
;
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -31,6 +31,7 @@ const AssetAction = (props) => {
...
@@ -31,6 +31,7 @@ const AssetAction = (props) => {
}
else
{
}
else
{
setCurrentAction
(
'detail'
);
setCurrentAction
(
'detail'
);
if
((
id
||
''
)
!==
''
)
{
if
((
id
||
''
)
!==
''
)
{
getResourceRelations
();
getAsset
();
getAsset
();
}
else
{
}
else
{
setMetadataId
(
''
);
setMetadataId
(
''
);
...
@@ -41,6 +42,18 @@ const AssetAction = (props) => {
...
@@ -41,6 +42,18 @@ const AssetAction = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
id
])
},
[
id
])
const
getResourceRelations
=
()
=>
{
dispatch
({
type
:
'assetmanage.getResourceRelations'
,
payload
:
{
dataAssetId
:
id
,
},
callback
:
data
=>
{
setResourceRelations
(
data
);
}
});
}
const
getElements
=
(
cb
=
null
)
=>
{
const
getElements
=
(
cb
=
null
)
=>
{
setLoading
(
true
);
setLoading
(
true
);
dispatch
({
dispatch
({
...
@@ -300,7 +313,7 @@ const AssetAction = (props) => {
...
@@ -300,7 +313,7 @@ const AssetAction = (props) => {
{
assets
.
currentPath
||
''
}
{
assets
.
currentPath
||
''
}
</
a
>
</
a
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
{
<
div
className=
'title-text'
style=
{
{
textAlign
:
'right'
,
width
:
60
}
}
>
资产标签
</
div
>
}
style=
{
{
paddingBottom
:
0
}
}
>
<
Descriptions
.
Item
label=
{
<
div
className=
'title-text'
style=
{
{
textAlign
:
'right'
,
width
:
60
}
}
>
资产标签
</
div
>
}
style=
{
{
paddingBottom
:
15
}
}
>
<
AppContext
.
Consumer
>
<
AppContext
.
Consumer
>
{
{
value
=>
{
value
=>
{
...
@@ -309,6 +322,20 @@ const AssetAction = (props) => {
...
@@ -309,6 +322,20 @@ const AssetAction = (props) => {
}
}
</
AppContext
.
Consumer
>
</
AppContext
.
Consumer
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
{
<
div
className=
'title-text'
style=
{
{
textAlign
:
'right'
,
width
:
60
}
}
>
关联关系
</
div
>
}
style=
{
{
paddingBottom
:
0
}
}
>
<
div
className=
'flex'
style=
{
{
flexDirection
:
'column'
}
}
>
{
(
resourceRelations
||
[]).
map
((
item
,
key
)
=>
{
return
(
<
span
key=
{
key
}
>
{
item
}
</
span
>
);
})
}
</
div
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
</
div
>
</
div
>
{
{
...
...
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