浏览代码

调整form、table的title定义格式/错误信息展示不展示详细信息

zhuth 8 年之前
父节点
当前提交
c4502c8f03

+ 7 - 20
kanban-client/app/component/converter.js

@@ -51,11 +51,12 @@ function formConfig(model) {
         d.render = renderFunction(d.render);
         return d;
     });
+    header.style = parseStyleStr(header.style || '{}');
     let c = {
         type: 'form',
         config: {
             fontSize: fontSize || getFontSize(),
-            header: renderFunction(header),
+            header: header,
             fieldStyle: parseStyleStr(fieldStyle),
             valueStyle: parseStyleStr(valueStyle),
             columns,
@@ -73,18 +74,20 @@ function tableConfig(model) {
     columns = columns ? ( ( columns instanceof Array ) ? columns : [columns] ) : [];
     columns.map((c, i) => allWidth += (c.width || 100));
     data = data ? ( ( data instanceof Array ) ? data : [data] ) : [];
+    title.style = parseStyleStr(title.style || '{}');
     return {
         type: 'table',
         config: {
             fontSize: fontSize || getFontSize(),
             pageSize: pagesize,
             refreshInterval: interval,
-            title: renderFunction(title),
+            title: title,
             render: renderFunction(render),
             columns: columns.map( (v, i) => {
                 v.key = i;
                 v.width ? v.width = getScreenSize().width * (layout.w/100) * (v.width/ allWidth) : '';
                 v.render = renderFunction(v.render);
+                v.headerRowStyle = parseStyleStr(v.headerrowstyle);
                 v.rowStyle = parseStyleStr(v.rowstyle);
                 return v;
             }),
@@ -409,25 +412,9 @@ function parseStyleStr(str) {
     }
     if (typeof str == 'object') {
         return str;
+    }else {
+        return JSON.parse(str);
     }
-    str = str + '';
-    // str = str.replace(/\s+/g, "");
-    let arr = str.split(';');
-    let objArr = arr.map(function (v, i) {
-        let arr = v.split(':');
-        let obj = {};
-        obj[arr[0]] = arr[1];
-        return obj
-    });
-    let obj = {};
-    objArr.map(function (v, i) {
-        for (let k in v) {
-            if (k) {
-                obj[k] = v[k]
-            }
-        }
-    });
-    return obj
 }
 
 function replaceSpecTag(str) {

+ 13 - 11
kanban-client/app/component/factory.dev.js

@@ -5,17 +5,18 @@ import MessageBox from '../src/MsgBox/MessageBox.jsx';
 import { converter } from './converter.js';
 import URL from '../constants/url.dev.json';
 
-import tempdata from '../data/cc.json';
+import tempdata from '../data/ceshi.json';
 
 class Factory extends React.Component {
 
     constructor(props) {
         super(props);
-        this.dev = 'local ';
+        this.dev = 'local';
         this.index = 0;
         this.state = {
             titleHeight: 0,
-            error: null
+            error: null,
+            firstRequestTime: new Date()
         };
         window.forceUpdate = this.forceUpdate.bind(this);
     }
@@ -25,25 +26,23 @@ class Factory extends React.Component {
         fetch(URL.path + mid, {
             method: 'POST',
             credentials: 'include',
-            mode: 'no-cors',
-            headers: { 'X-Requested-With': 'XMLHttpRequest' }
         }).then(function (response) {
             return (response.json())
         }).then((json) => {
             if(!json.instance) {
-                var errorObj = json.message.split(':');
-                throw {name: errorObj[0], message: errorObj[1] || ''};
+                throw {message: json.message};
             }
             let instance = json.instance;
             if (!me.state.instance) {
                 me.setState({
-                    instance: instance
+                    instance: instance,
+                    lastRequestTime: new Date()
                 }, me.setRefresh);
             }
             return json.data[0];
         }).then(function (modelconfig) {
             if(!modelconfig.content) {
-                throw {name: 'empty board model', message: '该看板内容为空'}
+                throw {message: '该看板内容为空'}
             }
             me.setState({
                 error: null,
@@ -52,7 +51,7 @@ class Factory extends React.Component {
             });
         }).catch(function (ex) {
             me.setState({
-                error: {name: ex.name, message: ex.message}
+                error: {message: ex.message}
             });
             console.log('parsing failed', ex);
         });
@@ -169,9 +168,12 @@ class Factory extends React.Component {
         if (fixedbox) {
             items = fixedbox.items || [];
         }
+
+        const staticC = {
+        }
         return (
             <div ref='body'>
-                <Title static={this.props.static} setTitleHeight={this.setTitleHeight.bind(this)} {...titleConfig} />
+                <Title static={staticC} setTitleHeight={this.setTitleHeight.bind(this)} {...titleConfig} />
                 <Container static={this.props.static} items={content.items} rowHeight={(window.innerHeight - titleHeight) / 10} />
             </div>
         );

+ 5 - 2
kanban-client/app/component/factory.js

@@ -26,7 +26,7 @@ class Factory extends React.Component {
             return (response.json())
         }).then((json) => {
             if(!json.instance) {
-                throw {name: json.message, message: json.detailedMessage};
+                throw {message: json.message};
             }
             let instance = json.instance;
             if (!me.state.instance) {
@@ -36,13 +36,16 @@ class Factory extends React.Component {
             }
             return json.data[0];
         }).then(function (modelconfig) {
+            if(!modelconfig.content) {
+                throw {message: '该看板内容为空'}
+            }
             me.setState({
                 error: null,
                 model: converter(modelconfig),
             });
         }).catch(function (ex) {
             me.setState({
-                error: {name: ex.name, message: ex.message}
+                error: {message: ex.message}
             });
             console.log('parsing failed', ex);
         });

+ 0 - 192
kanban-client/app/data/FormConfig.json

@@ -1,192 +0,0 @@
-{
-    "Title": {
-        "key": "title",
-        "title": "titleRender",
-        "state":{"time1": 0,"time2": 3}
-    },
-    "Form": {
-        "key": "form",
-        "header": "当天投入产出统计",
-        "fieldStyle": {
-            "h" : 1
-        },
-        "valueStyle": {
-            "color": "red"
-        },
-        "columns": 2,
-        "data": [
-            {"field": "生产机型", "value": "MPD-H003"},
-            {"field": "直通率", "value": "98.2%"},
-            {"field": "总投入", "value": {"text": "159", "style": {"color": "blue"}}},
-            {"field": "收益率", "value": "94.6%"},
-            {"field": {"text": "总产出"}, "value": "110"},
-            {"field": "故障数", "value": "7"}
-        ]
-    },
-    "Table": {
-        "key": "table",
-        "columns": [
-            {
-                "title": "时段",
-                "dataIndex": "time",
-                "key": "time"
-            },
-            {
-                "title": "计划数",
-                "dataIndex": "inplan",
-                "sort": 1,
-                "key": "inplan"
-            },
-            {
-                "title": "投入数",
-                "dataIndex": "trs",
-                "key": "trs"
-            },
-            {
-                "title": "产出数",
-                "dataIndex": "ccs",
-                "key": "ccs"
-            },
-            {
-                "title": "差异数",
-                "dataIndex": "cys",
-                "key": "cys"
-            },
-            {
-                "title": "达成率%",
-                "dataIndex": "dcl",
-                "key": "dcl"
-            },
-            {
-                "title": "直通率%",
-                "dataIndex": "ztl",
-                "key": "ztl"
-            },
-            {
-                "title": "收益率%",
-                "dataIndex": "syl",
-                "key": "syl"
-            },
-            {
-                "title": "备注",
-                "dataIndex": "desc",
-                "key": "desc",
-                "render": "descRender"
-            }
-        ],
-        "data": [{
-            "key": "_1",
-            "time": "上午",
-            "inplan": 400,
-            "trs": 200,
-            "ccs": 98,
-            "cys": 62,
-            "dcl": "75.2%",
-            "ztl": "23.3%",
-            "syl": "45.4%",
-            "desc": "良好"
-        },{
-            "key": "_2",
-            "time": "上午",
-            "inplan": 199,
-            "trs": 45,
-            "ccs": 188,
-            "cys": 9,
-            "dcl": "75.2%",
-            "ztl": "50.3%",
-            "syl": "73.4%",
-            "desc": "良好"
-        },{
-            "key": "_3",
-            "time": "上午",
-            "inplan": 250,
-            "trs": 77,
-            "ccs": 188,
-            "cys": 62,
-            "dcl": "78.2%",
-            "ztl": "50.3%",
-            "syl": "73.4%",
-            "desc": "良好"
-        }]
-    },
-    "Charts": {
-        "option": {
-          "title":{
-            "show": true,
-            "text": "投入/产出柱状图\nInput/outPut Histogram",
-            "textAlign": "center",
-            "left": "50%",
-            "right": "50%"
-          },
-          "color": ["#6395EC", "#FFFE03"],
-          "tooltip" : {
-              "trigger": "axis",
-              "axisPointer" : {            
-                  "type" : "shadow"       
-              }
-          },
-          "legend": {
-            "top": "3%",
-            "right": "3%",
-            "orient": "vertical",
-            "data": [
-              {"name": "投入"},
-              {"name": "产出"}
-            ]
-          },
-          "grid": {
-              "left": "3%",
-              "right": "4%",
-              "bottom": "3%",
-              "containLabel": true
-          },
-          "xAxis" : [
-              {
-                  "type" : "category",
-                  "data" : ["08:00~08:59", "09:00~09:59", "10:00~10:59"],
-                  "axisTick": {
-                      "alignWithLabel": true
-                  }
-              }
-          ],
-          "yAxis" : [
-              {
-                  "type" : "value"
-              }
-          ],
-          "series" : [
-              {
-                  "name":"投入",
-                  "type":"bar",
-                  "label": {
-                    "normal": {
-                      "show": true,
-                      "position": "top",
-                      "formatter": "{c}",
-                      "textStyle": {
-                        "color": "white"
-                      }
-                    }
-                  },
-                  "data":[64,87,12]
-              },
-                {
-                  "name":"产出",
-                  "type":"bar",
-                  "label": {
-                    "normal": {
-                      "show": true,
-                      "position": "top",
-                      "formatter": "{c}",
-                      "textStyle": {
-                        "color": "white"
-                      }
-                    }
-                  },
-                  "barGap": 0,
-                  "data":[32,71,11]
-              }
-          ]
-      }
-    }
-}

+ 0 - 49
kanban-client/app/data/TableColumns.json

@@ -1,49 +0,0 @@
-[
-    {
-        "title": "时段",
-        "dataIndex": "time",
-        "key": "time"
-    },
-    {
-        "title": "计划数",
-        "dataIndex": "inplan",
-        "sort": 1,
-        "key": "inplan"
-    },
-    {
-        "title": "投入数",
-        "dataIndex": "trs",
-        "key": "trs"
-    },
-    {
-        "title": "产出数",
-        "dataIndex": "ccs",
-        "key": "ccs"
-    },
-    {
-        "title": "差异数",
-        "dataIndex": "cys",
-        "key": "cys"
-    },
-    {
-        "title": "达成率%",
-        "dataIndex": "dcl",
-        "key": "dcl"
-    },
-    {
-        "title": "直通率%",
-        "dataIndex": "ztl",
-        "key": "ztl"
-    },
-    {
-        "title": "收益率%",
-        "dataIndex": "syl",
-        "key": "syl"
-    },
-    {
-        "title": "备注",
-        "dataIndex": "desc",
-        "key": "desc",
-        "render": "descRender"
-    }
-]

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

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

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

@@ -1,34 +0,0 @@
-[{
-    "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": "良好"
-}]

+ 19 - 274
kanban-client/app/data/cc.json

@@ -1,302 +1,47 @@
 {
     "instance": {
-        "enabledKanbanCodes": ["5DE01DE4D16"],
+        "enabledKanbanCodes": ["5FD2C0FAA12"],
         "display": "AutoSwitch",
         "switchFrequency": 10,
         "refreshFrequency": 5,
-        "parameters": [{
-            "code": "5E326742F2A",
-            "createTime": 1508485784623,
-            "inputMode": "DropDownBox",
-            "lastModified": 1508919901414,
-            "name": "线别",
-            "optionalValues": ["SMT"],
-            "panelCode": "5DE01C8DF14",
-            "type": "String",
-            "value": "SMT",
-            "version": 5
-        }, {
-            "code": "5FD06CEC511",
-            "createTime": 1508919918275,
-            "inputMode": "DropDownBox",
-            "lastModified": 1508919918275,
-            "name": "新参数",
-            "optionalValues": ["a"],
-            "panelCode": "5DE01C8DF14",
-            "type": "String",
-            "value": "a",
-            "version": 1
-        }]
+        "parameters": []
     },
     "data": [{
         "content": {
             "items": [{
                 "layout": {
-                    "w": 40,
+                    "w": 50,
                     "x": 0,
-                    "h": 57,
+                    "h": 50,
                     "y": 0
                 },
                 "type": "form",
                 "config": {
-                    "valueStyle": "color: blue",
-                    "data": {
-                        "field": {
-                            "text": "组长"
-                        },
-                        "value": {
-                            "text": "余海文"
-                        }
-                    },
                     "columns": 2
                 }
             }, {
                 "layout": {
-                    "w": 40,
-                    "x": 0,
-                    "h": 43,
-                    "y": 57
+                    "w": 50,
+                    "x": 50,
+                    "h": 50,
+                    "y": 0
                 },
                 "type": "table",
-                "config": {
-                    "data": {
-                        "前五大不良": "翘件"
-                    },
-                    "columns": null,
-                    "pagesize": 5,
-                    "interval": 3
-                }
+                "config": {}
             }, {
                 "layout": {
-                    "w": 60,
-                    "x": 40,
-                    "h": 100,
-                    "y": 0
+                    "w": 50,
+                    "x": 0,
+                    "h": 50,
+                    "y": 50
                 },
-                "type": "table",
+                "type": "bar",
                 "config": {
-                    "data": [{
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 47
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 1
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 1
-                    }, {
-                        "时段": "8~9",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 4
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "9~10",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 1
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 817
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 1
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "上午",
-                        "投入数": 0
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "下午"
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 817
-                    }, {
-                        "时段": "当天",
-                        "投入数": 1
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }, {
-                        "时段": "当天",
-                        "投入数": 1
-                    }, {
-                        "时段": "当天",
-                        "投入数": 0
-                    }],
-                    "columns": [{
-                        "dataIndex": "时段",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "时段"
-                    }, {
-                        "dataIndex": "计划数",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "计划数"
-                    }, {
-                        "dataIndex": "投入数",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "投入数"
-                    }, {
-                        "dataIndex": "送检数",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "送检数"
-                    }, {
-                        "dataIndex": "包装数",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "包装数"
-                    }, {
-                        "dataIndex": "达成率",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "达成率"
-                    }, {
-                        "dataIndex": "备注",
-                        "width": 100,
-                        "sort": 0,
-                        "title": "备注"
-                    }],
-                    "pagesize": 13,
-                    "interval": 7,
-                    "title": "function() { return { text: ''+ new Date().format('hh:mm:ss'), style: { float: 'left' } } }"
+                    "xfields": "刻度1,刻度2,刻度3",
+                    "ytitle": "Y-name",
+                    "xtype": "category",
+                    "xtitle": "X-name",
+                    "ytype": "numeric"
                 }
             }]
         }

+ 0 - 92
kanban-client/app/data/tempTableData.json

@@ -1,92 +0,0 @@
-{
-    "type": "table",
-    "config": {
-        "key": "table",
-        "columns": [
-            {
-                "title": "时段",
-                "dataIndex": "time",
-                "key": "time"
-            },
-            {
-                "title": "计划数",
-                "dataIndex": "inplan",
-                "sort": 1,
-                "key": "inplan"
-            },
-            {
-                "title": "投入数",
-                "dataIndex": "trs",
-                "key": "trs"
-            },
-            {
-                "title": "产出数",
-                "dataIndex": "ccs",
-                "key": "ccs"
-            },
-            {
-                "title": "差异数",
-                "dataIndex": "cys",
-                "key": "cys"
-            },
-            {
-                "title": "达成率%",
-                "dataIndex": "dcl",
-                "key": "dcl"
-            },
-            {
-                "title": "直通率%",
-                "dataIndex": "ztl",
-                "key": "ztl"
-            },
-            {
-                "title": "收益率%",
-                "dataIndex": "syl",
-                "key": "syl"
-            },
-            {
-                "title": "备注",
-                "dataIndex": "desc",
-                "key": "desc",
-                "render": "descRender"
-            }
-        ],
-        "data": [{
-            "key": "_1",
-            "time": "上午",
-            "inplan": 400,
-            "trs": 200,
-            "ccs": 98,
-            "cys": 62,
-            "dcl": "75.2%",
-            "ztl": "23.3%",
-            "syl": "45.4%",
-            "desc": "良好"
-        },{
-            "key": "_2",
-            "time": "上午",
-            "inplan": 199,
-            "trs": 45,
-            "ccs": 188,
-            "cys": 9,
-            "dcl": "75.2%",
-            "ztl": "50.3%",
-            "syl": "73.4%",
-            "desc": "良好"
-        },{
-            "key": "_3",
-            "time": "上午",
-            "inplan": 250,
-            "trs": 77,
-            "ccs": 188,
-            "cys": 62,
-            "dcl": "78.2%",
-            "ztl": "50.3%",
-            "syl": "73.4%",
-            "desc": "良好"
-        }]
-    },
-    "layout": {
-        "x": 0, "y": 5, "w": 10, "h": 5
-    }
-}

+ 13 - 13
kanban-client/app/data/testbar.json

@@ -4,7 +4,7 @@
             "content": {
                 "items": {
                     "layout": {
-                        "w": 80,
+                        "w": 100,
                         "h": 100,
                         "y": 0,
                         "x": 0
@@ -14,31 +14,31 @@
                             {
                                 "name": "已启动",
                                 "data": [
-                                    0,
-                                    2,
-                                    1,
-                                    0,
-                                    0
+                                    10,
+                                    12,
+                                    5,
+                                    9,
+                                    7
                                 ]
                             },
                             {
                                 "name": "未启动",
                                 "data": [
-                                    1,
+                                    6,
+                                    3,
                                     0,
-                                    0,
-                                    1,
-                                    1
+                                    2,
+                                    9
                                 ]
                             }
                         ],
-                        "title": "按负责人统计项目启动个数(柱状图)",
+                        "title": "按负责人统计项目启动个数",
                         "ytype": "numeric",
                         "xtitle": "项目负责人",
                         "xtype": "category",
-                        "subtitle": "柱状图",
+                        "subtitle": "模拟数据",
                         "ytitle": "项目数量统计",
-                        "xfields": "[顾群2, 顾群, 杨若楠, 陈金金, 陈虎]"
+                        "xfields": "[张飞, 关羽, 诸葛亮, 曹操, 刘禅]"
                     },
                     "type": "bar"
                 }

+ 7 - 2
kanban-client/app/data/testform.json

@@ -13,7 +13,7 @@
                         "config": {
                             "data": [
                                 {
-                                    "field": { "text": "公", "style": {"color": "red"}},
+                                    "field": { "text": "公", "style": "{'color': \"red\"}"},
                                     "value": { "text": "1000", "style": {"color": "red"}},
                                     "width": 100,
                                     "render": "function(f, v){var nv = v.text>900?'hah':v.text; return { field: f,value: {text: nv,style:v.style} }}"
@@ -31,7 +31,12 @@
                                     "value": { "text": "告", "style": {"color": "red"}}
                                 }
                             ],
-                            "columns": 4
+                            "columns": 4,
+                            "header": {
+                                "text": "xxx当日排行", 
+                                "style": "{\"color\": \"green\",\"border\": \"1px solid white\"}"
+                            }
+                            
                         },
                         "type": "form"
                     }

+ 29 - 29
kanban-client/app/data/testline.json

@@ -13,45 +13,45 @@
                         "config": {
                             "series": [
                                 {
-                                    "name": "已启动",
+                                    "name": "投入",
                                     "data": [
-                                        "",
-                                        2,
-                                        1,
-                                        0,
-                                        0,
-                                        0,
-                                        0,
-                                        0,
-                                        0,
-                                        0,
-                                        0
+                                        100.71,
+                                        130.52,
+                                        106.34,
+                                        188.67,
+                                        133.54,
+                                        200.43,
+                                        183.23,
+                                        190.22,
+                                        200.56,
+                                        170.04,
+                                        152.23
                                     ]
                                 },
                                 {
-                                    "name": "未启动",
+                                    "name": "产出",
                                     "data": [
-                                        1,
-                                        0,
-                                        0,
-                                        1,
-                                        2,
-                                        1,
-                                        2,
-                                        1,
-                                        0,
-                                        2,
-                                        1
+                                        320.32,
+                                        345.45,
+                                        200.08,
+                                        412.32,
+                                        401.11,
+                                        388.69,
+                                        375.01,
+                                        432.10,
+                                        333.78,
+                                        400.00,
+                                        393.45
                                     ]
                                 }
                             ],
-                            "title": "按负责人统计项目启动个数(拆线图)",
+                            "title": "XXX公司2017年投入产出折线图",
                             "ytype": "numeric",
-                            "xtitle": "项目负责人",
+                            "xtitle": "月份",
                             "xtype": "category",
-                            "subtitle": "拆线图",
-                            "ytitle": "项目数量统计",
-                            "xfields": "[TEST0821, null, 周兵, 刘萌冰, 詹国胜, 顾群2, 顾群, 杨若楠, 陈金金, 陈虎, USER0005]"
+                            "subtitle": "模拟数据",
+                            "ytitle": "金额/万",
+                            "xfields": "[一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月]"
                         },
                         "type": "line"
                     }

+ 3 - 3
kanban-client/app/data/testtable.json

@@ -6,7 +6,7 @@
                     {
                         "type": "table",
                         "config": {
-                            "pagesize": 5,
+                            "pagesize": 0,
                             "columns": [
                                 {
                                     "title": "时段",
@@ -152,8 +152,8 @@
                                     "desc": "1"
                                 }
                             ],
-                            "title": "function(){return {text: 'textAlign: left, height: 60, color: blue, fontSize: 16px', style: {textAlign: 'left', height: 60, color: 'blue', fontSize: '16px'}}}",
-                            "render": "function(value, record, index){return{children:value,props:{style:{color: 'white'}}}}"
+                            "title": "function(){return {text: 'textAlign: left, height: 60, color: blue, fontSize: 16px, border: 1px solid white', style: {textAlign: 'left', height: 60, 'color': 'blue', fontSize: '16px', border: '1px solid white'}}}",
+                            "render": "function(value,record,index){if(1==1){return{children:value,props:{style:{}}}}}"
                         },
                         "layout": {
                             "x": 0,

+ 4 - 4
kanban-client/app/src/Form/Form.jsx

@@ -15,7 +15,7 @@ export default class Form extends React.Component {
         prefixCls: PropTypes.string,
         cls: PropTypes.string,
         style: PropTypes.object,
-        header: PropTypes.func,
+        header: PropTypes.object,
         columns: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
     }
 
@@ -48,12 +48,12 @@ export default class Form extends React.Component {
         if (!header) {
             return;
         }
-        let helObj = header();
+        let helObj = header;
         Object.assign(helObj.style, { fontSize: fontSize });
         if (helObj) {
-            const headerEl = <thead style={helObj.style} className={`${prefixCls}-header`} key="form_header">
+            const headerEl = <thead className={`${prefixCls}-header`} key="form_header">
                 <tr>
-                    <td className={`${prefixCls}-header-content`} colSpan={'100%'}>{helObj.text}</td>
+                    <td className={`${prefixCls}-header-content`} style={helObj.style} colSpan={'100%'}>{helObj.text}</td>
                 </tr>
             </thead>;
             return headerEl;

+ 5 - 4
kanban-client/app/src/Form/FormItem.jsx

@@ -1,5 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
+import {isEmptyObject} from '../../utils/BaseUtils.js';
 
 export default class FormItem extends React.Component {
 
@@ -9,10 +10,10 @@ export default class FormItem extends React.Component {
           colSpan: props.colSpan,
           field: props.render ? props.render(props.field, props.value).field.text : (typeof props.field === 'object' ? props.field.text : props.field),
           fieldCls: (typeof props.field === 'object' ? (props.field.cls ? props.field.cls : props.fieldCls) : props.fieldCls),
-          fieldStyle: props.render ? props.render(props.field, props.value).field.style : (typeof props.field === 'object' ? (props.field.style ? props.field.style : props.fieldStyle) : props.fieldStyle),
+          fieldStyle: props.render ? props.render(props.field, props.value).field.style : (typeof props.field === 'object' ? (!isEmptyObject(props.field.style) ? props.field.style : props.fieldStyle) : props.fieldStyle),
           value: props.render ? props.render(props.field, props.value).value.text : (typeof props.value === 'object' ? props.value.text : props.value),
           valueCls: (typeof props.value === 'object' ? (props.value.cls ? props.value.cls : props.valueCls) : props.valueCls),
-          valueStyle: props.render ? props.render(props.field, props.value).value.style : (typeof props.value === 'object' ? (props.value.style ? props.value.style : props.valueStyle) : props.valueStyle),
+          valueStyle: props.render ? props.render(props.field, props.value).value.style : (typeof props.value === 'object' ? (!isEmptyObject(props.value.style) ? props.value.style : props.valueStyle) : props.valueStyle),
       };
   }
 
@@ -22,10 +23,10 @@ export default class FormItem extends React.Component {
           colSpan: nextProps.colSpan,
           field: nextProps.render ? nextProps.render(nextProps.field, nextProps.value).field.text : (typeof nextProps.field === 'object' ? nextProps.field.text : nextProps.field),
           fieldCls: (typeof nextProps.field === 'object' ? (nextProps.field.cls ? nextProps.field.cls : nextProps.fieldCls) : nextProps.fieldCls),
-          fieldStyle: nextProps.render ? nextProps.render(nextProps.field, nextProps.value).field.style : (typeof nextProps.field === 'object' ? (nextProps.field.style ? nextProps.field.style : nextProps.fieldStyle) : nextProps.fieldStyle),
+          fieldStyle: nextProps.render ? nextProps.render(nextProps.field, nextProps.value).field.style : (typeof nextProps.field === 'object' ? (isEmptyObject(nextProps.field.style) ? nextProps.fieldStyle : nextProps.field.style) : nextProps.fieldStyle),
           value: nextProps.render ? nextProps.render(nextProps.field, nextProps.value).value.text : (typeof nextProps.value === 'object' ? nextProps.value.text : nextProps.value),
           valueCls: (typeof nextProps.value === 'object' ? (nextProps.value.cls ? nextProps.value.cls : nextProps.valueCls) : nextProps.valueCls),
-          valueStyle: nextProps.render ? nextProps.render(nextProps.field, nextProps.value).value.style : (typeof nextProps.value === 'object' ? (nextProps.value.style ? nextProps.value.style : nextProps.valueStyle) : nextProps.valueStyle),
+          valueStyle: nextProps.render ? nextProps.render(nextProps.field, nextProps.value).value.style : (typeof nextProps.value === 'object' ? (isEmptyObject(nextProps.value.style) ? nextProps.valueStyle : nextProps.value.style) : nextProps.valueStyle),
 
       });
   }

+ 1 - 1
kanban-client/app/src/MsgBox/MessageBox.jsx

@@ -39,7 +39,7 @@ export default class MessageBox extends React.Component {
         return (
             <div className={prefixCls} key='msgbox'>
                <div className={`${prefixCls}-title`}>{'Error'}</div>
-               <div className={`${prefixCls}-content`}>{`${name}: ${message}`}</div>
+               <div className={`${prefixCls}-content`}>{`${message}`}</div>
             </div>
         );
     }

+ 4 - 3
kanban-client/app/src/Table/Table.jsx

@@ -8,6 +8,7 @@ import addEventListener from 'rc-util/lib/Dom/addEventListener';
 import ColumnManager from './ColumnManager.js';
 import createStore from './createStore.js';
 import classes from 'component-classes';
+import {isEmptyObject} from '../../utils/BaseUtils.js';
 
 export default class Table extends React.Component {
   static propTypes = {
@@ -33,7 +34,7 @@ export default class Table extends React.Component {
     onRowDoubleClick: PropTypes.func,
     expandIconColumnIndex: PropTypes.number,
     showHeader: PropTypes.bool,
-    title: PropTypes.func,
+    title: PropTypes.object,
     footer: PropTypes.func,
     emptyText: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
     scroll: PropTypes.object,
@@ -234,7 +235,7 @@ export default class Table extends React.Component {
         key: column.key,
         className: column.className || '',
         children: column.title,
-        style: column.headerRowStyle || this.props.headerRowsStyle || {}
+        style: isEmptyObject(column.headerRowStyle) ? (this.props.headerRowsStyle || {}) : column.headerRowStyle
       };
       if (column.children) {
         this.getHeaderRows(column.children, currentRow + 1, rows);
@@ -562,7 +563,7 @@ export default class Table extends React.Component {
     if (!title) {
       return;
     }
-    let telObj = title(this.props.state);
+    let telObj = title;
     if (telObj) {
       const titleEl = <div className={`${prefixCls}-title`} style={telObj.style} key="title">
         {telObj.text}

+ 1 - 1
kanban-client/app/src/Table/TableHeader.jsx

@@ -20,7 +20,7 @@ export default class TableHeader extends React.Component {
         {
           rows.map((row, index) => (
             <tr key={index} style={rowStyle}>
-              {row.map((cellProps, i) => <th {...cellProps} key={i} className={`${prefixCls}-header-item`}/>)}
+              {row.map((cellProps, i) => <th {...cellProps} key={i} className={`${prefixCls}-header-item`} style={cellProps.style} />)}
             </tr>
           ))
         }

+ 10 - 1
kanban-client/app/utils/BaseUtils.js

@@ -91,5 +91,14 @@ function isEqual(a,b){
     }
 }
 
+function isEmptyObject(model) {
+    var isEmpty = true;
+    for (var prop in model) {
+        isEmpty = false;
+        break;
+    }
+    return isEmpty;
+}
+
 
-export { sort, remove, isEqual};
+export { sort, remove, isEqual, isEmptyObject};