|
|
@@ -35,7 +35,6 @@ class ChartList extends React.Component {
|
|
|
visibleDeleteBox: false,
|
|
|
visibleGroupManageMentBox: false, // 显示分组管理组件
|
|
|
visibleDataPreviewBox: false,
|
|
|
- noGroup: false, // 显示未分组数据
|
|
|
}
|
|
|
this.bodyRef = React.createRef();
|
|
|
}
|
|
|
@@ -78,8 +77,7 @@ class ChartList extends React.Component {
|
|
|
|
|
|
onFilterAndGroup = cardList => {
|
|
|
const { chart } = this.props;
|
|
|
- const { noGroup } = this.state;
|
|
|
- const { filterItem, currentGroup } = chart;
|
|
|
+ const { filterItem, currentGroup, noGroup } = chart;
|
|
|
const reg = new RegExp('([+ \\- & | ! ( ) { } \\[ \\] ^ \" ~ * ? : ( ) \/])', 'g'); // 需要转义的字符
|
|
|
let filterLabel = chart.filterLabel ? (chart.filterLabel + '').replace(new RegExp('(\\\\)', 'g'), '\\$1').replace(reg, '\\$1') : ''; // 添加转义符号
|
|
|
let filterReg = new RegExp('(' + filterLabel + '){1}', 'ig');
|
|
|
@@ -148,8 +146,7 @@ class ChartList extends React.Component {
|
|
|
|
|
|
generateGroupTags = () => {
|
|
|
const { chart, dispatch } = this.props;
|
|
|
- const { noGroup } = this.state;
|
|
|
- const { currentGroup } = chart;
|
|
|
+ const { currentGroup, noGroup } = chart;
|
|
|
const pGroups = currentGroup ? [{ code: '-1', label: '全部分组' }].concat(this.getParens(currentGroup)) : [{ code: '-1', label: '全部分组' }];
|
|
|
return <Breadcrumb className={`group${noGroup ? ' nogroup' : ''}`} separator=">">
|
|
|
{ pGroups.map(g => (
|
|
|
@@ -364,8 +361,8 @@ class ChartList extends React.Component {
|
|
|
|
|
|
render() {
|
|
|
const { dispatch, chart } = this.props;
|
|
|
- const { listLoading } = chart;
|
|
|
- const { visibleChooseDataSourceBox, visibleDistributeBox, visibleGroupManageMentBox, visibleTransferBox, visibleDeleteBox, selectedRecord, noGroup } = this.state;
|
|
|
+ const { listLoading, noGroup } = chart;
|
|
|
+ const { visibleChooseDataSourceBox, visibleDistributeBox, visibleGroupManageMentBox, visibleTransferBox, visibleDeleteBox, selectedRecord } = this.state;
|
|
|
let viewList = this.onFilter();
|
|
|
// let viewList = this.onPage(reduceList);
|
|
|
// let viewList = reduceList;
|
|
|
@@ -377,11 +374,8 @@ class ChartList extends React.Component {
|
|
|
<Row className='tools' type='flex' justify='space-between'>
|
|
|
<Col className="groups" style={{ display: 'flex', width: 'calc(100% - 324px)', overflow: 'hidden' }}>
|
|
|
<Checkbox style={{ marginTop: '4px' }} checked={noGroup} onChange={(e) => {
|
|
|
- this.setState({
|
|
|
- noGroup: e.target.checked,
|
|
|
- }, () => {
|
|
|
- this.bodyRef.current.parentNode.scrollTo && this.bodyRef.current.parentNode.scrollTo(0, 0)
|
|
|
- })
|
|
|
+ dispatch({ type: 'chart/setField', name: 'noGroup', value: e.target.checked });
|
|
|
+ this.bodyRef.current.parentNode.scrollTo && this.bodyRef.current.parentNode.scrollTo(0, 0)
|
|
|
}}><span className="nogroup">未分组</span></Checkbox>
|
|
|
{ this.generateGroupTags() }
|
|
|
</Col>
|