Commit 12bc56c5 by zhaochengxiang

Merge branch 'dev-2106' into 'master'

Dev 2106

See merge request !1
parents d8648343 5ce9dced
...@@ -196,6 +196,8 @@ G6.registerNode( ...@@ -196,6 +196,8 @@ G6.registerNode(
visible: false, visible: false,
}); });
} }
width1 = r * 2.5
width2 = r * 4
if (depthCount[cfg.depth] > 10) { if (depthCount[cfg.depth] > 10) {
group.addShape('image', { group.addShape('image', {
......
...@@ -47,8 +47,8 @@ class Map extends React.Component { ...@@ -47,8 +47,8 @@ class Map extends React.Component {
callback: data => { callback: data => {
this.setState({ this.setState({
loadingTopics: false, loadingTopics: false,
topics: data||[], topics: data || [],
tabKey: (data||[]).length>0?data[0].id:'', tabKey: (data || []).length > 0 ? data[0].id : '',
}); });
}, },
error: () => { error: () => {
...@@ -68,12 +68,31 @@ class Map extends React.Component { ...@@ -68,12 +68,31 @@ class Map extends React.Component {
render() { render() {
const { type, tabKey, topics, loadingTopics } = this.state; 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 ( return (
<div className='asset-map' style={{ backgroundColor: '#fff' }}> <div className='asset-map' style={{ backgroundColor: '#fff' }}>
{ {
loadingTopics ? <Spin /> : <> loadingTopics ? <Spin /> : <>
{ {
topics && topics.length>0 && <Tabs topics && topics.length > 0 && <Tabs
activeKey={tabKey} activeKey={tabKey}
size='large' size='large'
centered centered
...@@ -82,27 +101,10 @@ class Map extends React.Component { ...@@ -82,27 +101,10 @@ class Map extends React.Component {
{ {
topics && topics.map((topic) => { topics && topics.map((topic) => {
return ( return (
<TabPane tab={topic.name||''} key={topic.id||''}> <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' }}> tabKey === topic.id && <div className='map-container' >
<MapContent type={type} topic={topic} {...this.props} /> <MapContent type={type} topic={topic} switchMode={switchMode} {...this.props} />
</div> </div>
} }
</TabPane> </TabPane>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
} }
.map-container { .map-container {
height: calc(100vh - 64px - 30px - 57px - 53px) !important; height: calc(100vh - 64px - 30px - 57px/* - 53px */) !important;
overflow: auto !important; overflow: auto !important;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment