Browse Source

首页报表切换图标位置错误的问题

zhuth 6 years ago
parent
commit
82bceac956
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/components/dashboardDesigner/layout.jsx

+ 6 - 2
src/components/dashboardDesigner/layout.jsx

@@ -49,8 +49,12 @@ class DashboardDesigner extends React.Component {
 
     render() {
         const { dashboardDesigner, isShareView, isShareKeyView, isViewMode, afterRefresh } = this.props;
-        const { loading } = dashboardDesigner;
-        return <Layout className='layout-dashboarddesigner'>
+        const { code, loading } = dashboardDesigner;
+
+        return <Layout
+            key={code} // 这个key值很重要,因为不同报表中可能引用相同的图表,如果不在报表这一级加上key值区分的话,会造成首页展示切换不同报表时图表位置错误的问题
+            className='layout-dashboarddesigner'
+        >
             {!isShareView && !isShareKeyView && !isViewMode && <Header>
                 <DashboardDesignerHeader />
             </Header>}