|
|
@@ -42,7 +42,7 @@ class ViewLayout extends React.PureComponent {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- createElement = (item, isPreview, reload) => {
|
|
|
+ createElement = (item, isPreview, reload, contentSize) => {
|
|
|
const { code, layout } = item;
|
|
|
return <div key={code} data-grid={esMobile ? { x:0, y:50, w:12, h:8, minW: 12, maxW:12, minH:8, maxH:8 } : layout} style={{ height: '100%' }}>
|
|
|
<ViewLayoutItem
|
|
|
@@ -52,6 +52,7 @@ class ViewLayout extends React.PureComponent {
|
|
|
reload={reload}
|
|
|
showPreviewBox={this.showPreviewBox}
|
|
|
hidePreviewBox={this.hidePreviewBox}
|
|
|
+ contentSize={contentSize}
|
|
|
/>
|
|
|
</div>
|
|
|
}
|
|
|
@@ -108,7 +109,7 @@ class ViewLayout extends React.PureComponent {
|
|
|
const { editingKey } = this.state;
|
|
|
const { editMode, minLayoutHeight, layoutMargin, theme: themeName } = dashboardDesigner;
|
|
|
const { visiblePreviewBox, previewItem } = this.state;
|
|
|
- const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption));
|
|
|
+ const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption, contentSize));
|
|
|
return (<div className={`dashboard-viewcontent ${themeName}`} ref={node => this.viewContentRef = node}>
|
|
|
<ReactGridLayout
|
|
|
width={ contentSize.width }
|
|
|
@@ -147,7 +148,7 @@ class ViewLayout extends React.PureComponent {
|
|
|
keyboard={true}
|
|
|
maskClosable={true}
|
|
|
>
|
|
|
- {!!previewItem && this.createElement(dashboardDesigner.items.find(item => item.code === previewItem.code), true, false)}
|
|
|
+ {!!previewItem && this.createElement(dashboardDesigner.items.find(item => item.code === previewItem.code), true, false, {width: document.body.offsetWidth-36*2, height:document.body.offsetHeight - 40})}
|
|
|
</Modal>}
|
|
|
</div>);
|
|
|
}
|