|
|
@@ -8,6 +8,7 @@ import Ellipsis from 'ant-design-pro/lib/Ellipsis'
|
|
|
import 'ant-design-pro/dist/ant-design-pro.css'
|
|
|
import GroupSelector from '../datasource/groupSelector'
|
|
|
import Thumbnail from './thumbnail'
|
|
|
+import DistributeBox from './distributeBox';
|
|
|
const { Content } = Layout
|
|
|
const { Search } = Input
|
|
|
const CardGrid = Card.Grid
|
|
|
@@ -19,7 +20,8 @@ class ChartList extends React.Component {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
selectedRecord: null,
|
|
|
- visibleBox: false,
|
|
|
+ visibleChooseDataSourceBox: false,
|
|
|
+ visibleDistributeBox: false,
|
|
|
visibleGroupMenu: false, // 显示分组菜单
|
|
|
}
|
|
|
}
|
|
|
@@ -60,6 +62,11 @@ class ChartList extends React.Component {
|
|
|
|
|
|
const operationMenu = (
|
|
|
<Menu className='menu-operation'>
|
|
|
+ <Menu.Item onClick={() => {
|
|
|
+ this.setState({visibleDistributeBox: true})
|
|
|
+ }}>
|
|
|
+ <Icon type='share-alt'/>分发
|
|
|
+ </Menu.Item>
|
|
|
<Menu.SubMenu className='setgroupmenu' title={<div><Icon style={{ marginRight: '6px' }} type='profile' />移动到</div>}>
|
|
|
{this.createGroupMenu(selectedRecord)}
|
|
|
</Menu.SubMenu>
|
|
|
@@ -181,7 +188,7 @@ class ChartList extends React.Component {
|
|
|
(p.code+'' === selectedRecord.groupCode+'' ? 'bold' : (
|
|
|
c.find(ch => ch.code+'' === selectedRecord.groupCode+'') && c.find(ch => ch.code+'' === selectedRecord.groupCode+'').pcode === p.code ? 'bold' : 'normal'
|
|
|
))
|
|
|
- : chart.currentGroup[0].code === p.code ? 'bold' : 'normal' }}>{p.label}</span>} onTitleClick={(item) => {
|
|
|
+ : chart.currentGroup[0].code === p.code ? 'bold' : 'normal' }}>{p.label}</span>} onTitleClick={(item) => {
|
|
|
dispatch({ type: 'chart/setCurrentGroup', group1: p });
|
|
|
if(selectedRecord) {
|
|
|
dispatch({ type: 'chart/remoteSetChartGroup', chart: selectedRecord, group: p });
|
|
|
@@ -315,7 +322,7 @@ class ChartList extends React.Component {
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
- const { visibleBox } = this.state;
|
|
|
+ const { visibleChooseDataSourceBox, visibleDistributeBox } = this.state;
|
|
|
const { dispatch, chart } = this.props;
|
|
|
const TAG_COLOR = ['blue'];
|
|
|
return (
|
|
|
@@ -381,14 +388,19 @@ class ChartList extends React.Component {
|
|
|
<Button onClick={() => {
|
|
|
dispatch({ type: 'dataSource/fetchList' });
|
|
|
this.setState({
|
|
|
- visibleBox: true
|
|
|
+ visibleChooseDataSourceBox: true
|
|
|
});
|
|
|
}}>
|
|
|
<Icon type="area-chart" />创建图表
|
|
|
</Button>
|
|
|
- <ChooseDataSourceBox visibleBox={visibleBox} hideBox={() => {
|
|
|
+ <ChooseDataSourceBox visibleChooseDataSourceBox={visibleChooseDataSourceBox} hideBox={() => {
|
|
|
+ this.setState({
|
|
|
+ visibleChooseDataSourceBox: false
|
|
|
+ });
|
|
|
+ }}/>
|
|
|
+ <DistributeBox visibleDistributeBox={visibleDistributeBox} selectedRecord={this.state.selectedRecord} hideBox={() => {
|
|
|
this.setState({
|
|
|
- visibleBox: false
|
|
|
+ visibleDistributeBox: false
|
|
|
});
|
|
|
}}/>
|
|
|
</Col>
|