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
4de3f948
Commit
4de3f948
authored
Dec 19, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程跳转资产详情
parent
b7d94614
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
+37
-13
AssetDetailPage.jsx
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
+37
-13
No files found.
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
View file @
4de3f948
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
Spin
}
from
"antd"
;
import
AssetDetail
from
'./AssetDetail'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
import
'./AssetDetailPage.less'
;
const
AssetDetailPage
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
({
id
:
''
,
dirId
:
''
});
const
{
id
,
dirId
}
=
data
;
const
id
=
getQueryParam
(
'id'
,
props
.
location
?.
search
)
const
[
dirId
,
setDirId
]
=
useState
(
getQueryParam
(
'dirId'
,
props
.
location
?.
search
))
const
[
loading
,
setLoading
]
=
useState
(
false
)
useEffect
(()
=>
{
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
const
_dirId
=
getQueryParam
(
'dirId'
,
props
.
location
.
search
);
setData
({
id
:
_id
,
dirId
:
_dirId
});
if
(
!
dirId
)
{
getAssetPaths
()
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
const
getAssetPaths
=
()
=>
{
if
(
id
)
{
setLoading
(
true
);
dispatch
({
type
:
'assetmanage.getAssetPaths'
,
payload
:
{
dataAssetId
:
id
,
},
callback
:
data
=>
{
setLoading
(
false
);
if
((
data
??[]).
length
>
0
)
{
setDirId
(
data
[
0
].
dirId
)
}
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
}
return
(
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'detail-header'
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#fff'
}
}
>
资产详情
</
span
>
</
div
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
<
AssetDetail
id=
{
id
}
dirId=
{
dirId
}
/>
<
Spin
spinning=
{
loading
}
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
{
dirId
&&
<
AssetDetail
id=
{
id
}
dirId=
{
dirId
}
/>
}
</
div
>
</
div
>
</
div
>
</
Spin
>
</
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