Просмотр исходного кода

修改echarts主题引用方式,title支持文本展示

zhuth 8 лет назад
Родитель
Сommit
3957a63384

+ 6 - 0
kanban-client/app/component/Tabel.jsx

@@ -391,6 +391,12 @@ class TableModel extends React.Component {
 			$el.stop();
 		}
 	}
+	componentWillReceiveProps(nextProps) {
+		this.setState({
+			columns: nextProps.columns,
+			data: nextProps.data
+		});
+  	}
 	getBodyWrapper(body) {
 		return (
 			<Animate transitionName="fade" component="tbody" className={body.props.className}

+ 0 - 1
kanban-client/app/component/factory.js

@@ -1,7 +1,6 @@
 import React from 'react';
 import Container from '../../app/component/Layout.js';
 import Title from '../../src/Title/Title.jsx';
-import Charts from '../../src/Charts/ECharts.js';
 import DateFormatter from '../utils/DateTimeUtils.js';
 
 // 模拟动态数据

+ 2 - 2
kanban-client/app/css/layoutStyle.css

@@ -51,7 +51,7 @@
   width: 100%;
 }
 .react-grid-layout {
-  background: #eee;
+  background: #2f2e2c;
 }
 .layoutJSON {
   background: #ddd;
@@ -75,7 +75,7 @@
   opacity: 0.9;
 }
 .react-grid-item.static {
-  background: #cce;
+  background: #2f2e2c;
 }
 .react-grid-item .text {
   font-size: 24px;

+ 0 - 4
kanban-client/app/data/BoardConfig.json

@@ -23,8 +23,6 @@
             },
             "legend": {
                 "right": "3%",
-                "orient": "vertical",
-                "show": true,
                 "data": [
                     {"name": "直通率"}, 
                     {"name": "收益率"}
@@ -105,9 +103,7 @@
               }
           },
           "legend": {
-            "top": "12%",
             "right": "3%",
-            "orient": "vertical",
             "data": [
               {"name": "投入"},
               {"name": "产出"}

+ 0 - 4
kanban-client/app/data/BoardConfig2.json

@@ -19,8 +19,6 @@
             },
             "legend": {
                 "right": "3%",
-                "orient": "vertical",
-                "show": true,
                 "data": [
                     {"name": "直通率"}, 
                     {"name": "收益率"}
@@ -101,9 +99,7 @@
               }
           },
           "legend": {
-            "top": "12%",
             "right": "3%",
-            "orient": "vertical",
             "data": [
               {"name": "投入"},
               {"name": "产出"}

+ 34 - 0
kanban-client/app/data/TableData2.json

@@ -0,0 +1,34 @@
+[{
+    "key": "1",
+    "time": "下午",
+    "inplan": 400,
+    "trs": 120,
+    "ccs": 98,
+    "cys": 62,
+    "dcl": "75.2%",
+    "ztl": "23.3%",
+    "syl": "45.4%",
+    "desc": "不好"
+},{
+    "key": "2",
+    "time": "上午",
+    "inplan": 199,
+    "trs": 48,
+    "ccs": 188,
+    "cys": 9,
+    "dcl": "75.2%",
+    "ztl": "50.3%",
+    "syl": "73.4%",
+    "desc": "良好"
+},{
+    "key": "3",
+    "time": "上午",
+    "inplan": 250,
+    "trs": 77,
+    "ccs": 122,
+    "cys": 62,
+    "dcl": "78.2%",
+    "ztl": "50.3%",
+    "syl": "73.4%",
+    "desc": "良好"
+}]

+ 1 - 1
kanban-client/src/Charts/ECharts.js

@@ -2,7 +2,7 @@ import React, { Component } from 'react';
 import RenderUtils from '../../app/utils/RenderUtils.js';
 // 导入echarts
 import ReactEcharts from 'echarts-for-react';
-import './dark.js';
+import {dark} from './Theme/Theme.js';
 
 export class ReactEchart extends React.Component {
     constructor(props) {

+ 3 - 0
kanban-client/src/Charts/Theme/Theme.js

@@ -0,0 +1,3 @@
+import dark from './dark.js';
+
+export {dark};

+ 1 - 1
kanban-client/src/Charts/dark.js → kanban-client/src/Charts/Theme/dark.js

@@ -39,7 +39,7 @@
             },
             splitLine: {
                 lineStyle: {
-                    type: 'dashed',
+                    type: 'solid',
                     color: '#aaa'
                 }
             },

+ 1 - 1
kanban-client/src/Title/Title.jsx

@@ -44,7 +44,7 @@ export default class Title extends React.Component {
     if (renders[title]) {
       tel = renders[title](this.props.state);
     }else {
-      tel = title;
+      tel = <div style={{height: 55, color: 'white', textAlign: 'center'}}>{title}</div>;
     }
     if (tel) {
       return tel;