Browse Source

报表分享界面标识控制

zhuth 6 years ago
parent
commit
bcecbd4c6f

+ 5 - 5
src/components/dashboardDesigner/content.jsx

@@ -53,7 +53,7 @@ class DashboardDesignerContent extends React.Component {
     }
 
     getContentSize = () => {
-        const { dashboardDesigner, isOwner, isShareView } = this.props;
+        const { dashboardDesigner, isOwner, isShareView, isShareKeyView } = this.props;
         const { editMode } = dashboardDesigner;
         let contentEl = document.getElementsByClassName('viewlayout')[0];
         if(!contentEl) {
@@ -65,7 +65,7 @@ class DashboardDesignerContent extends React.Component {
         let _scroll = contentEl.scrollHeight > contentEl.clientHeight;
 
         return {
-            width: document.body.offsetWidth - 20 - ((isOwner && editMode && !isShareView) ? 200 : 0) - 10 - (_scroll ? 17 : 2), // 有滚动条时需要减去滚动条的宽度
+            width: document.body.offsetWidth - 20 - ((isOwner && editMode && !isShareView && !isShareKeyView) ? 200 : 0) - 10 - (_scroll ? 17 : 2), // 有滚动条时需要减去滚动条的宽度
             height: contentEl.clientHeight
         }
     }
@@ -144,7 +144,7 @@ class DashboardDesignerContent extends React.Component {
     }
 
     render() {
-        const { dashboardDesigner, isOwner, isShareView } = this.props;
+        const { dashboardDesigner, isOwner, isShareView, isShareKeyView } = this.props;
         const { code, editMode, filters } = dashboardDesigner;
         const { visibleFilterBox } = this.state;
 
@@ -183,11 +183,11 @@ class DashboardDesignerContent extends React.Component {
             </Header>
             <Content className='dashboard-content'>
                 <Layout className='content-layout'>
-                    <Sider className={`config-sider${ (isOwner && editMode) ? '' : ' config-sider-closed' }`} width={(isOwner && editMode && !isShareView) ? 200 : 0}>
+                    <Sider className={`config-sider${ (isOwner && editMode) ? '' : ' config-sider-closed' }`} width={(isOwner && editMode && !isShareView && !isShareKeyView) ? 200 : 0}>
                         <ConfigSider/>
                     </Sider>
                     <Content className='viewlayout'>
-                        <ViewLayout isOwner={isOwner} isShareView={isShareView} contentSize={contentSize} editMode={editMode}/>
+                        <ViewLayout isOwner={isOwner} isShareView={isShareView} isShareKeyView={isShareKeyView} contentSize={contentSize} editMode={editMode}/>
                     </Content>
                 </Layout>
             </Content>

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

@@ -49,14 +49,14 @@ class DashboardDesigner extends React.Component {
     }
 
     render() {
-        const { dashboardDesigner, isShareView } = this.props;
+        const { dashboardDesigner, isShareView, isShareKeyView } = this.props;
         const { loading } = dashboardDesigner;
         return <Layout className='dashboarddesigner-layout'>
-            {!isShareView && <Header>
+            {!isShareView && !isShareKeyView && <Header>
                 <DashboardDesignerHeader updateThumbnail={this.updateThumbnail} />
             </Header>}
             <Content style={{ height: 0 }}>
-                <DashboardDesignerContent isOwner={this.isOwner()} isShareView={isShareView}/>
+                <DashboardDesignerContent isOwner={this.isOwner()} isShareView={isShareView} isShareKeyView={isShareKeyView}/>
             </Content>
             <div style={{ display: loading ? 'block' : 'none', position: 'absolute', height: '100%', width: '100%', zIndex: '4', background: 'rgba(51,51,51,.1)' }}>
                 <Spin style={{ display: 'inline-block', position: 'absolute', top: '50%', left: '50%', margin: '-10px' }} indicator={<Icon type="loading" style={{ fontSize: 24 }} spin />} />

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

@@ -83,7 +83,7 @@ class ViewLayout extends React.PureComponent {
     }
 
     render() {
-        const { isOwner, isShareView, dashboardDesigner, contentSize } = this.props;
+        const { isOwner, isShareView, isShareKeyView, dashboardDesigner, contentSize } = this.props;
         const { editMode } = dashboardDesigner;
         const { visiblePreviewBox, previewItem } = this.state;
         const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption));
@@ -105,7 +105,7 @@ class ViewLayout extends React.PureComponent {
                 {(children.length === 0) ? <div key='default-chartview' className='default-chartview' data-grid={{ x: 0, y: 0, w: 12, h: 2, minW: 12, maxW: 12, minH: 2, maxH: 2, static: true }}>
                     <div className='tip'>
                         <Icon type="message" theme="outlined" />
-                        {(isOwner && !isShareView) ? <span>请从左侧选择图表/富文本添加到看板</span> : <span>无图表元素</span>}
+                        {(isOwner && !isShareView && !isShareKeyView) ? <span>请从左侧选择图表/富文本添加到看板</span> : <span>无图表元素</span>}
                     </div>
                 </div> : children}
             </ReactGridLayout>