|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
import { WidthProvider } from 'react-grid-layout';
|
|
|
var ReactGridLayout = WidthProvider(require('react-grid-layout'));
|
|
|
import '../assets/layoutStyle.less';
|
|
|
-
|
|
|
+import {hashcode} from '../utils/BaseUtils';
|
|
|
import Form from '../src/Form/index.js';
|
|
|
import Table from './Table.jsx';
|
|
|
import Charts from '../src/Charts/ECharts.js';
|
|
|
@@ -43,11 +43,11 @@ class BasicLayout extends React.Component {
|
|
|
return items.map(function (item, i) {
|
|
|
let { type, config } = item;
|
|
|
if (type == 'form') {
|
|
|
- return (<div key={i}><Form theme={theme} themeConfig={themeConfig.form} {...config} /></div>);
|
|
|
+ return (<div key={i}><Form key={hashcode({theme, themeConfig: themeConfig.form, config})} theme={theme} themeConfig={themeConfig.form} {...config} /></div>);
|
|
|
} else if (type == 'table') {
|
|
|
- return (<div key={i}><Table theme={theme} themeConfig={themeConfig.table} {...config} /></div>);
|
|
|
+ return (<div key={i}><Table key={hashcode({theme, themeConfig: themeConfig.table, config})} theme={theme} themeConfig={themeConfig.table} {...config} /></div>);
|
|
|
} else if (type == 'charts') {
|
|
|
- return <div key={i}><Charts theme={theme} themeConfig={themeConfig.charts} {...config} /></div>
|
|
|
+ return <div key={i}><Charts key={hashcode({theme, themeConfig: themeConfig.charts, config})} theme={theme} themeConfig={themeConfig.charts} {...config} /></div>
|
|
|
} else {
|
|
|
return (<div key={i}><span className="text">{i}</span></div>);
|
|
|
}
|