|
|
@@ -4,7 +4,6 @@ import ReactGridLayout from 'react-grid-layout'
|
|
|
import { Modal } from 'antd'
|
|
|
import { connect } from 'dva'
|
|
|
import EmptyContent from '../common/emptyContent/index'
|
|
|
-import DataPreview from '../common/dataPreview/dataPreview';
|
|
|
import { hashcode } from '../../utils/baseUtils'
|
|
|
import ViewLayoutItem from './viewLayoutItem';
|
|
|
|
|
|
@@ -36,8 +35,8 @@ class ViewLayout extends React.Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- createElement = (item, isPreview, reload, contentSize) => {
|
|
|
- const { dashboardDesigner, esMobile } = this.props;
|
|
|
+ createElement = (item, isPreview, reload, contentSize, esMobile) => {
|
|
|
+ const { dashboardDesigner } = this.props;
|
|
|
const { maxLayoutW } = dashboardDesigner;
|
|
|
const { code, layout } = item;
|
|
|
return <div key={code} data-grid={esMobile ? { x:0, y:50, w: maxLayoutW, h:8, minW: maxLayoutW, maxW: maxLayoutW, minH:8, maxH:8 } : layout} style={{ height: '100%' }}>
|
|
|
@@ -116,7 +115,7 @@ class ViewLayout extends React.Component {
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
- const { dashboardDesigner, contentSize, esMobile, dispatch } = this.props;
|
|
|
+ const { dashboardDesigner, contentSize, esMobile } = this.props;
|
|
|
const { editingKey } = this.state;
|
|
|
const { editMode, minLayoutHeight, maxLayoutW, layoutMargin, theme: themeName } = dashboardDesigner;
|
|
|
const { visiblePreviewBox, previewItem } = this.state;
|
|
|
@@ -140,16 +139,7 @@ class ViewLayout extends React.Component {
|
|
|
<EmptyContent />
|
|
|
</div> : children}
|
|
|
</ReactGridLayout>
|
|
|
- {visiblePreviewBox && previewItem.chartType === 'dataView' && <DataPreview
|
|
|
- modalClassName={`${themeName} ${esMobile ? 'mobile' : ''}`}
|
|
|
- title={previewItem.name}
|
|
|
- visibleBox={visiblePreviewBox}
|
|
|
- hideBox={this.hidePreviewBox}
|
|
|
- fetchFunction={(page, pageSize) => {
|
|
|
- dispatch({ type: 'dashboardDesigner/fetchDataList', item: previewItem, mandatory: true, page, pageSize });
|
|
|
- }}
|
|
|
- />}
|
|
|
- {visiblePreviewBox && previewItem.chartType !== 'dataView' && <Modal
|
|
|
+ {visiblePreviewBox && <Modal
|
|
|
className={`previewbox ${themeName} ${esMobile ? 'mobile' : ''}`}
|
|
|
width={'100%'}
|
|
|
height={'100%'}
|