|
@@ -6,6 +6,7 @@ import { connect } from 'dva'
|
|
|
import ChartView from './chartView'
|
|
import ChartView from './chartView'
|
|
|
import EmptyContent from '../common/emptyContent/index'
|
|
import EmptyContent from '../common/emptyContent/index'
|
|
|
import DataPreview from '../common/dataPreview/dataPreview'
|
|
import DataPreview from '../common/dataPreview/dataPreview'
|
|
|
|
|
+import themes from '../chartDesigner/sections/style/theme/index'
|
|
|
|
|
|
|
|
class ViewLayout extends React.PureComponent {
|
|
class ViewLayout extends React.PureComponent {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
@@ -44,12 +45,14 @@ class ViewLayout extends React.PureComponent {
|
|
|
const { dispatch, main, dashboardDesigner } = this.props;
|
|
const { dispatch, main, dashboardDesigner } = this.props;
|
|
|
const { editingKey, richTextReadOnly } = this.state;
|
|
const { editingKey, richTextReadOnly } = this.state;
|
|
|
const { currentUser } = main;
|
|
const { currentUser } = main;
|
|
|
- const { dashboardDesignerCode, editMode, minLayoutHeight } = dashboardDesigner;
|
|
|
|
|
|
|
+ const { dashboardDesignerCode, editMode, minLayoutHeight, theme: themeName } = dashboardDesigner;
|
|
|
const { code, name, viewType, layout, chartCode, chartOption } = item;
|
|
const { code, name, viewType, layout, chartCode, chartOption } = item;
|
|
|
const iconCls = editMode ? 'visible-icon' : '';
|
|
const iconCls = editMode ? 'visible-icon' : '';
|
|
|
|
|
|
|
|
|
|
+ let t = themes.find(t => t.name === themeName);
|
|
|
|
|
+ let theme = t ? t.config : themes[0].config;
|
|
|
return (
|
|
return (
|
|
|
- <div className={`chartview${ isPreview ? ' chartview-preview' : (editMode ? ' chartview-edit' : '')}`} key={code} data-grid={layout}>
|
|
|
|
|
|
|
+ <div className={`chartview${ isPreview ? ' chartview-preview' : (editMode ? ' chartview-edit' : '')}`} key={code} data-grid={layout} style={{ backgroundColor: theme.base.backgroundColor }}>
|
|
|
<div className='chartview-toolbar mover'>
|
|
<div className='chartview-toolbar mover'>
|
|
|
<div className='chart-title'>
|
|
<div className='chart-title'>
|
|
|
{editingKey && editingKey === code ? <Input width={200} ref={node => this['inputRef-' + code] = node} defaultValue={name} onBlur={(e) => {
|
|
{editingKey && editingKey === code ? <Input width={200} ref={node => this['inputRef-' + code] = node} defaultValue={name} onBlur={(e) => {
|
|
@@ -157,6 +160,7 @@ class ViewLayout extends React.PureComponent {
|
|
|
const { editMode, minLayoutHeight, layoutMargin } = dashboardDesigner;
|
|
const { editMode, minLayoutHeight, layoutMargin } = dashboardDesigner;
|
|
|
const { visiblePreviewBox, previewItem } = this.state;
|
|
const { visiblePreviewBox, previewItem } = this.state;
|
|
|
const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption));
|
|
const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption));
|
|
|
|
|
+
|
|
|
return (<div className='dashboard-viewcontent' ref={node => this.viewContentRef = node}>
|
|
return (<div className='dashboard-viewcontent' ref={node => this.viewContentRef = node}>
|
|
|
<ReactGridLayout
|
|
<ReactGridLayout
|
|
|
width={ contentSize.width ? contentSize.width : lastContentSize.width }
|
|
width={ contentSize.width ? contentSize.width : lastContentSize.width }
|