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
61325f2f
Commit
61325f2f
authored
Jul 15, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图主题变更
parent
f9643645
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
32 deletions
+74
-32
Org.jsx
src/view/Manage/Map/Component/Org.jsx
+3
-2
Tree.jsx
src/view/Manage/Map/Component/Tree.jsx
+2
-2
MapContent.jsx
src/view/Manage/Map/MapContent.jsx
+8
-2
index.jsx
src/view/Manage/Map/index.jsx
+56
-23
index.less
src/view/Manage/Map/index.less
+5
-3
No files found.
src/view/Manage/Map/Component/Org.jsx
View file @
61325f2f
...
...
@@ -7,9 +7,10 @@ const maxTextWidth = 160;
class
Org
extends
React
.
Component
{
componentDidUpdate
(
prevProps
,
prevState
)
{
const
{
childData
,
parentNodeId
}
=
this
.
props
;
const
{
childData
,
parentNodeId
,
data
}
=
this
.
props
;
if
(
parentNodeId
&&
parentNodeId
!==
prevProps
.
parentNodeId
)
{
const
parentData
=
this
.
graph
?.
findDataById
(
parentNodeId
);
if
(
!
parentData
.
children
)
{
parentData
.
children
=
[];
...
...
@@ -23,7 +24,7 @@ class Org extends React.Component {
collapsed
:
false
,
});
}
else
if
(
this
.
p
rops
.
data
&&
parentNodeId
===
null
)
{
}
else
if
(
data
&&
data
!==
prevP
rops
.
data
&&
parentNodeId
===
null
)
{
this
.
graph
?.
destroy
();
this
.
graph
=
init
(
this
)(
this
.
elem
,
this
.
props
.
data
);
}
...
...
src/view/Manage/Map/Component/Tree.jsx
View file @
61325f2f
...
...
@@ -29,7 +29,7 @@ const EXPAND_ICON = function EXPAND_ICON(x, y, r) {
class
Tree
extends
React
.
Component
{
componentDidUpdate
(
prevProps
,
prevState
){
const
{
childData
,
parentNodeId
}
=
this
.
props
;
const
{
childData
,
parentNodeId
,
data
}
=
this
.
props
;
if
(
parentNodeId
&&
parentNodeId
!==
prevProps
.
parentNodeId
)
{
const
parentData
=
this
.
graph
?.
findDataById
(
parentNodeId
);
...
...
@@ -45,7 +45,7 @@ class Tree extends React.Component {
collapsed
:
false
,
});
}
else
if
(
this
.
p
rops
.
data
&&
parentNodeId
===
null
)
{
}
else
if
(
data
&&
data
!==
prevP
rops
.
data
&&
parentNodeId
===
null
)
{
this
.
graph
?.
destroy
();
this
.
graph
=
init
(
this
)(
this
.
elem
,
this
.
props
.
data
);
}
...
...
src/view/Manage/Map/MapContent.jsx
View file @
61325f2f
...
...
@@ -41,10 +41,14 @@ class MapContent extends React.Component {
}
componentDidUpdate
(
prevProps
,
prevState
)
{
const
{
type
}
=
this
.
props
;
const
{
type
,
topic
}
=
this
.
props
;
const
{
currentLevel
}
=
this
.
state
;
if
(
type
!==
prevProps
.
type
)
{
if
(
topic
!==
prevProps
.
topic
)
{
this
.
setState
({
curTableModelData
:
[],
parentNodeId
:
null
,
orgModelData
:
null
,
treeModelData
:
null
,
relationModelData
:
null
},
()
=>
{
this
.
getTreeTotalLevelThenQueryAllDirectoryAsTreeByDirLevel
();
})
}
else
if
(
type
!==
prevProps
.
type
)
{
this
.
setState
({
parentNodeId
:
null
,
orgModelData
:
null
,
treeModelData
:
null
,
relationModelData
:
null
},
()
=>
{
if
(
type
!==
'square'
)
{
this
.
getTreeTotalLevelThenQueryAllDirectoryAsTreeByDirLevel
(
false
,
currentLevel
);
...
...
@@ -97,6 +101,8 @@ class MapContent extends React.Component {
const
_curTableModelData
=
(
_treeData
.
children
||
[]).
filter
(
item
=>
item
.
dbType
!==
'More'
);
if
(
first
)
{
this
.
loadedRowsMap
=
{};
this
.
setState
({
curTableModelData
:
_curTableModelData
,
breadcrumbContents
:
[{
data
:
_treeData
}],
...
...
src/view/Manage/Map/index.jsx
View file @
61325f2f
import
React
from
'react'
;
import
{
Tabs
,
Spin
,
Radio
,
Tooltip
}
from
'antd'
;
import
{
Spin
,
Radio
,
Tooltip
,
Tag
}
from
'antd'
;
import
MapContent
from
'./MapContent'
;
import
{
dispatchLatest
}
from
'../../../model'
;
import
'./index.less'
;
const
{
TabPane
}
=
Tabs
;
const
{
CheckableTag
}
=
Tag
;
const
graphModes
=
[
{
...
...
@@ -34,7 +34,9 @@ class Map extends React.Component {
type
:
'square'
,
tabKey
:
''
,
loadingTopics
:
false
,
topics
:
null
resourceTopics
:
null
,
assetTopics
:
null
,
selectedTopic
:
{}
};
}
...
...
@@ -47,8 +49,9 @@ class Map extends React.Component {
callback
:
data
=>
{
this
.
setState
({
loadingTopics
:
false
,
topics
:
data
||
[],
tabKey
:
(
data
||
[]).
length
>
0
?
data
[
0
].
id
:
''
,
resourceTopics
:
(
data
||
[]).
filter
(
item
=>
(
item
.
code
===
'001'
||
item
.
code
===
'002'
)),
assetTopics
:
(
data
||
[]).
filter
(
item
=>
(
item
.
code
!==
'001'
&&
item
.
code
!==
'002'
)),
selectedTopic
:
(
data
||
[]).
length
>
0
?
data
[
0
]:{}
});
},
error
:
()
=>
{
...
...
@@ -66,8 +69,14 @@ class Map extends React.Component {
this
.
setState
({
tabKey
:
activeKey
});
}
onTagChange
=
(
item
,
checked
)
=>
{
if
(
checked
)
{
this
.
setState
({
selectedTopic
:
item
});
}
}
render
()
{
const
{
type
,
tabKey
,
topics
,
loadingTopics
}
=
this
.
state
;
const
{
type
,
resourceTopics
,
assetTopics
,
loadingTopics
,
selectedTopic
}
=
this
.
state
;
const
switchMode
=
<
div
className=
''
>
<
Radio
.
Group
...
...
@@ -91,28 +100,52 @@ class Map extends React.Component {
<
div
className=
'asset-map'
style=
{
{
backgroundColor
:
'#fff'
}
}
>
{
loadingTopics
?
<
Spin
/>
:
<>
{
topics
&&
topics
.
length
>
0
&&
<
Tabs
animated=
{
false
}
activeKey=
{
tabKey
}
size=
'large'
centered
onChange=
{
this
.
onTabChange
}
>
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
height
:
64
,
borderBottom
:
'1px solid #f0f0f0'
,
margin
:
'0px 10px'
}
}
>
<
div
>
<
span
>
数据资源:
</
span
>
{
resourceTopics
&&
resourceTopics
.
map
(
item
=>
{
return
(
<
CheckableTag
key=
{
item
.
id
}
checked=
{
selectedTopic
?.
id
===
item
.
id
}
onChange=
{
checked
=>
this
.
onTagChange
(
item
,
checked
)
}
>
{
item
.
name
}
</
CheckableTag
>
);
})
}
</
div
>
<
div
>
<
span
>
数据资产:
</
span
>
{
topics
&&
topics
.
map
((
topic
)
=>
{
assetTopics
&&
assetTopics
.
map
(
item
=>
{
return
(
<
TabPane
tab=
{
topic
.
name
||
''
}
key=
{
topic
.
id
||
''
}
>
{
tabKey
===
topic
.
id
&&
<
div
className=
'map-container'
>
<
MapContent
type=
{
type
}
topic=
{
topic
}
switchMode=
{
switchMode
}
{
...
this
.
props
}
/>
</
div
>
}
</
TabPane
>
<
CheckableTag
key=
{
item
.
id
}
checked=
{
selectedTopic
?.
id
===
item
.
id
}
onChange=
{
checked
=>
this
.
onTagChange
(
item
,
checked
)
}
>
{
item
.
name
}
</
CheckableTag
>
);
})
}
</
Tabs
>
}
</
div
>
</
div
>
<
div
className=
'map-container'
>
<
MapContent
type=
{
type
}
topic=
{
selectedTopic
}
switchMode=
{
switchMode
}
{
...
this
.
props
}
/>
</
div
>
</>
}
</
div
>
...
...
src/view/Manage/Map/index.less
View file @
61325f2f
...
...
@@ -4,12 +4,13 @@
height: calc(100vh - @header-height - @pm-4);
.yy-tabs-nav {
margin: 0 !important;
.yy-tag {
font-size: 14px;
margin-right: 2px;
}
.map-container {
height: calc(100vh - @header-height - @pm-4 -
57px/* - 53px */
) !important;
height: calc(100vh - @header-height - @pm-4 -
64px
) !important;
overflow: auto !important;
}
}
\ No newline at end of file
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