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
87b08201
Commit
87b08201
authored
Mar 14, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产可收起关系图
parent
8a5b9af0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
14 deletions
+62
-14
Relation.jsx
src/view/Manage/AssetBrowse/Component/Relation.jsx
+2
-2
RelationContainer.jsx
src/view/Manage/AssetBrowse/Component/RelationContainer.jsx
+2
-2
index.jsx
src/view/Manage/AssetBrowse/index.jsx
+22
-6
index.less
src/view/Manage/AssetBrowse/index.less
+36
-4
No files found.
src/view/Manage/AssetBrowse/Component/Relation.jsx
View file @
87b08201
...
@@ -17,7 +17,7 @@ const secondaryHighlightColors = ['#b36cd1', '#48b5a0', '#4a6acc', '#356eff', '#
...
@@ -17,7 +17,7 @@ const secondaryHighlightColors = ['#b36cd1', '#48b5a0', '#4a6acc', '#356eff', '#
class
Relation
extends
React
.
Component
{
class
Relation
extends
React
.
Component
{
componentDidUpdate
(
prevProps
,
prevState
)
{
componentDidUpdate
(
prevProps
,
prevState
)
{
const
{
data
,
expandTre
e
,
expandId
,
onCenterClick
,
onExpandClick
}
=
this
.
props
;
const
{
data
,
resiz
e
,
expandId
,
onCenterClick
,
onExpandClick
}
=
this
.
props
;
if
(
data
)
{
if
(
data
)
{
if
(
data
!==
prevProps
.
data
)
{
if
(
data
!==
prevProps
.
data
)
{
...
@@ -32,7 +32,7 @@ class Relation extends React.Component {
...
@@ -32,7 +32,7 @@ class Relation extends React.Component {
}
}
}
}
if
(
expandTree
!==
prevProps
.
expandTree
&&
prevProps
.
expandTre
e
!==
null
)
{
if
(
resize
!==
prevProps
.
resize
&&
prevProps
.
resiz
e
!==
null
)
{
if
(
!
this
.
elem
||
!
this
.
elem
.
clientWidth
||
!
this
.
elem
.
clientHeight
)
return
;
if
(
!
this
.
elem
||
!
this
.
elem
.
clientWidth
||
!
this
.
elem
.
clientHeight
)
return
;
this
.
graph
?.
changeSize
(
this
.
elem
.
clientWidth
,
this
.
elem
.
clientHeight
);
this
.
graph
?.
changeSize
(
this
.
elem
.
clientWidth
,
this
.
elem
.
clientHeight
);
...
...
src/view/Manage/AssetBrowse/Component/RelationContainer.jsx
View file @
87b08201
...
@@ -6,7 +6,7 @@ import { AssetBrowseReference, ResourceBrowseReference } from '../../../../util/
...
@@ -6,7 +6,7 @@ import { AssetBrowseReference, ResourceBrowseReference } from '../../../../util/
const
RelationContainer
=
(
props
)
=>
{
const
RelationContainer
=
(
props
)
=>
{
const
{
nodeParams
,
onChange
,
reference
,
expandTre
e
}
=
props
;
const
{
nodeParams
,
onChange
,
reference
,
resiz
e
}
=
props
;
const
[
dirs
,
setDirs
]
=
useState
([]);
const
[
dirs
,
setDirs
]
=
useState
([]);
const
[
nodes
,
setNodes
]
=
useState
([]);
const
[
nodes
,
setNodes
]
=
useState
([]);
...
@@ -192,7 +192,7 @@ const RelationContainer = (props) => {
...
@@ -192,7 +192,7 @@ const RelationContainer = (props) => {
return
(
return
(
<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
position
:
'relative'
}
}
>
<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
position
:
'relative'
}
}
>
<
Relation
data=
{
relationData
}
expandId=
{
nodeParams
?.
expandId
}
expandTree=
{
expandTre
e
}
onCenterClick=
{
onCenterClick
}
onExpandClick=
{
onExpandClick
}
/>
<
Relation
data=
{
relationData
}
expandId=
{
nodeParams
?.
expandId
}
resize=
{
resiz
e
}
onCenterClick=
{
onCenterClick
}
onExpandClick=
{
onExpandClick
}
/>
<
div
className=
'title-text'
style=
{
{
position
:
'absolute'
,
left
:
15
,
top
:
24
,
fontWeight
:
'bold'
}
}
>
关系图
</
div
>
<
div
className=
'title-text'
style=
{
{
position
:
'absolute'
,
left
:
15
,
top
:
24
,
fontWeight
:
'bold'
}
}
>
关系图
</
div
>
</
div
>
</
div
>
);
);
...
...
src/view/Manage/AssetBrowse/index.jsx
View file @
87b08201
...
@@ -18,7 +18,9 @@ const AssetBrowse = (props) => {
...
@@ -18,7 +18,9 @@ const AssetBrowse = (props) => {
const
[
nodeParams
,
setNodeParams
]
=
useState
({
centerId
:
''
,
expandId
:
''
});
const
[
nodeParams
,
setNodeParams
]
=
useState
({
centerId
:
''
,
expandId
:
''
});
const
[
expandTree
,
setExpandTree
]
=
useState
(
true
);
const
[
expandTree
,
setExpandTree
]
=
useState
(
true
);
const
[
expandRelation
,
setExpandRelation
]
=
useState
(
true
);
const
[
assetCount
,
setAssetCount
]
=
useState
(
0
);
const
[
assetCount
,
setAssetCount
]
=
useState
(
0
);
const
[
resizeRelation
,
setResizeRelation
]
=
useState
(
false
);
const
{
centerId
,
expandId
}
=
nodeParams
;
const
{
centerId
,
expandId
}
=
nodeParams
;
...
@@ -28,6 +30,12 @@ const AssetBrowse = (props) => {
...
@@ -28,6 +30,12 @@ const AssetBrowse = (props) => {
const
treeToggleClick
=
()
=>
{
const
treeToggleClick
=
()
=>
{
setExpandTree
(
!
expandTree
);
setExpandTree
(
!
expandTree
);
setResizeRelation
(
!
resizeRelation
);
}
const
relationToggleClick
=
()
=>
{
setExpandRelation
(
!
expandRelation
);
setResizeRelation
(
!
resizeRelation
);
}
}
const
onRelationChange
=
(
data
)
=>
{
const
onRelationChange
=
(
data
)
=>
{
...
@@ -46,7 +54,8 @@ const AssetBrowse = (props) => {
...
@@ -46,7 +54,8 @@ const AssetBrowse = (props) => {
}
}
const
classes
=
classNames
(
'asset-browse'
,
{
const
classes
=
classNames
(
'asset-browse'
,
{
'asset-browse-collapse'
:
!
expandTree
'asset-browse-tree-collapse'
:
!
expandTree
,
'asset-browse-relation-collapse'
:
!
expandRelation
,
});
});
return
(
return
(
...
@@ -61,10 +70,14 @@ const AssetBrowse = (props) => {
...
@@ -61,10 +70,14 @@ const AssetBrowse = (props) => {
<
AssetDirectory
id=
{
nodeId
}
assetCount=
{
assetCount
}
reference=
{
reference
}
/>
<
AssetDirectory
id=
{
nodeId
}
assetCount=
{
assetCount
}
reference=
{
reference
}
/>
<
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'
}
}
>
<
div
style=
{
{
flex
:
1
,
height
:
'100%'
,
overflow
:
'hidden'
}
}
>
{
<
RelationContainer
reference=
{
reference
}
nodeParams=
{
nodeParams
}
onChange=
{
onRelationChange
}
expandTree=
{
expandTree
}
/>
expandRelation
&&
<
React
.
Fragment
>
</
div
>
<
div
style=
{
{
flex
:
1
,
height
:
'100%'
,
overflow
:
'hidden'
}
}
>
<
Separate
width=
{
15
}
/>
<
RelationContainer
reference=
{
reference
}
nodeParams=
{
nodeParams
}
onChange=
{
onRelationChange
}
resize=
{
resizeRelation
}
/>
</
div
>
<
Separate
width=
{
15
}
/>
</
React
.
Fragment
>
}
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
}
}
>
<
div
style=
{
{
flex
:
1
,
overflow
:
'hidden'
}
}
>
<
AssetTable
nodeId=
{
nodeId
}
reference=
{
reference
}
onCountChange=
{
onAssetCountChange
}
{
...
props
}
/>
<
AssetTable
nodeId=
{
nodeId
}
reference=
{
reference
}
onCountChange=
{
onAssetCountChange
}
{
...
props
}
/>
</
div
>
</
div
>
...
@@ -72,7 +85,10 @@ const AssetBrowse = (props) => {
...
@@ -72,7 +85,10 @@ const AssetBrowse = (props) => {
</
div
>
</
div
>
<
div
className=
'tree-toggle'
onClick=
{
treeToggleClick
}
>
<
div
className=
'tree-toggle'
onClick=
{
treeToggleClick
}
>
{
expandTree
?
<
CaretLeftOutlined
/>
:
<
CaretRightOutlined
/>
}
{
expandTree
?
<
CaretLeftOutlined
/>
:
<
CaretRightOutlined
/>
}
</
div
>
</
div
>
<
div
className=
'relation-toggle'
onClick=
{
relationToggleClick
}
>
{
expandRelation
?
<
CaretLeftOutlined
/>
:
<
CaretRightOutlined
/>
}
</
div
>
</
div
>
</
div
>
)
)
}
}
...
...
src/view/Manage/AssetBrowse/index.less
View file @
87b08201
...
@@ -14,10 +14,11 @@
...
@@ -14,10 +14,11 @@
display: flex;
display: flex;
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
left:
245px
;
left:
0
;
right: 0;
right: 0;
background: #f2f5fc;
background: #f2f5fc;
position: absolute;
position: absolute;
left: 245px;
top: calc(50% - 40px);
top: calc(50% - 40px);
width: 12px;
width: 12px;
height: 80px;
height: 80px;
...
@@ -32,9 +33,31 @@
...
@@ -32,9 +33,31 @@
width: calc(100% - 245px);
width: calc(100% - 245px);
flex-direction: column;
flex-direction: column;
}
}
.relation-toggle {
display: flex;
justify-content: center;
align-items: center;
background: #f2f5fc;
position: absolute;
left: calc(50% + 130px);
top: calc(50% - 40px);
width: 12px;
height: 80px;
border-radius: 0 12px 12px 0;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
cursor: pointer;
}
&.asset-browse-relation-collapse {
.relation-toggle {
left: 245px;
}
}
}
}
.asset-browse-collapse {
.asset-browse-
tree-
collapse {
.left {
.left {
width: 0;
width: 0;
}
}
...
@@ -46,4 +69,14 @@
...
@@ -46,4 +69,14 @@
.right {
.right {
width: 100%;
width: 100%;
}
}
}
\ No newline at end of file
.relation-toggle {
left: calc(50% + 7.5px);
}
&.asset-browse-relation-collapse {
.relation-toggle {
left: 0;
}
}
}
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