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
8be981c6
Commit
8be981c6
authored
May 11, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
元数据挂载资产
parent
1db68649
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
32 deletions
+69
-32
assetmanage.js
src/model/assetmanage.js
+5
-0
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+59
-32
No files found.
src/model/assetmanage.js
View file @
8be981c6
...
@@ -329,4 +329,8 @@ export function* getPermission(payload) {
...
@@ -329,4 +329,8 @@ export function* getPermission(payload) {
export
function
*
getTemplates
()
{
export
function
*
getTemplates
()
{
return
yield
call
(
service
.
getTemplates
)
return
yield
call
(
service
.
getTemplates
)
}
export
function
*
getMetadataTemplates
(
payload
)
{
return
yield
call
(
service
.
getMetadataTemplates
,
payload
)
}
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
8be981c6
...
@@ -314,4 +314,8 @@ export function getPermission(payload) {
...
@@ -314,4 +314,8 @@ export function getPermission(payload) {
export
function
getTemplates
()
{
export
function
getTemplates
()
{
return
GetJSON
(
"/dataassetmanager/elementTemplateApi/listSupportTemplates"
)
return
GetJSON
(
"/dataassetmanager/elementTemplateApi/listSupportTemplates"
)
}
export
function
getMetadataTemplates
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/elementTemplateApi/listSupportElementTemplatesByMetadataIdPath"
,
payload
)
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
8be981c6
...
@@ -81,6 +81,8 @@ const AssetManageTree = (props) => {
...
@@ -81,6 +81,8 @@ const AssetManageTree = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
reference
===
AssetManageReference
)
{
if
(
reference
===
AssetManageReference
)
{
getTemplates
()
getTemplates
()
}
else
if
(
reference
===
AssetMountReference
&&
(
metadataIds
??[]).
length
>
0
)
{
getMetadataTemplates
()
}
else
{
}
else
{
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
}
}
...
@@ -148,6 +150,28 @@ const AssetManageTree = (props) => {
...
@@ -148,6 +150,28 @@ const AssetManageTree = (props) => {
})
})
}
}
const
getMetadataTemplates
=
()
=>
{
setLoadingTemplates
(
true
)
dispatch
({
type
:
'assetmanage.getMetadataTemplates'
,
payload
:
{
metadataIdPath
:
metadataIds
[
0
]
},
callback
:
data
=>
{
setLoadingTemplates
(
false
)
setTemplates
(
data
)
if
((
data
??[]).
length
>
0
)
{
setTemplateType
(
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
getAllDirectoryAsTree
(
true
)
}
},
error
:
()
=>
{
setLoadingTemplates
(
false
)
}
})
}
const
getDataAssetLocationThenGetTreeData
=
()
=>
{
const
getDataAssetLocationThenGetTreeData
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
dispatch
({
dispatch
({
...
@@ -261,37 +285,16 @@ const AssetManageTree = (props) => {
...
@@ -261,37 +285,16 @@ const AssetManageTree = (props) => {
}
}
}
}
}
}
if
((
metadataIds
??[]).
length
>
0
)
{
dispatch
({
type
:
'assetmanage.queryDirectoryTreeByMetadataId'
,
payload
:
{
metadataIdPath
:
metadataIds
[
0
]
},
callback
:
data
=>
{
disposeData
(
data
)
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
else
{
let
url
=
''
;
if
(
reference
===
AssetManageReference
||
reference
===
AssetMountReference
)
{
url
=
'assetmanage.queryAllDirectoryAsTree'
;
}
dispatch
({
type
:
url
,
callback
:
data
=>
{
disposeData
(
data
)
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
dispatch
({
type
:
'assetmanage.queryAllDirectoryAsTree'
,
callback
:
data
=>
{
disposeData
(
data
)
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
}
const
treeDirectoryChanged
=
(
did
)
=>
{
const
treeDirectoryChanged
=
(
did
)
=>
{
...
@@ -785,7 +788,7 @@ const AssetManageTree = (props) => {
...
@@ -785,7 +788,7 @@ const AssetManageTree = (props) => {
getAllDirectoryAsTree
(
true
)
getAllDirectoryAsTree
(
true
)
},
100
)
},
100
)
}
}
}
}
style=
{
{
width
:
8
0
}
}
style=
{
{
width
:
10
0
}
}
>
>
{
{
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
...
@@ -811,10 +814,34 @@ const AssetManageTree = (props) => {
...
@@ -811,10 +814,34 @@ const AssetManageTree = (props) => {
</
div
>
</
div
>
)
}
)
}
bordered=
{
false
}
bordered=
{
false
}
bodyStyle=
{
{
padding
:
'10px 15px'
}
}
bodyStyle=
{
{
padding
:
(
reference
===
AssetMountReference
)?
0
:
'10px 15px'
}
}
headStyle=
{
{
padding
:
0
}
}
headStyle=
{
{
padding
:
0
}
}
style=
{
{
width
:
'100%'
}
}
style=
{
{
width
:
'100%'
}
}
>
>
{
(
metadataIds
??[]).
length
>
0
&&
<
div
className=
'mb-3'
>
<
Select
loading=
{
loadingTemplates
}
size=
'small'
value=
{
currentTemplateType
}
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
setCurrentDirId
();
onSelect
?.(
null
,
null
);
setTimeout
(()
=>
{
onSelect
?.(
''
,
''
);
getAllDirectoryAsTree
(
true
)
},
100
)
}
}
style=
{
{
width
:
100
}
}
>
{
(
templates
??[]).
map
((
item
,
index
)
=>
<
Select
.
Option
key=
{
index
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>)
}
</
Select
>
</
div
>
}
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
AutoComplete
<
AutoComplete
allowClear
allowClear
...
...
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