Commit 5c77df1f by zhaochengxiang

调整资产地图

parent bcb6f26f
...@@ -81,10 +81,6 @@ div[id^='__qiankun_microapp_wrapper_'] { ...@@ -81,10 +81,6 @@ div[id^='__qiankun_microapp_wrapper_'] {
background-color: #ECEEF3 !important; background-color: #ECEEF3 !important;
} }
.yy-tabs-content-holder {
height: 100% !important;
}
.yy-tabs-content, .yy-table { .yy-tabs-content, .yy-table {
height: 100% !important; height: 100% !important;
overflow: auto !important; overflow: auto !important;
......
import React from 'react'; import React from 'react';
import { Row, Col, Breadcrumb, Spin } from 'antd'; import { Row, Col, Breadcrumb, Spin, Slider } from 'antd';
import { HomeOutlined } from '@ant-design/icons'; import { HomeOutlined } from '@ant-design/icons';
import SquareItem from './Component/SquareItem'; import SquareItem from './Component/SquareItem';
...@@ -16,7 +16,7 @@ class MapContent extends React.Component { ...@@ -16,7 +16,7 @@ class MapContent extends React.Component {
super(props); super(props);
this.state = { this.state = {
loading: false, loading: false,
tableModelData: null, // tableModelData: null,
curTableModelData: null, curTableModelData: null,
orgModelData: null, orgModelData: null,
orgChildData: null, orgChildData: null,
...@@ -41,7 +41,7 @@ class MapContent extends React.Component { ...@@ -41,7 +41,7 @@ class MapContent extends React.Component {
this.convertRemoteData(data); this.convertRemoteData(data);
this.setState({ this.setState({
loading: false, loading: false,
tableModelData: data||[], // tableModelData: data||[],
curTableModelData: data||[], curTableModelData: data||[],
breadcrumbContents: [{ data: data||[] }] breadcrumbContents: [{ data: data||[] }]
}, () => { }, () => {
...@@ -166,7 +166,7 @@ class MapContent extends React.Component { ...@@ -166,7 +166,7 @@ class MapContent extends React.Component {
return ( return (
<> <>
{ {
loading ? <Spin /> : <> loading ? <Spin /> : <div className='position-relative' style={{ height: '100%' }}>
{ {
type==='square' && <> type==='square' && <>
{ {
...@@ -189,17 +189,20 @@ class MapContent extends React.Component { ...@@ -189,17 +189,20 @@ class MapContent extends React.Component {
{ {
groups && groups.map((group, index) => { groups && groups.map((group, index) => {
return ( return (
<Row gutter={10} key={index} className={index===0?'':'mt-3'}> <div key={index}>
{ <Row gutter={10} className={index===0?'':'mt-3'}>
group && group.map((item, _index) => { {
return ( group && group.map((item, _index) => {
<Col key={_index} span={24/column}> return (
<SquareItem item={item} onClick={this.onSquareItemClick} {...this.props} /> <Col key={_index} span={24/column}>
</Col> <SquareItem item={item} onClick={this.onSquareItemClick} {...this.props} />
) </Col>
}) )
} })
</Row> }
</Row>
{ (index===groups.length-1) && <div style={{ height: 10 }} /> }
</div>
) )
}) })
} }
...@@ -233,7 +236,21 @@ class MapContent extends React.Component { ...@@ -233,7 +236,21 @@ class MapContent extends React.Component {
{...this.props} {...this.props}
loadMoreData={this.loadMoreData} /> loadMoreData={this.loadMoreData} />
} }
</> {
type!=='square' && <div
className='position-absolute'
style={{
display: 'inline-block',
height: 60,
right: 15,
top: 15
}}
>
<span>层数</span>
<Slider vertical min={1} max={20} />
</div>
}
</div>
} }
</> </>
); );
......
...@@ -4,6 +4,8 @@ import { Tabs, Spin, Select } from 'antd'; ...@@ -4,6 +4,8 @@ import { Tabs, Spin, Select } from 'antd';
import MapContent from './MapContent'; import MapContent from './MapContent';
import { dispatchLatest } from '../../../model'; import { dispatchLatest } from '../../../model';
import './index.less';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { Option } = Select; const { Option } = Select;
...@@ -31,7 +33,7 @@ class Map extends React.Component { ...@@ -31,7 +33,7 @@ class Map extends React.Component {
super(props); super(props);
this.state = { this.state = {
type: 'square', type: 'square',
tabKey: '0', tabKey: '',
loadingTopics: false, loadingTopics: false,
topics: null topics: null
}; };
...@@ -46,7 +48,8 @@ class Map extends React.Component { ...@@ -46,7 +48,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:'',
}); });
}, },
error: () => { error: () => {
...@@ -67,7 +70,7 @@ class Map extends React.Component { ...@@ -67,7 +70,7 @@ class Map extends React.Component {
render() { render() {
const { type, tabKey, topics, loadingTopics } = this.state; const { type, tabKey, topics, loadingTopics } = this.state;
return ( return (
<div style={{ backgroundColor: '#fff', height: '100%' }}> <div className='asset-map' style={{ backgroundColor: '#fff' }}>
{ {
loadingTopics ? <Spin /> : <> loadingTopics ? <Spin /> : <>
{ {
...@@ -75,31 +78,30 @@ class Map extends React.Component { ...@@ -75,31 +78,30 @@ class Map extends React.Component {
activeKey={tabKey} activeKey={tabKey}
size='large' size='large'
centered centered
style={{ height: '100%' }}
tabBarExtraContent={{
left: <div className='ml-3' style={{ width: 120, marginRight: 50 }} ></div>,
right: (
<Select
value={type}
className='mr-3'
style={{ width: 120, marginLeft: 50 }}
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}
> >
{ {
topics && topics.map((topic, index) => { topics && topics.map((topic) => {
return ( return (
<TabPane tab={topic.name||''} key={index.toString()} className='p-3' style={{ height: '100%' }}> <TabPane tab={topic.name||''} key={topic.id||''}>
{ tabKey===index.toString() && <MapContent type={type} topic={topic} {...this.props} /> } <div className='d-flex px-3' style={{ height: 53, alignItems: 'center' }}>
<Select
value={type}
style={{ width: 120, marginLeft: 'auto' }}
onChange={this.onTypeChange}
>
{
graphModes && graphModes.map((mode, index) => {
return <Option key={index} value={mode.key||''}>{mode.title||''}</Option>
})
}
</Select>
</div>
{
tabKey===topic.id && <div className='map-container' style={{ padding: '0 10px' }}>
<MapContent type={type} topic={topic} {...this.props} />
</div>
}
</TabPane> </TabPane>
); );
}) })
......
.asset-map {
height: calc(100vh - 64px - 30px);
.yy-tabs-nav {
margin: 0 !important;
}
.map-container {
height: calc(100vh - 64px - 30px - 57px - 53px) !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