浏览代码

报表单个图表放大

zhuth 6 年之前
父节点
当前提交
79a254cd8a

+ 8 - 2
src/components/dashboardDesigner/viewLayout.jsx

@@ -38,8 +38,14 @@ class ViewLayout extends React.PureComponent {
     createElement = (item, isPreview, reload) => {
         const { code, layout } = item;
 
-        return <div key={code} data-grid={layout}>
-            <ViewLayoutItem item={item} isPreview={isPreview} reload={reload}/>
+        return <div key={code} data-grid={layout} style={{ height: '100%' }}>
+            <ViewLayoutItem
+                item={item}
+                isPreview={isPreview}
+                reload={reload}
+                showPreviewBox={this.showPreviewBox}
+                hidePreviewBox={this.hidePreviewBox}
+            />
         </div>
     }
 

+ 3 - 3
src/components/dashboardDesigner/viewLayoutItem.jsx

@@ -18,7 +18,7 @@ class ViewLayoutItem extends React.Component {
     }
 
     render() {
-        const { dispatch, main, dashboardDesigner, item, isPreview, reload } = this.props;
+        const { dispatch, main, dashboardDesigner, item, isPreview, reload, showPreviewBox, hidePreviewBox } = this.props;
         const { editing, title } = this.state;
         const { currentUser } = main;
         const { dashboardDesignerCode, editMode, minLayoutHeight } = dashboardDesigner;
@@ -78,7 +78,7 @@ class ViewLayoutItem extends React.Component {
                             let pageSize = chartOption ? chartOption.pageSize : (~~((layout.h * minLayoutHeight + (layout.h - 1) * 12 - 20 - 40 - 24 - 8 * 2)/38) + 1)
                             dispatch({ type: 'dashboardDesigner/fetchChartData', item, mandatory: true, page, pageSize });
                         }}/>}
-                        {!isPreview && viewType !== 'richText' && <Icon className={iconCls} type="fullscreen" onClick={() => this.showPreviewBox(item)}/>}
+                        {!isPreview && viewType !== 'richText' && <Icon className={iconCls} type="fullscreen" onClick={() => showPreviewBox(item)}/>}
                         {editMode && !isPreview && (item.creatorCode === currentUser.code || currentUser.role === 'superAdmin') && viewType !== 'richText' &&  <Icon className={iconCls} type='edit' onClick={() => {
                             dispatch({ type: 'dashboard/remoteModify',hideMessage:true });
                             dispatch({ type: 'dashboardDesigner/reset' });
@@ -87,7 +87,7 @@ class ViewLayoutItem extends React.Component {
                         {!isPreview && editMode && <Icon className={iconCls} type='delete' onClick={() => {
                             dispatch({ type: 'dashboardDesigner/deleteItem', item });
                         }} />}
-                        {isPreview && <Icon className={iconCls} type="close" onClick={this.hidePreviewBox}/>}
+                        {isPreview && <Icon className={iconCls} type="close" onClick={hidePreviewBox}/>}
                     </div>
                 </div>
                 <ChartView chartRef={`chartRef-${dashboardDesignerCode}-${code}`} minLayoutHeight={minLayoutHeight} editMode={isPreview ? false : editMode} item={{...item}} reload={reload}/>