|
|
@@ -259,9 +259,6 @@ class ChartList extends React.Component {
|
|
|
{ selectedRecord && (currentUser.code === selectedRecord.creatorCode || currentUser.role === 'superAdmin') && <Menu.SubMenu className='setgroupmenu' title={<div><Icon style={{ marginRight: '6px' }} type='profile' />移动到</div>}>
|
|
|
{[<Menu.Item key='-1' onClick={() => {
|
|
|
dispatch({ type: 'chart/remoteSetGroup', chart: selectedRecord, group: { code: '-1'} });
|
|
|
- // this.setState({
|
|
|
- // noGroup: true
|
|
|
- // });
|
|
|
}}>
|
|
|
{selectedRecord.groupCode === '-1' ? <span className='current' style={{ fontWeight: 'bold' }}>未分组</span> : '未分组'}
|
|
|
</Menu.Item>].concat(this.createGroupMenu(treeData))}
|
|
|
@@ -293,12 +290,13 @@ class ChartList extends React.Component {
|
|
|
const reg = new RegExp('([+ \\- & | ! ( ) { } \\[ \\] ^ \" ~ * ? : ( ) \/])', 'g'); // 需要转义的字符
|
|
|
let filterLabel = chart.filterLabel ? (chart.filterLabel + '').replace(new RegExp('(\\\\)', 'g'), '\\$1').replace(reg, '\\$1') : ''; // 添加转义符号
|
|
|
|
|
|
-
|
|
|
+ console.time('generateCard');
|
|
|
let cards = list.map( (l, i) => (
|
|
|
<CardGrid className={`chart-card`} key={i} onClick={() => {
|
|
|
this.setState({ selectedRecord: l })
|
|
|
}}>
|
|
|
<Card
|
|
|
+ bordered={false}
|
|
|
title={
|
|
|
<Row type='flex' justify='space-between'>
|
|
|
<Col className='label' style={{ overflow: 'hidden', textOverflow: 'ellipsis', padding: '0 16px' }} >
|
|
|
@@ -327,23 +325,8 @@ class ChartList extends React.Component {
|
|
|
</div> : (!l.access ? <div className='deny-body'>
|
|
|
<div className='deny-tip'>无数据权限</div>
|
|
|
</div> : null)}
|
|
|
- <Thumbnail style={{ opacity: (l.access && l.database) ? 1 : 0.3 }} type={l.type} code={l.code} option={l.chartOption}/>
|
|
|
- </Row>
|
|
|
- <Row className='desc'>
|
|
|
- <Ellipsis tooltip={l.description&&l.description.length > 16} lines={2}>{
|
|
|
- <span>
|
|
|
- { (filterItem.name === 'description' && filterLabel) ?
|
|
|
- ((l.description || '').split(new RegExp(`(${filterLabel})`, 'i')).map((fragment, i) => {
|
|
|
- return (
|
|
|
- fragment.toLowerCase().replace(new RegExp('(\\\\)', 'g'), '\\$1').replace(reg, '\\$1') === filterLabel.toLowerCase() ?
|
|
|
- <span key={i} style={{fontWeight: 'bold', color: 'red'}} className="highlight">{fragment}</span> :
|
|
|
- fragment
|
|
|
- )
|
|
|
- }
|
|
|
- )) : l.description
|
|
|
- }
|
|
|
- </span>
|
|
|
- }</Ellipsis>
|
|
|
+ <img className="chart-area" src="https://www.echartsjs.com/examples/data/thumb/line-pen.png" style={{width: '100%', display: 'inline'}} />
|
|
|
+ {/* <Thumbnail style={{ opacity: (l.access && l.database) ? 1 : 0.3 }} type={l.type} code={l.code} option={l.chartOption}/> */}
|
|
|
</Row>
|
|
|
<Row className='footer' type='flex' justify='end' align='bottom'>
|
|
|
<Col style={{ textAlign: 'left', lineHeight: '28px' }} span={21}>
|
|
|
@@ -371,6 +354,7 @@ class ChartList extends React.Component {
|
|
|
</Card>
|
|
|
</CardGrid>
|
|
|
));
|
|
|
+ console.timeEnd('generateCard');
|
|
|
if(cards.length === 0) {
|
|
|
return <EmptyContent />
|
|
|
}
|
|
|
@@ -387,13 +371,6 @@ class ChartList extends React.Component {
|
|
|
title={selectedRecord.groupCode === t.code ? <span className='current' style={{ fontWeight: 'bold' }}>{t.label}</span> : t.label}
|
|
|
onTitleClick={() => {
|
|
|
dispatch({ type: 'chart/remoteSetGroup', chart: selectedRecord, group: t });
|
|
|
- // dispatch({ type: 'chart/setCurrentGroup', group: t });
|
|
|
- // this.setState({noGroup: false})
|
|
|
- // this.setState({
|
|
|
- // page: 1
|
|
|
- // }, () => {
|
|
|
- // this.bodyRef.current.parentNode.scrollTo && this.bodyRef.current.parentNode.scrollTo(0, 0)
|
|
|
- // })
|
|
|
}}
|
|
|
>
|
|
|
{this.createGroupMenu(t.children)}
|
|
|
@@ -401,13 +378,6 @@ class ChartList extends React.Component {
|
|
|
}else {
|
|
|
return <Menu.Item key={t.code} onClick={() => {
|
|
|
dispatch({ type: 'chart/remoteSetGroup', chart: selectedRecord, group: t });
|
|
|
- // dispatch({ type: 'chart/setCurrentGroup', group: t });
|
|
|
- // this.setState({noGroup: false})
|
|
|
- // this.setState({
|
|
|
- // page: 1
|
|
|
- // }, () => {
|
|
|
- // this.bodyRef.current.parentNode.scrollTo && this.bodyRef.current.parentNode.scrollTo(0, 0)
|
|
|
- // })
|
|
|
}}>{selectedRecord.groupCode === t.code ? <span className='current' style={{ fontWeight: 'bold' }}>{t.label}</span> : t.label}</Menu.Item>
|
|
|
}
|
|
|
})
|