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
b5c4262f
Commit
b5c4262f
authored
Jul 01, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
浏览增加关系图
parent
3f5c3384
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
45 deletions
+21
-45
RelationContainer.jsx
src/view/Manage/AssetBrowse/Component/RelationContainer.jsx
+5
-31
index.jsx
src/view/Manage/AssetBrowse/index.jsx
+9
-8
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+7
-6
No files found.
src/view/Manage/AssetBrowse/Component/RelationContainer.jsx
View file @
b5c4262f
...
@@ -15,28 +15,22 @@ const relationTypes = [
...
@@ -15,28 +15,22 @@ const relationTypes = [
title
:
'热力图'
,
title
:
'热力图'
,
key
:
'thermodynamic'
key
:
'thermodynamic'
},
},
{
//
{
title
:
'数据地图'
,
//
title: '数据地图',
key
:
'map'
,
//
key: 'map',
}
//
}
]
]
const
RelationContainer
=
(
props
)
=>
{
const
RelationContainer
=
(
props
)
=>
{
const
{
nodeParams
,
onChange
,
reference
,
resize
}
=
props
;
const
{
nodeParams
,
onChange
,
reference
,
resize
,
dirs
}
=
props
;
const
[
type
,
setType
]
=
useState
(
'relation'
);
const
[
type
,
setType
]
=
useState
(
'relation'
);
const
[
dirs
,
setDirs
]
=
useState
([]);
const
[
nodes
,
setNodes
]
=
useState
([]);
const
[
nodes
,
setNodes
]
=
useState
([]);
const
[
relationData
,
setRelationData
]
=
useState
(
null
);
const
[
relationData
,
setRelationData
]
=
useState
(
null
);
const
[
thermodynamicData
,
setThermodynamicData
]
=
useState
(
null
);
const
[
thermodynamicData
,
setThermodynamicData
]
=
useState
(
null
);
useEffect
(()
=>
{
useEffect
(()
=>
{
getDirectoryData
();
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
useEffect
(()
=>
{
if
(
type
===
'relation'
)
{
if
(
type
===
'relation'
)
{
if
((
nodeParams
?.
expandId
||
''
)
!==
''
)
{
if
((
nodeParams
?.
expandId
||
''
)
!==
''
)
{
generateExpandNodeRelationData
();
generateExpandNodeRelationData
();
...
@@ -55,25 +49,6 @@ const RelationContainer = (props) => {
...
@@ -55,25 +49,6 @@ const RelationContainer = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
nodeParams
,
dirs
,
type
])
},
[
nodeParams
,
dirs
,
type
])
const
getDirectoryData
=
()
=>
{
let
url
=
''
;
if
(
reference
===
AssetBrowseReference
)
{
url
=
'assetmanage.queryAssetDirectoryAsTree'
;
}
else
if
(
reference
===
ResourceBrowseReference
)
{
url
=
'assetmanage.queryResourceDirectoryAsTree'
;
}
dispatch
({
type
:
url
,
callback
:
data
=>
{
let
newDirs
=
[...
data
];
newDirs
=
(
newDirs
||
[]).
filter
(
item
=>
item
.
type
!==
'custom'
);
setDirs
(
newDirs
);
}
});
}
const
generateNodes
=
()
=>
{
const
generateNodes
=
()
=>
{
let
centerDirectory
=
{};
let
centerDirectory
=
{};
...
@@ -204,7 +179,6 @@ const RelationContainer = (props) => {
...
@@ -204,7 +179,6 @@ const RelationContainer = (props) => {
}
}
})
})
console
.
log
(
'data'
,
data
)
setNodes
(
data
);
setNodes
(
data
);
generateCenterNodeRelationData
(
data
);
generateCenterNodeRelationData
(
data
);
...
...
src/view/Manage/AssetBrowse/index.jsx
View file @
b5c4262f
...
@@ -24,6 +24,7 @@ const AssetBrowse = (props) => {
...
@@ -24,6 +24,7 @@ const AssetBrowse = (props) => {
const
[
resizeRelation
,
setResizeRelation
]
=
useState
(
false
);
const
[
resizeRelation
,
setResizeRelation
]
=
useState
(
false
);
const
[
assetFullScreen
,
setAssetFullScreen
]
=
useState
(
false
);
const
[
assetFullScreen
,
setAssetFullScreen
]
=
useState
(
false
);
const
[
nodeAllowdLoadDataAsset
,
setNodeAllowdLoadDataAsset
]
=
useState
(
false
);
const
[
nodeAllowdLoadDataAsset
,
setNodeAllowdLoadDataAsset
]
=
useState
(
false
);
const
[
dirs
,
setDirs
]
=
useState
()
const
{
centerId
,
expandId
}
=
nodeParams
;
const
{
centerId
,
expandId
}
=
nodeParams
;
...
@@ -72,7 +73,7 @@ const AssetBrowse = (props) => {
...
@@ -72,7 +73,7 @@ const AssetBrowse = (props) => {
axis=
'x'
axis=
'x'
minConstraints=
{
[
230
,
Infinity
]
}
maxConstraints=
{
[
Infinity
,
Infinity
]
}
minConstraints=
{
[
230
,
Infinity
]
}
maxConstraints=
{
[
Infinity
,
Infinity
]
}
>
>
<
AssetTree
centerId=
{
centerId
}
onSelect=
{
onTreeSelect
}
reference=
{
reference
}
{
...
props
}
/>
<
AssetTree
centerId=
{
centerId
}
onSelect=
{
onTreeSelect
}
reference=
{
reference
}
getDirs=
{
(
val
)
=>
setDirs
(
val
)
}
{
...
props
}
/>
</
ResizableBox
>
</
ResizableBox
>
{
{
expandTree
&&
<
Separate
width=
{
15
}
/>
expandTree
&&
<
Separate
width=
{
15
}
/>
...
@@ -82,15 +83,15 @@ const AssetBrowse = (props) => {
...
@@ -82,15 +83,15 @@ const AssetBrowse = (props) => {
<Separate height={15} /> */
}
<Separate height={15} /> */
}
<
div
className=
'flex'
style=
{
{
flex
:
1
,
height
:
'100%'
,
overflow
:
'hidden'
}
}
>
<
div
className=
'flex'
style=
{
{
flex
:
1
,
height
:
'100%'
,
overflow
:
'hidden'
}
}
>
{
{
//
expandRelation && <React.Fragment>
expandRelation
&&
<
React
.
Fragment
>
//
<div style=
{{
flex
:
1
,
height
:
'100%'
,
overflow
:
'hidden'
}}
>
<
div
style=
{
{
flex
:
1
,
height
:
'100%'
,
overflow
:
'hidden'
}
}
>
// <RelationContainer reference=
{
reference
}
nodeParams
=
{
nodeParams
}
onChange
=
{
onRelationChange
}
resize
=
{
resizeRelation
}
/
>
<
RelationContainer
reference=
{
reference
}
nodeParams=
{
nodeParams
}
onChange=
{
onRelationChange
}
resize=
{
resizeRelation
}
dirs=
{
dirs
}
/>
//
</div>
</
div
>
//
<Separate width=
{
15
}
/
>
<
Separate
width=
{
15
}
/>
//
</React.Fragment>
</
React
.
Fragment
>
}
}
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
}
}
>
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
}
}
>
<
AssetTable
nodeId=
{
centerId
}
nodeType=
{
nodeParams
.
nodeType
}
nodeAllowdLoadDataAsset=
{
nodeAllowdLoadDataAsset
}
reference=
{
reference
}
onCountChange=
{
onAssetCountChange
}
onFullScreenChange=
{
onFullScreenChange
}
{
...
props
}
/>
<
AssetTable
nodeId=
{
expandId
?
expandId
:
centerId
}
nodeType=
{
nodeParams
.
nodeType
}
nodeAllowdLoadDataAsset=
{
nodeAllowdLoadDataAsset
}
reference=
{
reference
}
onCountChange=
{
onAssetCountChange
}
onFullScreenChange=
{
onFullScreenChange
}
{
...
props
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'tree-toggle'
onClick=
{
treeToggleClick
}
>
<
div
className=
'tree-toggle'
onClick=
{
treeToggleClick
}
>
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
b5c4262f
...
@@ -43,7 +43,7 @@ const AssetTree = (props) => {
...
@@ -43,7 +43,7 @@ const AssetTree = (props) => {
id
:
MENU_ID
,
id
:
MENU_ID
,
});
});
const
{
onSelect
,
onCheck
,
tableId
,
reference
=
AssetBrowseReference
,
centerId
}
=
props
;
const
{
onSelect
,
onCheck
,
tableId
,
reference
=
AssetBrowseReference
,
centerId
,
getDirs
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
treeData
,
setTreeData
]
=
useState
([]);
...
@@ -107,6 +107,10 @@ const AssetTree = (props) => {
...
@@ -107,6 +107,10 @@ const AssetTree = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
centerId
])
},
[
centerId
])
useEffect
(()
=>
{
getDirs
?.(
treeData
)
},
[
treeData
])
const
storageChange
=
(
e
)
=>
{
const
storageChange
=
(
e
)
=>
{
if
(
e
.
key
===
'assetDirChangeEvent'
)
{
if
(
e
.
key
===
'assetDirChangeEvent'
)
{
if
((
e
.
dirId
||
''
)
!==
''
)
{
if
((
e
.
dirId
||
''
)
!==
''
)
{
...
@@ -142,7 +146,7 @@ const AssetTree = (props) => {
...
@@ -142,7 +146,7 @@ const AssetTree = (props) => {
getAllDirectoryAsTree
(
true
,
_dirId
)
getAllDirectoryAsTree
(
true
,
_dirId
)
}
else
{
}
else
{
onSelect
?.(
''
,
''
,
false
)
onSelect
?.(
''
,
''
,
false
)
getAllDirectoryAsTree
(
fals
e
)
getAllDirectoryAsTree
(
tru
e
)
}
}
}
}
},
},
...
@@ -456,10 +460,7 @@ const AssetTree = (props) => {
...
@@ -456,10 +460,7 @@ const AssetTree = (props) => {
}
}
const
onTreeSelect
=
(
keys
,
{
node
})
=>
{
const
onTreeSelect
=
(
keys
,
{
node
})
=>
{
if
((
keys
||
[]).
length
===
0
)
{
if
((
keys
||
[]).
length
===
0
)
{
setCurrentDirId
();
onSelect
?.(
''
,
''
,
false
);
return
;
return
;
}
}
...
@@ -597,7 +598,7 @@ const AssetTree = (props) => {
...
@@ -597,7 +598,7 @@ const AssetTree = (props) => {
onSelect
?.(
null
,
null
,
false
);
onSelect
?.(
null
,
null
,
false
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
onSelect
?.(
''
,
''
,
false
);
onSelect
?.(
''
,
''
,
false
);
getAllDirectoryAsTree
(
fals
e
)
getAllDirectoryAsTree
(
tru
e
)
},
100
)
},
100
)
}
}
}
}
style=
{
{
width
:
100
}
}
style=
{
{
width
:
100
}
}
...
...
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