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', {
......
...@@ -30,8 +30,8 @@ const graphModes = [ ...@@ -30,8 +30,8 @@ const graphModes = [
class Map extends React.Component { class Map extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
type: 'square', type: 'square',
tabKey: '', tabKey: '',
loadingTopics: false, loadingTopics: false,
topics: null topics: null
...@@ -46,9 +46,9 @@ class Map extends React.Component { ...@@ -46,9 +46,9 @@ class Map extends React.Component {
payload: null, payload: null,
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,51 +68,53 @@ class Map extends React.Component { ...@@ -68,51 +68,53 @@ 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 /> : <>
{ {
topics && topics.length>0 && <Tabs loadingTopics ? <Spin /> : <>
activeKey={tabKey} {
size='large' topics && topics.length > 0 && <Tabs
centered activeKey={tabKey}
onChange={this.onTabChange} size='large'
> centered
{ onChange={this.onTabChange}
topics && topics.map((topic) => { >
return ( {
<TabPane tab={topic.name||''} key={topic.id||''}> topics && topics.map((topic) => {
<div className='d-flex px-3' style={{ height: 53, alignItems: 'center' }}> return (
<Radio.Group <TabPane tab={topic.name || ''} key={topic.id || ''}>
value={type} {
onChange={this.onTypeChange} tabKey === topic.id && <div className='map-container' >
style={{ marginLeft: 'auto' }} <MapContent type={type} topic={topic} switchMode={switchMode} {...this.props} />
> </div>
{ }
graphModes && graphModes.map((mode, index) => { </TabPane>
return ( );
<Tooltip key={index} title={mode.title||''} > })
<Radio.Button value={mode.key}>{(mode.title||'').substring(0, 1)}</Radio.Button> }
</Tooltip> </Tabs>
); }
}) </>
}
</Radio.Group>
</div>
{
tabKey===topic.id && <div className='map-container' style={{ padding: '0 10px' }}>
<MapContent type={type} topic={topic} {...this.props} />
</div>
}
</TabPane>
);
})
}
</Tabs>
} }
</>
}
</div> </div>
); );
} }
......
...@@ -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