Commit 3287dfa9 by zhaochengxiang

数据地图

parent 90accdb2
...@@ -30,7 +30,7 @@ class Tree extends React.Component { ...@@ -30,7 +30,7 @@ class Tree extends React.Component {
], ],
}, },
defaultNode: { defaultNode: {
size: 26, size: 9,
anchorPoints: [ anchorPoints: [
[0, 0.5], [0, 0.5],
[1, 0.5], [1, 0.5],
...@@ -65,7 +65,7 @@ class Tree extends React.Component { ...@@ -65,7 +65,7 @@ class Tree extends React.Component {
// const node = e.item; // const node = e.item;
// const model = node.getModel(); // const model = node.getModel();
history && history.push(`${ContextPath}/home`); // history && history.push(`${ContextPath}/home`);
}); });
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
......
import React from 'react'; import React from 'react';
import { Row, Col, Breadcrumb } from 'antd'; import { Row, Col, Breadcrumb, Spin } from 'antd';
import { HomeOutlined } from '@ant-design/icons'; import { HomeOutlined } from '@ant-design/icons';
import SquareItem from './Component/SquareItem'; import SquareItem from './Component/SquareItem';
...@@ -26,13 +26,13 @@ class MapContent extends React.Component { ...@@ -26,13 +26,13 @@ class MapContent extends React.Component {
componentDidMount() { componentDidMount() {
const { tid } = this.props; const { tid } = this.props;
this.setState({ loadingTableModel: true }, () => { this.setState({ loading: true }, () => {
dispatchLatest({ dispatchLatest({
type: 'map.getTableAndTreeModelByTid', type: 'map.getTableAndTreeModelByTid',
payload: { dirId: tid }, payload: { dirId: tid },
callback: data => { callback: data => {
this.setState({ this.setState({
loadingTableModel: false, loading: false,
tableModelData: data.tables||[], tableModelData: data.tables||[],
curTableModelData: data.tables||[], curTableModelData: data.tables||[],
treeModelData: data.trees||{}, treeModelData: data.trees||{},
...@@ -99,7 +99,7 @@ class MapContent extends React.Component { ...@@ -99,7 +99,7 @@ class MapContent extends React.Component {
render() { render() {
const { diagram, type } = this.props; const { diagram, type } = this.props;
const { curTableModelData, breadcrumbContents, treeModelData, relationModelData } = this.state; const { curTableModelData, breadcrumbContents, treeModelData, relationModelData, loading } = this.state;
let groups = []; let groups = [];
if (curTableModelData) { if (curTableModelData) {
...@@ -111,6 +111,8 @@ class MapContent extends React.Component { ...@@ -111,6 +111,8 @@ class MapContent extends React.Component {
return ( return (
<> <>
{ {
loading ? <Spin /> : <>
{
diagram==='square' && <> diagram==='square' && <>
{ {
breadcrumbContents && breadcrumbContents.length>1 && <Breadcrumb className='mb-3'> breadcrumbContents && breadcrumbContents.length>1 && <Breadcrumb className='mb-3'>
...@@ -155,6 +157,8 @@ class MapContent extends React.Component { ...@@ -155,6 +157,8 @@ class MapContent extends React.Component {
diagram==='relation' && <Relation data={relationModelData} type={type} {...this.props} /> diagram==='relation' && <Relation data={relationModelData} type={type} {...this.props} />
} }
</> </>
}
</>
); );
} }
} }
......
import React from 'react'; import React from 'react';
import { Tabs, Radio } from 'antd'; import { Tabs, Radio, Spin } from 'antd';
import MapContent from './MapContent'; import MapContent from './MapContent';
import { dispatchLatest } from '../../../model'; import { dispatchLatest } from '../../../model';
...@@ -42,10 +42,12 @@ class Map extends React.Component { ...@@ -42,10 +42,12 @@ class Map extends React.Component {
} }
render() { render() {
const { diagram, tabKey, topics } = this.state; const { diagram, tabKey, topics, loadingTopics } = this.state;
return ( return (
<div style={{ backgroundColor: '#fff', height: '100%' }}> <div style={{ backgroundColor: '#fff', height: '100%' }}>
{ {
loadingTopics ? <Spin /> : <>
{
topics && topics.length>0 && <Tabs topics && topics.length>0 && <Tabs
activeKey={tabKey} activeKey={tabKey}
size='large' size='large'
...@@ -72,6 +74,8 @@ class Map extends React.Component { ...@@ -72,6 +74,8 @@ class Map extends React.Component {
} }
</Tabs> </Tabs>
} }
</>
}
</div> </div>
); );
} }
......
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