Jelajahi Sumber

指标看板key值关联charCode、chartOption、layout

zhuth 6 tahun lalu
induk
melakukan
00707364f9

+ 1 - 1
src/components/chartDesigner/charts/indicatorView.jsx

@@ -11,7 +11,7 @@ class IndicatorView extends React.Component {
     }
 
     componentDidMount() {
-        this.autoLayout()
+        this.autoLayout();
         window.addEventListener('resize', this.autoLayout);
     }
 

+ 1 - 1
src/components/dashboardDesigner/chartView.jsx

@@ -70,7 +70,7 @@ class ChartView extends React.Component {
                 }else if(['line', 'bar', 'pie', 'scatter'].indexOf(chartType) > -1) {
                     children = (<EchartsView key={`${chartCode}-${layout.w}-${layout.h}`} chartOption={chartOption}/>);
                 }else if(chartType === 'indicator') {
-                    children = (<IndicatorView key={`${chartCode}-${layout.w}-${layout.h}`} chartOption={chartOption}/>);
+                    children = (<IndicatorView key={`${chartCode}-${hashcode(chartOption)}-${layout.w}-${layout.h}`} chartOption={chartOption}/>);
                 }
             }
         }else if(viewType === 'richText') { // 富文本类型

+ 0 - 1
src/components/dashboardDesigner/viewLayout.jsx

@@ -96,7 +96,6 @@ class ViewLayout extends React.PureComponent {
         const { editMode, minLayoutHeight, layoutMargin, theme: themeName } = dashboardDesigner;
         const { visiblePreviewBox, previewItem } = this.state;
         const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption));
-        console.log(contentSize);
         return (<div className={`dashboard-viewcontent ${themeName}`} ref={node => this.viewContentRef = node}>
             <ReactGridLayout
                 width={ contentSize.width }