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
a3bfb14b
Commit
a3bfb14b
authored
Apr 08, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图调整
parent
dce4bc47
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
26 deletions
+64
-26
index.less
src/index.less
+4
-0
Relation.jsx
src/view/Manage/Map/Component/Relation.jsx
+0
-1
SquareItem.less
src/view/Manage/Map/Component/SquareItem.less
+11
-1
MapContent.jsx
src/view/Manage/Map/MapContent.jsx
+8
-11
index.jsx
src/view/Manage/Map/index.jsx
+41
-13
No files found.
src/index.less
View file @
a3bfb14b
...
@@ -84,5 +84,9 @@ div[id^='__qiankun_microapp_wrapper_'] {
...
@@ -84,5 +84,9 @@ div[id^='__qiankun_microapp_wrapper_'] {
background-color: transparent !important;
background-color: transparent !important;
}
}
.yy-card-bordered {
border-color: #333333 !important;
}
src/view/Manage/Map/Component/Relation.jsx
View file @
a3bfb14b
...
@@ -217,7 +217,6 @@ class Relation extends React.Component {
...
@@ -217,7 +217,6 @@ class Relation extends React.Component {
const
nodeId
=
node
.
get
(
'id'
);
const
nodeId
=
node
.
get
(
'id'
);
const
model
=
node
.
getModel
();
const
model
=
node
.
getModel
();
console
.
log
(
'model'
,
model
);
if
(
model
.
dbType
===
'Dir'
)
{
if
(
model
.
dbType
===
'Dir'
)
{
const
children
=
model
.
children
;
const
children
=
model
.
children
;
if
(
!
children
&&
loadMoreData
)
{
if
(
!
children
&&
loadMoreData
)
{
...
...
src/view/Manage/Map/Component/SquareItem.less
View file @
a3bfb14b
.map-square-item {
.map-square-item {
.yy-card-head {
.yy-card-head {
background-color: #f
f4d4
f !important;
background-color: #f
4856
f !important;
.yy-card-head-title {
.yy-card-head-title {
color: #fff !important;
color: #fff !important;
font-size: 20px !important;
font-weight: bold !important;
:hover {
:hover {
color: #1890ff;
color: #1890ff;
}
}
}
}
}
}
.yy-card-body {
p {
color: #1890ff !important;
font-size: 18px !important;
}
}
}
}
\ No newline at end of file
src/view/Manage/Map/MapContent.jsx
View file @
a3bfb14b
...
@@ -94,7 +94,6 @@ class MapContent extends React.Component {
...
@@ -94,7 +94,6 @@ class MapContent extends React.Component {
}
}
onSquareItemClick
=
(
item
)
=>
{
onSquareItemClick
=
(
item
)
=>
{
const
{
tableModelData
}
=
this
.
state
;
if
(
!
item
.
children
)
{
if
(
!
item
.
children
)
{
dispatchLatest
({
dispatchLatest
({
type
:
'map.getTableModelByDirIid'
,
type
:
'map.getTableModelByDirIid'
,
...
@@ -103,14 +102,12 @@ class MapContent extends React.Component {
...
@@ -103,14 +102,12 @@ class MapContent extends React.Component {
this
.
convertRemoteData
(
data
||
[]);
this
.
convertRemoteData
(
data
||
[]);
item
.
children
=
(
data
||
[]);
item
.
children
=
(
data
||
[]);
this
.
setSquareGraphState
(
item
);
this
.
setSquareGraphState
(
item
);
this
.
setAllTreeGraphState
(
tableModelData
);
}
}
})
})
return
;
return
;
}
}
this
.
setSquareGraphState
(
item
);
this
.
setSquareGraphState
(
item
);
this
.
setAllTreeGraphState
(
tableModelData
);
}
}
onBreadcrumbItemClick
=
(
content
,
index
)
=>
{
onBreadcrumbItemClick
=
(
content
,
index
)
=>
{
...
@@ -141,7 +138,7 @@ class MapContent extends React.Component {
...
@@ -141,7 +138,7 @@ class MapContent extends React.Component {
}
}
render
()
{
render
()
{
const
{
diagram
,
topic
}
=
this
.
props
;
const
{
type
,
topic
}
=
this
.
props
;
const
{
curTableModelData
,
breadcrumbContents
,
orgModelData
,
treeModelData
,
relationModelData
,
loading
,
orgChildData
,
treeChildData
,
relationChildData
,
parentNodeId
}
=
this
.
state
;
const
{
curTableModelData
,
breadcrumbContents
,
orgModelData
,
treeModelData
,
relationModelData
,
loading
,
orgChildData
,
treeChildData
,
relationChildData
,
parentNodeId
}
=
this
.
state
;
let
groups
=
[];
let
groups
=
[];
...
@@ -156,7 +153,7 @@ class MapContent extends React.Component {
...
@@ -156,7 +153,7 @@ class MapContent extends React.Component {
{
{
loading
?
<
Spin
/>
:
<>
loading
?
<
Spin
/>
:
<>
{
{
diagram
===
'square'
&&
<>
type
===
'square'
&&
<>
{
{
breadcrumbContents
&&
breadcrumbContents
.
length
>
1
&&
<
Breadcrumb
className=
'mb-3'
>
breadcrumbContents
&&
breadcrumbContents
.
length
>
1
&&
<
Breadcrumb
className=
'mb-3'
>
{
{
...
@@ -194,30 +191,30 @@ class MapContent extends React.Component {
...
@@ -194,30 +191,30 @@ class MapContent extends React.Component {
</>
</>
}
}
{
{
diagram
===
'org'
&&
<
Org
type
===
'org'
&&
<
Org
data=
{
orgModelData
}
data=
{
orgModelData
}
parentNodeId=
{
parentNodeId
}
parentNodeId=
{
parentNodeId
}
childData=
{
orgChildData
}
childData=
{
orgChildData
}
type=
{
`${topic.id||''}${
diagram
}`
}
type=
{
`${topic.id||''}${
type
}`
}
{
...
this
.
props
}
{
...
this
.
props
}
loadMoreData=
{
this
.
loadMoreData
}
loadMoreData=
{
this
.
loadMoreData
}
/>
/>
}
}
{
{
diagram
===
'tree'
&&
<
Tree
type
===
'tree'
&&
<
Tree
data=
{
treeModelData
}
data=
{
treeModelData
}
parentNodeId=
{
parentNodeId
}
parentNodeId=
{
parentNodeId
}
childData=
{
treeChildData
}
childData=
{
treeChildData
}
type=
{
`${topic.id||''}${
diagram
}`
}
type=
{
`${topic.id||''}${
type
}`
}
{
...
this
.
props
}
{
...
this
.
props
}
loadMoreData=
{
this
.
loadMoreData
}
/>
loadMoreData=
{
this
.
loadMoreData
}
/>
}
}
{
{
diagram
===
'relation'
&&
<
Relation
type
===
'relation'
&&
<
Relation
data=
{
relationModelData
}
data=
{
relationModelData
}
parentNodeId=
{
parentNodeId
}
parentNodeId=
{
parentNodeId
}
childData=
{
relationChildData
}
childData=
{
relationChildData
}
type=
{
`${topic.id||''}${
diagram
}`
}
type=
{
`${topic.id||''}${
type
}`
}
{
...
this
.
props
}
{
...
this
.
props
}
loadMoreData=
{
this
.
loadMoreData
}
/>
loadMoreData=
{
this
.
loadMoreData
}
/>
}
}
...
...
src/view/Manage/Map/index.jsx
View file @
a3bfb14b
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Tabs
,
Radio
,
Spin
}
from
'antd'
;
import
{
Tabs
,
Spin
,
Select
}
from
'antd'
;
import
MapContent
from
'./MapContent'
;
import
MapContent
from
'./MapContent'
;
import
{
dispatchLatest
}
from
'../../../model'
;
import
{
dispatchLatest
}
from
'../../../model'
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
const
{
Option
}
=
Select
;
const
graphModes
=
[
{
title
:
'方块图'
,
key
:
'square'
},
{
title
:
'组织图'
,
key
:
'org'
,
},
{
title
:
'树形图'
,
key
:
'tree'
,
},
{
title
:
'关系图'
,
key
:
'relation'
}
];
class
Map
extends
React
.
Component
{
class
Map
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
diagram
:
'square'
,
type
:
'square'
,
tabKey
:
'0'
,
tabKey
:
'0'
,
loadingTopics
:
false
,
loadingTopics
:
false
,
topics
:
null
topics
:
null
...
@@ -36,8 +56,8 @@ class Map extends React.Component {
...
@@ -36,8 +56,8 @@ class Map extends React.Component {
})
})
}
}
on
RadioChange
=
e
=>
{
on
TypeChange
=
valu
e
=>
{
this
.
setState
({
diagram
:
e
.
target
.
value
});
this
.
setState
({
type
:
value
||
''
});
};
};
onTabChange
=
activeKey
=>
{
onTabChange
=
activeKey
=>
{
...
@@ -45,7 +65,7 @@ class Map extends React.Component {
...
@@ -45,7 +65,7 @@ class Map extends React.Component {
}
}
render
()
{
render
()
{
const
{
diagram
,
tabKey
,
topics
,
loadingTopics
}
=
this
.
state
;
const
{
type
,
tabKey
,
topics
,
loadingTopics
}
=
this
.
state
;
return
(
return
(
<
div
style=
{
{
backgroundColor
:
'#fff'
,
height
:
'100%'
}
}
>
<
div
style=
{
{
backgroundColor
:
'#fff'
,
height
:
'100%'
}
}
>
{
{
...
@@ -57,13 +77,21 @@ class Map extends React.Component {
...
@@ -57,13 +77,21 @@ class Map extends React.Component {
centered
centered
style=
{
{
height
:
'100%'
}
}
style=
{
{
height
:
'100%'
}
}
tabBarExtraContent=
{
{
tabBarExtraContent=
{
{
left
:
<
Radio
.
Group
className=
'm-3'
size=
'small'
value=
{
diagram
}
onChange=
{
this
.
onRadioChange
}
>
left
:
<
div
className=
'ml-3'
style=
{
{
width
:
120
,
marginRight
:
50
}
}
></
div
>,
<
Radio
.
Button
value=
'square'
>
方块图
</
Radio
.
Button
>
right
:
(
<
Radio
.
Button
value=
'org'
>
组织图
</
Radio
.
Button
>
<
Select
<
Radio
.
Button
value=
'tree'
>
树形图
</
Radio
.
Button
>
value=
{
type
}
<
Radio
.
Button
value=
'relation'
>
关系图
</
Radio
.
Button
>
className=
'mr-3'
</
Radio
.
Group
>,
style=
{
{
width
:
120
,
marginLeft
:
50
}
}
right
:
<
div
style=
{
{
width
:
172
}
}
></
div
>
onChange=
{
this
.
onTypeChange
}
>
{
graphModes
&&
graphModes
.
map
((
mode
,
index
)
=>
{
return
<
Option
key=
{
index
}
value=
{
mode
.
key
||
''
}
>
{
mode
.
title
||
''
}
</
Option
>
})
}
</
Select
>
)
}
}
}
}
onChange=
{
this
.
onTabChange
}
onChange=
{
this
.
onTabChange
}
>
>
...
@@ -71,7 +99,7 @@ class Map extends React.Component {
...
@@ -71,7 +99,7 @@ class Map extends React.Component {
topics
&&
topics
.
map
((
topic
,
index
)
=>
{
topics
&&
topics
.
map
((
topic
,
index
)
=>
{
return
(
return
(
<
TabPane
tab=
{
topic
.
name
||
''
}
key=
{
index
.
toString
()
}
className=
'p-3'
style=
{
{
height
:
'100%'
}
}
>
<
TabPane
tab=
{
topic
.
name
||
''
}
key=
{
index
.
toString
()
}
className=
'p-3'
style=
{
{
height
:
'100%'
}
}
>
{
tabKey
===
index
.
toString
()
&&
<
MapContent
diagram=
{
diagram
}
topic=
{
topic
}
{
...
this
.
props
}
/>
}
{
tabKey
===
index
.
toString
()
&&
<
MapContent
type=
{
type
}
topic=
{
topic
}
{
...
this
.
props
}
/>
}
</
TabPane
>
</
TabPane
>
);
);
})
})
...
...
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