|
|
@@ -117,21 +117,32 @@ class DataSource extends React.Component {
|
|
|
this.setState({ visibleGroupMenu: flag });
|
|
|
}
|
|
|
|
|
|
- getParens = (group) => {
|
|
|
+ getParents = (group) => {
|
|
|
const groupData = this.props.dataSource.groupList;
|
|
|
let pgroups = [group];
|
|
|
let fgroup = groupData.find(g => g.code === group.pcode);
|
|
|
if(fgroup) {
|
|
|
- pgroups = this.getParens(fgroup).concat(pgroups);
|
|
|
+ pgroups = this.getParents(fgroup).concat(pgroups);
|
|
|
}
|
|
|
return pgroups;
|
|
|
}
|
|
|
|
|
|
+ getParentsByCode = (groupCode) => {
|
|
|
+ const groupData = this.props.dataSource.groupList;
|
|
|
+ let group = groupData.find(g => g.code === groupCode);
|
|
|
+ console.log(group);
|
|
|
+ if(group) {
|
|
|
+ return this.getParents(group);
|
|
|
+ }else {
|
|
|
+ return [{ label: '未分组' }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
generateGroupTags = () => {
|
|
|
const { dataSource, dispatch } = this.props;
|
|
|
const { noGroup } = this.state;
|
|
|
const { currentGroup } = dataSource;
|
|
|
- const pGroups = (currentGroup) ? [{ code: '-1', label: '全部分组' }].concat(this.getParens(currentGroup)) : [{ code: '-1', label: '全部分组' }];
|
|
|
+ const pGroups = (currentGroup) ? [{ code: '-1', label: '全部分组' }].concat(this.getParents(currentGroup)) : [{ code: '-1', label: '全部分组' }];
|
|
|
return <Breadcrumb className={`group${noGroup ? ' nogroup' : ''}`} separator=">">
|
|
|
{ pGroups.map(g => (
|
|
|
<Breadcrumb.Item key={g.code}>
|
|
|
@@ -300,6 +311,20 @@ class DataSource extends React.Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
}
|
|
|
+ }, {
|
|
|
+ title: '分组',
|
|
|
+ dataIndex: 'groupCode',
|
|
|
+ key: 'groupCode',
|
|
|
+ width: 100,
|
|
|
+ onCell: () => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ maxWidth: 100,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ render: (text) => <EllipsisTooltip title={this.getParentsByCode(text).map(g => g.label).join('/')}>{this.getParentsByCode(text).map(g => g.label).join('/')}</EllipsisTooltip>,
|
|
|
}, {
|
|
|
title: '数据链接',
|
|
|
dataIndex: 'dbConfig.name',
|
|
|
@@ -318,7 +343,7 @@ class DataSource extends React.Component {
|
|
|
title: '创建人',
|
|
|
dataIndex: 'creatorName',
|
|
|
key: 'creatorName',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
render: (text, record) => {
|
|
|
return (
|
|
|
<span>
|
|
|
@@ -349,7 +374,7 @@ class DataSource extends React.Component {
|
|
|
<Icon type="setting" />
|
|
|
</Dropdown>
|
|
|
),
|
|
|
- width: 50
|
|
|
+ width: 30
|
|
|
}];
|
|
|
|
|
|
return (
|