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
f5ad96d1
Commit
f5ad96d1
authored
Nov 03, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产挂载目录不包含自定义目录
parent
7c120bb4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
App.js
src/App.js
+1
-0
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+15
-8
AssetMount.jsx
src/view/Manage/AssetRecycle/Component/AssetMount.jsx
+1
-0
No files found.
src/App.js
View file @
f5ad96d1
...
...
@@ -63,6 +63,7 @@ export class App extends React.Component {
<
AssetTree
reference
=
'metadata'
readOnly
=
{
true
}
showCustom
=
{
false
}
checkable
=
{
true
}
onCheck
=
{(
values
)
=>
{
callback
&&
callback
(
values
);
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
f5ad96d1
...
...
@@ -13,7 +13,7 @@ import './AssetTree.less';
const
AssetTree
=
(
props
)
=>
{
const
{
readOnly
=
false
,
checkable
=
false
,
onSelect
,
className
,
onCheck
,
tableId
,
reference
=
''
}
=
props
;
const
{
readOnly
=
false
,
checkable
=
false
,
onSelect
,
className
,
onCheck
,
tableId
,
reference
=
''
,
showCustom
=
true
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
...
...
@@ -90,11 +90,18 @@ const AssetTree = (props) => {
type
:
'assetmanage.queryAllDirectoryAsTree'
,
callback
:
data
=>
{
setLoading
(
false
);
setTreeData
(
data
);
let
newData
=
[...
data
];
if
(
!
showCustom
)
{
console
.
log
(
'test'
);
newData
=
(
newData
||
[]).
filter
(
item
=>
item
.
type
!==
'custom'
);
}
setTreeData
(
newData
);
const
_dataList
=
[],
_groupIds
=
[];
generateList
(
d
ata
,
_dataList
);
generateGroupIds
(
d
ata
,
_groupIds
);
generateList
(
newD
ata
,
_dataList
);
generateGroupIds
(
newD
ata
,
_groupIds
);
setDataList
(
_dataList
);
setGroupIds
(
_groupIds
);
...
...
@@ -115,7 +122,7 @@ const AssetTree = (props) => {
}
if
((
defaultSelectedId
||
''
)
!==
''
)
{
recursion
(
d
ata
);
recursion
(
newD
ata
);
}
if
(
resetCurrentDirId
)
{
...
...
@@ -124,7 +131,7 @@ const AssetTree = (props) => {
const
expandedKeys
=
_dataList
.
map
(
item
=>
{
if
(
item
.
key
.
indexOf
(
defaultSelectedId
)
>
-
1
)
{
return
getParentKey
(
item
.
key
,
d
ata
);
return
getParentKey
(
item
.
key
,
newD
ata
);
}
return
null
;
})
...
...
@@ -139,8 +146,8 @@ const AssetTree = (props) => {
}
else
{
const
_currentDirId
=
(
data
&&
data
[
0
]?(
d
ata
[
0
].
nodeId
||
''
):
''
);
const
_type
=
(
data
&&
data
[
0
]?(
d
ata
[
0
].
type
||
''
):
''
);
const
_currentDirId
=
(
newData
&&
newData
[
0
]?(
newD
ata
[
0
].
nodeId
||
''
):
''
);
const
_type
=
(
newData
&&
newData
[
0
]?(
newD
ata
[
0
].
type
||
''
):
''
);
setCurrentDirId
(
_currentDirId
);
setCurrentDirType
(
_type
);
...
...
src/view/Manage/AssetRecycle/Component/AssetMount.jsx
View file @
f5ad96d1
...
...
@@ -61,6 +61,7 @@ const AssetMount = (props) => {
<
AssetTree
readOnly=
{
true
}
checkable=
{
true
}
showCustom=
{
false
}
onCheck=
{
onCheck
}
tableId=
{
refrence
===
'asset-manage'
?
id
:
''
}
reference=
'mount'
...
...
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