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
5b5dc228
Commit
5b5dc228
authored
Jun 03, 2021
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finetune background image
parent
f63e025b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
235 additions
and
195 deletions
+235
-195
Relation.jsx
src/view/Manage/Map/Component/Relation.jsx
+61
-43
MapContent.jsx
src/view/Manage/Map/MapContent.jsx
+124
-105
index.jsx
src/view/Manage/Map/index.jsx
+48
-46
index.less
src/view/Manage/Map/index.less
+2
-1
No files found.
src/view/Manage/Map/Component/Relation.jsx
View file @
5b5dc228
...
...
@@ -19,6 +19,8 @@ const colors = [
'#FFD6E7'
,
];
const
highlight
=
'#ff7800'
class
Relation
extends
React
.
Component
{
...
...
@@ -49,12 +51,8 @@ class Relation extends React.Component {
return
(
<
React
.
Fragment
>
<
div
ref=
{
ref
=>
this
.
elem
=
ref
}
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
backgroundImage
:
'linear-gradient(to bottom left,#2e3b4e,#0d0d13 52%,#0d0d13)'
}
}
>
<
div
ref=
{
ref
=>
this
.
elem
=
ref
}
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
}
}
>
</
div
>
<
div
id=
"left-control-container"
></
div
>
<
div
id=
"right-control-container"
></
div
>
<
div
id=
"bottom-bg-container"
></
div
>
</
React
.
Fragment
>
);
...
...
@@ -158,6 +156,16 @@ const init = (ctx) => function (container, data) {
});
});
graph
.
on
(
'edge:mouseenter'
,
(
evt
)
=>
{
const
{
item
}
=
evt
;
graph
.
setItemState
(
item
,
'active'
,
true
);
});
graph
.
on
(
'edge:mouseleave'
,
(
evt
)
=>
{
const
{
item
}
=
evt
;
graph
.
setItemState
(
item
,
'active'
,
false
);
});
// click node to show the detail drawer
graph
.
on
(
'node:click'
,
(
evt
)
=>
{
const
focusNodes
=
graph
.
findAllByState
(
'node'
,
'focus'
);
...
...
@@ -210,7 +218,7 @@ G6.registerNode(
let
r
=
10
,
width1
=
0
,
width2
=
0
,
lineWidth
=
0
if
(
depthCount
[
cfg
.
depth
]
>
10
)
{
r
=
7
r
=
6
}
width1
=
r
*
2.5
width2
=
r
*
4
...
...
@@ -255,7 +263,7 @@ G6.registerNode(
y
:
0
,
r
,
fill
:
colors
[
cfg
.
depth
%
colors
.
length
],
stroke
:
'#ff7800'
,
stroke
:
highlight
,
lineWidth
,
cursor
:
'pointer'
,
},
...
...
@@ -294,14 +302,13 @@ G6.registerNode(
});
}
const
bbox
=
keyShape
.
getBBox
()
// console.debug(bbox)
const
bbox
=
keyShape
.
getBBox
()
if
(
cfg
.
dbType
===
'Root'
||
cfg
.
dbType
===
'Dir'
)
{
if
(
!
cfg
.
children
)
{
group
.
addShape
(
'marker'
,
{
const
marker
=
group
.
addShape
(
'marker'
,
{
attrs
:
{
x
:
bbox
.
maxX
+
3
,
y
:
-
1
,
x
:
0
,
y
:
0
,
r
:
3
,
symbol
:
EXPAND_ICON
,
stroke
:
'#73d13d'
,
...
...
@@ -310,6 +317,9 @@ G6.registerNode(
},
name
:
'add-item'
,
});
const
mbbox
=
marker
.
getBBox
()
// console.debug(bbox, mbbox)
marker
.
moveTo
(
bbox
.
maxX
+
mbbox
.
width
/
2
,
bbox
.
minY
+
mbbox
.
height
)
}
// else if (cfg?.children?.length > 10) {
// group.addShape('marker', {
...
...
@@ -466,43 +476,51 @@ G6.registerEdge(
return
group
;
},
afterDraw
:
(
cfg
,
group
)
=>
{
//
afterDraw: (cfg, group) => {
},
//
},
setState
:
(
name
,
value
,
item
)
=>
{
if
(
name
===
'
focus
'
)
{
const
keyShape
=
item
.
get
(
'keyShape'
);
if
(
name
===
'
active
'
)
{
const
keyShape
=
item
.
get
(
'keyShape'
)
.
get
(
'children'
)[
0
]
;
if
(
value
)
{
if
(
keyShape
.
cfg
.
animating
)
{
return
}
// const length = keyShape.getTotalLength();
// To fix stopAnimate not immediately bug
window
.
setTimeout
(()
=>
{
keyShape
.
animate
(
(
ratio
)
=>
{
// the operations in each frame. Ratio ranges from 0 to 1 indicating the prograss of the animation. Returns the modified configurations
// const startLen = ratio * length;
// Calculate the lineDash
const
cfg
=
{
// lineDash: [startLen, length - startLen],
lineDash
,
lineDashOffset
:
-
Math
.
floor
(
ratio
*
10
),
};
return
cfg
;
},
{
repeat
:
true
,
// Whether executes the animation repeatly
duration
:
1000
,
// the duration for executing once
},
);
},
100
)
keyShape
.
attr
(
'stroke'
,
highlight
);
}
else
{
keyShape
.
stopAnimate
();
keyShape
.
attr
(
'lineDash'
,
null
)
keyShape
.
attr
(
'stroke'
,
'#aaa'
);
}
}
// if (name === 'focus') {
// const keyShape = item.get('keyShape');
// if (value) {
// if (keyShape.cfg.animating) {
// return
// }
// // const length = keyShape.getTotalLength();
// // To fix stopAnimate not immediately bug
// window.setTimeout(() => {
// keyShape.animate(
// (ratio) => {
// // the operations in each frame. Ratio ranges from 0 to 1 indicating the prograss of the animation. Returns the modified configurations
// // const startLen = ratio * length;
// // Calculate the lineDash
// const cfg = {
// // lineDash: [startLen, length - startLen],
// lineDash,
// lineDashOffset: - Math.floor(ratio * 10),
// };
// return cfg;
// },
// {
// repeat: true, // Whether executes the animation repeatly
// duration: 1000, // the duration for executing once
// },
// );
// }, 100)
// } else {
// keyShape.stopAnimate();
// keyShape.attr('lineDash', null)
// }
// }
}
},
// 'single-edge',
...
...
src/view/Manage/Map/MapContent.jsx
View file @
5b5dc228
import
React
from
'react'
;
import
{
Row
,
Col
,
Breadcrumb
,
Slider
}
from
'antd'
;
import
{
Row
,
Col
,
Breadcrumb
,
Slider
,
Select
,
Typography
}
from
'antd'
;
import
{
HomeOutlined
}
from
'@ant-design/icons'
;
import
SquareItem
from
'./Component/SquareItem'
;
...
...
@@ -33,7 +33,7 @@ class MapContent extends React.Component {
this
.
getTreeTotalLevelThenQueryAllDirectoryAsTreeByDirLevel
();
}
componentDidUpdate
(
prevProps
,
prevState
){
componentDidUpdate
(
prevProps
,
prevState
)
{
const
{
type
}
=
this
.
props
;
if
(
type
!==
prevProps
.
type
)
{
...
...
@@ -50,10 +50,10 @@ class MapContent extends React.Component {
callback
:
data
=>
{
const
_totalLevel
=
Number
(
data
);
const
_currentLevel
=
(
_totalLevel
<
3
?
_totalLevel
:
3
);
const
_currentLevel
=
(
_totalLevel
<
3
?
_totalLevel
:
3
);
this
.
setState
({
totalLevel
:
_totalLevel
,
currentLevel
:
_currentLevel
},
()
=>
{
this
.
queryAllDirectoryAsTreeByDirLevel
(
_currentLevel
-
1
);
this
.
queryAllDirectoryAsTreeByDirLevel
(
_currentLevel
-
1
);
});
}
})
...
...
@@ -68,11 +68,11 @@ class MapContent extends React.Component {
callback
:
data
=>
{
this
.
convertRemoteData
(
data
);
const
_treeData
=
this
.
convertTreeModelData
(
data
||
[]);
const
_treeData
=
this
.
convertTreeModelData
(
data
||
[]);
this
.
setState
({
curTableModelData
:
data
||
[],
breadcrumbContents
:
[{
data
:
data
||
[]
}],
curTableModelData
:
data
||
[],
breadcrumbContents
:
[{
data
:
data
||
[]
}],
//深拷贝
orgModelData
:
JSON
.
parse
(
JSON
.
stringify
(
_treeData
)),
treeModelData
:
JSON
.
parse
(
JSON
.
stringify
(
_treeData
)),
...
...
@@ -82,26 +82,26 @@ class MapContent extends React.Component {
})
}
convertRemoteData
=
(
data
,
parentDirId
=
''
)
=>
{
convertRemoteData
=
(
data
,
parentDirId
=
''
)
=>
{
data
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
dbType
===
'Dir'
)
{
item
.
text
=
item
.
dirName
||
''
;
item
.
id
=
`d
${
parentDirId
}${
item
.
dirId
||
''
}${
index
}
`
;
if
(
item
.
dbType
===
'Dir'
)
{
item
.
text
=
item
.
dirName
||
''
;
item
.
id
=
`d
${
parentDirId
}${
item
.
dirId
||
''
}${
index
}
`
;
}
else
{
let
assetCnName
=
''
;
(
item
.
elements
||
[]).
forEach
(
element
=>
{
(
item
.
elements
||
[]).
forEach
(
element
=>
{
if
(
element
.
name
===
'中文名称'
)
{
assetCnName
=
element
.
value
;
}
})
item
.
text
=
assetCnName
||
''
;
item
.
id
=
`t
${
parentDirId
}${
item
.
id
||
''
}${
index
}
`
;
item
.
text
=
assetCnName
||
''
;
item
.
id
=
`t
${
parentDirId
}${
item
.
id
||
''
}${
index
}
`
;
}
if
(
item
.
children
)
{
this
.
convertRemoteData
(
item
.
children
,
item
.
dirId
||
''
);
this
.
convertRemoteData
(
item
.
children
,
item
.
dirId
||
''
);
}
})
}
...
...
@@ -110,7 +110,7 @@ class MapContent extends React.Component {
const
{
topic
}
=
this
.
props
;
return
{
text
:
topic
.
name
||
''
,
text
:
topic
.
name
||
''
,
id
:
`t
${
topic
.
id
}
`
,
dbType
:
'Root'
,
children
:
data
...
...
@@ -121,8 +121,8 @@ class MapContent extends React.Component {
const
{
breadcrumbContents
}
=
this
.
state
;
this
.
setState
({
breadcrumbContents
:
[...
breadcrumbContents
,
{
name
:
item
.
dirName
||
''
,
data
:
item
.
children
||
[]
}],
curTableModelData
:
item
.
children
||
[],
breadcrumbContents
:
[...
breadcrumbContents
,
{
name
:
item
.
dirName
||
''
,
data
:
item
.
children
||
[]
}],
curTableModelData
:
item
.
children
||
[],
});
}
...
...
@@ -133,8 +133,8 @@ class MapContent extends React.Component {
payload
:
{
dirId
:
item
.
dirId
},
callback
:
data
=>
{
this
.
convertRemoteData
(
data
||
[],
item
.
dirId
);
item
.
children
=
(
data
||
[]);
this
.
convertRemoteData
(
data
||
[],
item
.
dirId
);
item
.
children
=
(
data
||
[]);
this
.
setSquareGraphState
(
item
);
}
})
...
...
@@ -148,8 +148,8 @@ class MapContent extends React.Component {
const
{
breadcrumbContents
}
=
this
.
state
;
this
.
setState
({
breadcrumbContents
:
breadcrumbContents
.
splice
(
0
,
index
===
0
?
1
:(
index
+
1
)),
curTableModelData
:
content
.
data
||
[],
breadcrumbContents
:
breadcrumbContents
.
splice
(
0
,
index
===
0
?
1
:
(
index
+
1
)),
curTableModelData
:
content
.
data
||
[],
})
}
...
...
@@ -158,11 +158,11 @@ class MapContent extends React.Component {
type
:
'map.getTableModelByDirIid'
,
payload
:
{
dirId
},
callback
:
data
=>
{
this
.
convertRemoteData
(
data
||
[],
dirId
);
this
.
setState
({
this
.
convertRemoteData
(
data
||
[],
dirId
);
this
.
setState
({
parentNodeId
:
nodeId
,
orgChildData
:
JSON
.
parse
(
JSON
.
stringify
(
data
||
[])),
treeChildData
:
JSON
.
parse
(
JSON
.
stringify
(
data
||
[])),
orgChildData
:
JSON
.
parse
(
JSON
.
stringify
(
data
||
[])),
treeChildData
:
JSON
.
parse
(
JSON
.
stringify
(
data
||
[])),
relationChildData
:
JSON
.
parse
(
JSON
.
stringify
(
data
)),
});
}
...
...
@@ -171,105 +171,124 @@ class MapContent extends React.Component {
onLevelChange
=
(
value
)
=>
{
this
.
setState
({
currentLevel
:
value
},
()
=>
{
this
.
queryAllDirectoryAsTreeByDirLevel
(
value
-
1
);
this
.
queryAllDirectoryAsTreeByDirLevel
(
value
-
1
);
});
}
render
()
{
const
{
type
,
topic
}
=
this
.
props
;
const
{
curTableModelData
,
breadcrumbContents
,
orgModelData
,
treeModelData
,
relationModelData
,
orgChildData
,
treeChildData
,
relationChildData
,
parentNodeId
,
currentLevel
,
totalLevel
}
=
this
.
state
;
const
{
type
,
topic
,
switchMode
}
=
this
.
props
;
const
{
curTableModelData
,
breadcrumbContents
,
orgModelData
,
treeModelData
,
relationModelData
,
orgChildData
,
treeChildData
,
relationChildData
,
parentNodeId
,
currentLevel
,
totalLevel
}
=
this
.
state
;
let
groups
=
[];
if
(
curTableModelData
)
{
for
(
var
i
=
0
;
i
<
curTableModelData
.
length
;
i
+=
column
)
{
groups
.
push
(
curTableModelData
.
slice
(
i
,
i
+
column
));
for
(
var
i
=
0
;
i
<
curTableModelData
.
length
;
i
+=
column
)
{
groups
.
push
(
curTableModelData
.
slice
(
i
,
i
+
column
));
}
}
return
(
<
div
className=
'position-relative'
style=
{
{
height
:
'100%'
,
overflow
:
'hidden'
}
}
>
{
type
===
'square'
&&
<>
{
breadcrumbContents
&&
breadcrumbContents
.
length
>
1
&&
<
Breadcrumb
className=
'mb-3'
>
{
breadcrumbContents
.
map
((
content
,
index
)
=>
{
return
(
<
Breadcrumb
.
Item
key=
{
index
}
>
{
index
===
0
?
<
HomeOutlined
onClick=
{
()
=>
{
this
.
onBreadcrumbItemClick
(
content
,
index
);
}
}
/>
:
((
index
===
breadcrumbContents
.
length
-
1
)
?
<
span
>
{
content
.
name
||
''
}
</
span
>
:
<
span
className=
'pointer'
onClick=
{
()
=>
{
this
.
onBreadcrumbItemClick
(
content
,
index
);
}
}
>
{
content
.
name
||
''
}
</
span
>)
}
</
Breadcrumb
.
Item
>
)
})
}
</
Breadcrumb
>
}
if
(
type
===
'square'
)
{
return
(
<
div
className=
'position-relative p-3'
style=
{
{
height
:
'100%'
}
}
>
{
groups
&&
groups
.
map
((
group
,
index
)
=>
{
return
(
<
div
key=
{
index
}
>
<
Row
gutter=
{
10
}
className=
{
index
===
0
?
''
:
'mt-3'
}
>
type
===
'square'
&&
<>
<
div
className=
"text-right mb-3"
>
{
switchMode
}
</
div
>
{
breadcrumbContents
&&
breadcrumbContents
.
length
>
1
&&
<
Breadcrumb
className=
'mb-3'
>
{
group
&&
group
.
map
((
item
,
_
index
)
=>
{
breadcrumbContents
.
map
((
content
,
index
)
=>
{
return
(
<
Col
key=
{
_index
}
span=
{
24
/
column
}
>
<
SquareItem
item=
{
item
}
index=
{
(
index
*
column
+
_index
)
}
onClick=
{
this
.
onSquareItemClick
}
{
...
this
.
props
}
/>
</
Col
>
<
Breadcrumb
.
Item
key=
{
index
}
>
{
index
===
0
?
<
HomeOutlined
onClick=
{
()
=>
{
this
.
onBreadcrumbItemClick
(
content
,
index
);
}
}
/>
:
((
index
===
breadcrumbContents
.
length
-
1
)
?
<
span
>
{
content
.
name
||
''
}
</
span
>
:
<
span
className=
'pointer'
onClick=
{
()
=>
{
this
.
onBreadcrumbItemClick
(
content
,
index
);
}
}
>
{
content
.
name
||
''
}
</
span
>)
}
</
Breadcrumb
.
Item
>
)
})
}
</
Row
>
{
(
index
===
groups
.
length
-
1
)
&&
<
div
style=
{
{
height
:
10
}
}
/>
}
</
div
>
)
})
</
Breadcrumb
>
}
{
groups
&&
groups
.
map
((
group
,
index
)
=>
{
return
(
<
div
key=
{
index
}
>
<
Row
gutter=
{
10
}
className=
{
index
===
0
?
''
:
'mt-3'
}
>
{
group
&&
group
.
map
((
item
,
_index
)
=>
{
return
(
<
Col
key=
{
_index
}
span=
{
24
/
column
}
>
<
SquareItem
item=
{
item
}
index=
{
(
index
*
column
+
_index
)
}
onClick=
{
this
.
onSquareItemClick
}
{
...
this
.
props
}
/>
</
Col
>
)
})
}
</
Row
>
{
(
index
===
groups
.
length
-
1
)
&&
<
div
style=
{
{
height
:
10
}
}
/>
}
</
div
>
)
})
}
</>
}
</>
}
{
type
===
'org'
&&
<
Org
data=
{
orgModelData
}
parentNodeId=
{
parentNodeId
}
childData=
{
orgChildData
}
type=
{
`${topic.id||''}${type}`
}
loadMoreData=
{
this
.
loadMoreData
}
/>
}
{
type
===
'tree'
&&
<
Tree
data=
{
treeModelData
}
parentNodeId=
{
parentNodeId
}
childData=
{
treeChildData
}
type=
{
`${topic.id||''}${type}`
}
loadMoreData=
{
this
.
loadMoreData
}
/>
}
{
type
===
'relation'
&&
<
Relation
data=
{
relationModelData
}
parentNodeId=
{
parentNodeId
}
childData=
{
relationChildData
}
type=
{
`${topic.id||''}${type}`
}
loadMoreData=
{
this
.
loadMoreData
}
/>
}
{
type
!==
'square'
&&
<
div
className=
'position-absolute'
style=
{
{
display
:
'inline-block'
,
height
:
60
,
right
:
15
,
top
:
15
</
div
>
);
}
else
{
return
(
<
div
className=
'position-relative'
style=
{
{
height
:
'100%'
,
overflow
:
'hidden'
,
backgroundImage
:
'linear-gradient(to bottom left,#2e3b4e,#0d0d13 52%,#0d0d13)'
}
}
>
{
type
===
'org'
&&
<
Org
data=
{
orgModelData
}
parentNodeId=
{
parentNodeId
}
childData=
{
orgChildData
}
type=
{
`${topic.id || ''}${type}`
}
loadMoreData=
{
this
.
loadMoreData
}
/>
}
{
type
===
'tree'
&&
<
Tree
data=
{
treeModelData
}
parentNodeId=
{
parentNodeId
}
childData=
{
treeChildData
}
type=
{
`${topic.id || ''}${type}`
}
loadMoreData=
{
this
.
loadMoreData
}
/>
}
{
type
===
'relation'
&&
<
Relation
data=
{
relationModelData
}
parentNodeId=
{
parentNodeId
}
childData=
{
relationChildData
}
type=
{
`${topic.id || ''}${type}`
}
loadMoreData=
{
this
.
loadMoreData
}
/>
}
<
div
className=
'position-absolute text-right p-3'
style=
{
{
display
:
'block'
,
right
:
0
,
top
:
0
}
}
>
<
span
>
层数
</
span
>
<
Slider
vertical
min=
{
1
}
max=
{
totalLevel
}
value=
{
currentLevel
}
onChange=
{
this
.
onLevelChange
}
/>
{
switchMode
}
<
div
className=
"mt-3"
>
<
Typography
.
Text
className=
"mr-2"
style=
{
{
color
:
'#fff'
}
}
>
层数
</
Typography
.
Text
>
{
/* <Slider vertical min={1} max={totalLevel} value={currentLevel} onChange={this.onLevelChange} /> */
}
<
Select
value=
{
currentLevel
}
onChange=
{
this
.
onLevelChange
}
size=
"small"
>
{
Array
.
from
(
new
Array
(
totalLevel
)).
map
((
_
,
i
)
=>
<
Select
.
Option
key=
{
i
}
value=
{
i
}
>
{
i
}
</
Select
.
Option
>)
}
</
Select
>
</
div
>
</
div
>
}
</
div
>
);
<
div
id=
"left-control-container"
></
div
>
<
div
id=
"right-control-container"
></
div
>
<
div
id=
"bottom-bg-container"
></
div
>
</
div
>
)
}
}
}
...
...
src/view/Manage/Map/index.jsx
View file @
5b5dc228
...
...
@@ -30,8 +30,8 @@ const graphModes = [
class
Map
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
type
:
'square'
,
this
.
state
=
{
type
:
'square'
,
tabKey
:
''
,
loadingTopics
:
false
,
topics
:
null
...
...
@@ -46,9 +46,9 @@ class Map extends React.Component {
payload
:
null
,
callback
:
data
=>
{
this
.
setState
({
loadingTopics
:
false
,
topics
:
data
||
[],
tabKey
:
(
data
||
[]).
length
>
0
?
data
[
0
].
id
:
''
,
loadingTopics
:
false
,
topics
:
data
||
[],
tabKey
:
(
data
||
[]).
length
>
0
?
data
[
0
].
id
:
''
,
});
},
error
:
()
=>
{
...
...
@@ -68,51 +68,53 @@ class Map extends React.Component {
render
()
{
const
{
type
,
tabKey
,
topics
,
loadingTopics
}
=
this
.
state
;
const
switchMode
=
<
div
className=
''
>
<
Radio
.
Group
value=
{
type
}
onChange=
{
this
.
onTypeChange
}
size=
"small"
>
{
graphModes
&&
graphModes
.
map
((
mode
,
index
)
=>
{
return
(
<
Tooltip
key=
{
index
}
title=
{
mode
.
title
||
''
}
>
<
Radio
.
Button
value=
{
mode
.
key
}
>
{
(
mode
.
title
||
''
).
substring
(
0
,
1
)
}
</
Radio
.
Button
>
</
Tooltip
>
);
})
}
</
Radio
.
Group
>
</
div
>
return
(
<
div
className=
'asset-map'
style=
{
{
backgroundColor
:
'#fff'
}
}
>
{
loadingTopics
?
<
Spin
/>
:
<>
{
topics
&&
topics
.
length
>
0
&&
<
Tabs
activeKey=
{
tabKey
}
size=
'large'
centered
onChange=
{
this
.
onTabChange
}
>
{
topics
&&
topics
.
map
((
topic
)
=>
{
return
(
<
TabPane
tab=
{
topic
.
name
||
''
}
key=
{
topic
.
id
||
''
}
>
<
div
className=
'd-flex px-3'
style=
{
{
height
:
53
,
alignItems
:
'center'
}
}
>
<
Radio
.
Group
value=
{
type
}
onChange=
{
this
.
onTypeChange
}
style=
{
{
marginLeft
:
'auto'
}
}
>
{
graphModes
&&
graphModes
.
map
((
mode
,
index
)
=>
{
return
(
<
Tooltip
key=
{
index
}
title=
{
mode
.
title
||
''
}
>
<
Radio
.
Button
value=
{
mode
.
key
}
>
{
(
mode
.
title
||
''
).
substring
(
0
,
1
)
}
</
Radio
.
Button
>
</
Tooltip
>
);
})
}
</
Radio
.
Group
>
</
div
>
{
tabKey
===
topic
.
id
&&
<
div
className=
'map-container'
style=
{
{
padding
:
'0 10px'
}
}
>
<
MapContent
type=
{
type
}
topic=
{
topic
}
{
...
this
.
props
}
/>
</
div
>
}
</
TabPane
>
);
})
}
</
Tabs
>
loadingTopics
?
<
Spin
/>
:
<>
{
topics
&&
topics
.
length
>
0
&&
<
Tabs
activeKey=
{
tabKey
}
size=
'large'
centered
onChange=
{
this
.
onTabChange
}
>
{
topics
&&
topics
.
map
((
topic
)
=>
{
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
>
);
})
}
</
Tabs
>
}
</>
}
</>
}
</
div
>
);
}
...
...
src/view/Manage/Map/index.less
View file @
5b5dc228
...
...
@@ -7,7 +7,7 @@
}
.map-container {
height: calc(100vh - 64px - 30px - 57px
- 53px
) !important;
height: calc(100vh - 64px - 30px - 57px
/* - 53px */
) !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