Browse Source

图表阈值设置

zhuth 6 years ago
parent
commit
28d57608ed

+ 3 - 1
src/components/common/navigator.jsx

@@ -44,7 +44,9 @@ class Navigator extends React.Component {
         return <div className='navigator'>
             <div className='navigator-left'>
                 {/* <img src='../../../static/images/uas.png' alt='LOGO'/> */}
-                <div className='logo'></div>
+                <div className='logo' style={{ cursor: 'pointer' }} onClick={() => {
+                    dispatch({ type: 'main/redirect', path: '/home' });
+                }}></div>
             </div>
             <div className='navigator-content'>
                 {(currentUser.role === 'admin' || currentUser.role === 'superAdmin') && <Menu

+ 1 - 1
src/components/dashboardDesigner/layout.less

@@ -32,7 +32,7 @@
                         overflow-x: hidden;
                         >.dashboard-viewcontent {
                             flex: 1;
-                            margin: 8px;
+                            // margin: 8px;
                         }
                     }
                     >.config-sider {

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

@@ -131,7 +131,7 @@ class ViewLayout extends React.PureComponent {
                 width={ contentSize.width ? contentSize.width : lastContentSize.width }
                 autoSize={true}
                 cols={12}
-                margin = {editMode ? [2, 2] : [0, 0]}
+                margin = {editMode ? [12, 12] : [12, 12]}
                 rowHeight = {50}
                 isDraggable={editMode && !editingKey}
                 isResizable={editMode && !editingKey}

+ 2 - 1
src/components/homePage/index.jsx

@@ -5,6 +5,7 @@ import MenuLayout from './sider'
 import DashboardViewToolbar from './toolbar'
 import DashboardView from './view'
 import EmptyContent from '../common/emptyContent/index'
+import CusIcon from '../common/cusIcon/index'
 import './index.less'
 const { Sider, Content } = Layout
 const TabPane = Tabs.TabPane
@@ -18,7 +19,7 @@ class Home extends React.Component {
         return tabs.map(t => (
             // TODO 右键关闭菜单,会报错,先不启用
             // <TabPane tab={this.generateTabTitle(t.name, t.code)} key={t.code}>
-            <TabPane tab={t.name} key={t.code}>
+            <TabPane tab={<span><CusIcon type='bi-dashboard'/>{t.name}</span>} key={t.code}>
                 <DashboardViewToolbar />
                 <DashboardView code={t.code} config={t.config}/>
             </TabPane>

+ 9 - 3
src/components/homePage/index.less

@@ -12,11 +12,17 @@
         background: @content-background-color;
         &>.ant-tabs {
             height: 100%;
-            padding-top: 56px;
+            padding-top: 48px;
             &>.ant-tabs-bar {
-                height: 40px;
-                margin: -40px 16px 0;
+                height: 32px;
+                margin: -32px 16px 0;
                 border: none;
+                .ant-tabs-nav-wrap {
+                    .ant-tabs-tab {
+                        height: 32px;
+                        line-height: 32px;
+                    }
+                }
             }
             &>.ant-tabs-content {
                 height: 100%;

+ 1 - 0
src/components/homePage/toolbar.less

@@ -3,6 +3,7 @@
     justify-content: flex-end;
     width: 100%;
     border-top: 1px solid @border-color-base;
+    border-bottom: 1px solid @border-color-base;
     &>.toos {
         display: flex;
         margin-right: 16px;

+ 1 - 1
src/models/chart.js

@@ -294,8 +294,8 @@ export default {
                         })
                     }
                     yield put({ type: 'chartDesigner/silentChangeFields', fields: fields });
-                    
                     yield put({ type: 'chartDesigner/silentChangeDataSource', dataSource: data.baseConfig.dataSource });
+                    yield put({ type: 'chartDesigner/fetchChartData' });
                 }else {
                     message.error('解析图表错误: ' + (res.err || res.data.msg));
                 }

+ 2 - 12
src/models/chartDesigner.js

@@ -53,9 +53,9 @@ export default {
             baseConfig: { dataSource: { code: '' }, viewType: '' },
             aggregateTableConfig: { targetColumn: {}, statistics: [], groupBy: [] },
             dataViewConfig: { viewColumns: [], sortColumn: {key: ''}, sortType: 'asc' },
-            barConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, groupBy: {key:''}, threshold: 1000 },
+            barConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, groupBy: {key:''}, threshold: 20 },
             lineConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, groupBy: {key:''}, threshold: 1000 },
-            pieConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, threshold: 1000 },
+            pieConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, threshold: 20 },
             scatterConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, groupBy: {key:''}, threshold: 1000 },
             styleConfig: { visibleIndex: true },
             otherConfig:{},
@@ -132,11 +132,6 @@ export default {
         *silentChangeField(action, { select, call, put }) {
             const { name, value } = action;
             yield put({ type: 'silentSetField', name, value });
-
-            const { autoRefresh } = action;
-            if(autoRefresh === undefined ? true : autoRefresh) {
-                yield put({ type: 'fetchChartData' });
-            }
         },
         *changeFields(action, { select, call, put }) {
             const { fields } = action;
@@ -150,11 +145,6 @@ export default {
         *silentChangeFields(action, { select, call, put }) {
             const { fields } = action;
             yield put({ type: 'silentSetFields', fields });
-
-            const { autoRefresh } = action;
-            if(autoRefresh === undefined ? true : autoRefresh) {
-                yield put({ type: 'fetchChartData' });
-            }
         },
         *changeDataSource(action, { select, call, put }) {
             const { dataSource } = action;

+ 1 - 0
src/models/parseChartOption.js

@@ -133,6 +133,7 @@ function pieOption(data, pieConfig) {
                 type: 'pie',
                 // radius : '55%',
                 // center: ['50%', '60%'],
+                // data: (data.serieses || [{ value: [] }])[0].value,
                 data: (data.serieses || [{ value: [] }])[0].value.map(v => ({ ...v, name: v.name || '空' })),
                 itemStyle: {
                     emphasis: {

+ 20 - 0
src/themes/default/dashboarddesigner.less

@@ -36,6 +36,26 @@
                         }
                     }
                     &>.viewlayout {
+                        >.ant-layout-header {
+                            >.filters {
+
+                            }
+                        }
+                        >.dashboard-viewcontent {
+                            >.react-grid-layout {
+                                >.chartview {
+                                    box-shadow: 0 0 4px 0 rgba(0,0,0,0.10);
+                                    >.chartview-toolbar {
+                                        >.chart-title {
+                                            color: #408DC6;
+                                        }
+                                    }
+                                    >.chartview-content {
+
+                                    }
+                                }
+                            }
+                        }
                     }
                 }
             }