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

调整展示看板数组变量

zhuth 9 лет назад
Родитель
Сommit
a2cc12f8ab

+ 2 - 0
kanban-client/README.md

@@ -62,6 +62,8 @@ columns[i].rowStyle---------------指定列数据列样式
 * 解决模板内容为空报错问题
 ##### 20171021
 * 接口地址调整
+##### 20171023
+* 看板数组变量调整
 
 #### 已知小bug
 * 多模板看板第一次进入需要多等待一个刷新时才会切换到下一个模板。

+ 1 - 1
kanban-client/app/component/converter.js

@@ -89,7 +89,7 @@ function tableConfig(model) {
                 if(v){
                     v.key = i;
                 }
-                return v;
+                return v || {};
             }) : [],
             headerRowsStyle: parseStyleStr(headerrowsstyle),
             rowsStyle: parseStyleStr(rowsstyle),

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

@@ -5,7 +5,7 @@ import MessageBox from '../src/MsgBox/MessageBox.jsx';
 import { converter } from './converter.js';
 import URL from '../constants/url.dev.json';
 
-import tempdata from '../data/typeError.json';
+import tempdata from '../data/cc.json';
 
 class Factory extends React.Component {
 
@@ -64,7 +64,7 @@ class Factory extends React.Component {
     setRefresh() {
         let { instance } = this.state;
         if (!instance) { return; }
-        let codes = instance.templateCodes;
+        let codes = instance.enabledKanbanCodes;
         let display = instance.display;
         let next = {
             enable: instance.switchFrequency > 0 ? true : false,

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

@@ -58,7 +58,7 @@ class Factory extends React.Component {
     setRefresh() {
         let { instance } = this.state;
         if (!instance) { return; }
-        let codes = instance.templateCodes;
+        let codes = instance.enabledKanbanCodes;
         let display = instance.display;
         let next = {
             enable: instance.switchFrequency > 0 ? true : false,

+ 415 - 266
kanban-client/app/data/cc.json

@@ -1,280 +1,429 @@
 {
-    
-    "data":[{
-    "content": {
-        "title": "<b><i><u><font size=\"6\" color=\"#ff9900\">'已启动'fasdf</font></u></i></b>",
-        "items": [
+    "instance": {
+        "enabledKanbanCodes": [
+            "5E2EE434A1E",
+            "5E31084F223"
+        ],
+        "display": "AutoSwitch",
+        "switchFrequency": 30,
+        "refreshFrequency": 5,
+        "parameters": [
             {
-                "type": "pie",
-                "config": {
-                    "title": "{maintitle}",
-                    "subtitle": "{subtitle}",
-                    "series": [
-                        {"name": "字段0", "data": 33},
-                        {"name": "字段1", "data": 37},
-                        {"name": "字段2", "data": 28}
-                    ]
-            
-                },
-                "layout": {
-                    "x": 0,
-                    "y": 0,
-                    "w": 50,
-                    "h": 50
-                }
+                "code": "5E3289D9E2B",
+                "createTime": 1508485926302,
+                "inputMode": "DropDownBox",
+                "lastModified": 1508554096085,
+                "name": "新参数",
+                "optionalValues": [
+                    "1",
+                    "2",
+                    "3"
+                ],
+                "panelCode": "5DE18FCEF14",
+                "type": "String",
+                "value": "1",
+                "version": 2
             },
             {
-                "type": "bar",
-                "config": {
-                    "title": "bartitle",
-                    "subtitle": "barsub",
-                    "xtitle": "X-name",
-                    "xtype": "category",
-                    "xfields": [
-                        "字段1",
-                        "字段2",
-                        "字段3"
-                    ],
-                    "ytitle": "Y-name",
-                    "ytype": "numeric",
-                    "yfields": "",
-                    "series": [
-                        {
-                            "name": "数据组1",
-                            "data": [
-                                12,
-                                48,
-                                32
-                            ]
+                "code": "5F116284611",
+                "createTime": 1508719597630,
+                "inputMode": "DropDownBox",
+                "lastModified": 1508719597630,
+                "name": "线别",
+                "optionalValues": [
+                    "SMT"
+                ],
+                "panelCode": "5DE18FCEF14",
+                "type": "String",
+                "value": "SMT",
+                "version": 1
+            }
+        ]
+    },
+    "data": [
+        {
+            "content": {
+                "items": [
+                    {
+                        "layout": {
+                            "w": 40,
+                            "x": 0,
+                            "h": 57,
+                            "y": 0
                         },
-                        {
-                            "name": "数据组2",
+                        "type": "form",
+                        "config": {
+                            "valueStyle": "color: blue",
                             "data": [
-                                24,
-                                66,
-                                49
-                            ]
+                                {
+                                    "field": {
+                                        "text": "组长"
+                                    },
+                                    "value": {
+                                        "text": "余海文"
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "PE"
+                                    },
+                                    "value": {
+                                        "text": "黄伟平"
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "机动"
+                                    },
+                                    "value": {
+                                        "text": "何伟文"
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "IPQC"
+                                    },
+                                    "value": {
+                                        "text": "张晓辉"
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "当前产量"
+                                    },
+                                    "width": 100,
+                                    "value": {
+                                        "style": "color: red",
+                                        "text": 0
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "计划产量"
+                                    },
+                                    "width": 100,
+                                    "value": {
+                                        "style": "color: red",
+                                        "text": 0
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "计划达成率"
+                                    },
+                                    "width": 100,
+                                    "value": {
+                                        "style": "color: red",
+                                        "text": 0
+                                    }
+                                },
+                                {
+                                    "field": {
+                                        "text": "直通率"
+                                    },
+                                    "width": 100,
+                                    "value": {
+                                        "style": "color: red",
+                                        "text": 0
+                                    }
+                                }
+                            ],
+                            "columns": 2
                         }
-                    ]
-                },
-                "layout": {
-                    "x": 50,
-                    "y": 50,
-                    "w": 50,
-                    "h": 50
-                }
-            },
-            {
-                "type": "line",
-                "config": {
-                    "fontSize": 10,
-                    "title": "linetitle",
-                    "subtitle": "linesub",
-                    "xtitle": "X-name",
-                    "xtype": "category",
-                    "xfields": [
-                        "字段1",
-                        "字段2",
-                        "字段3"
-                    ],
-                    "ytitle": "Y-name",
-                    "ytype": "numeric",
-                    "yfields": "",
-                    "series": [
-                        {
-                            "name": "数据组1",
-                            "data": [
-                                12,
-                                48,
-                                32
-                            ]
+                    },
+                    {
+                        "layout": {
+                            "w": 40,
+                            "x": 0,
+                            "h": 43,
+                            "y": 57
                         },
-                        {
-                            "name": "数据组2",
+                        "type": "table",
+                        "config": {
                             "data": [
-                                24,
-                                66,
-                                49
-                            ]
-                        }
-                    ]
-                },
-                "layout": {
-                    "x": 0,
-                    "y": 50,
-                    "w": 50,
-                    "h": 50
-                }
-            },
-            {
-                "type": "table",
-                "config": {
-                    "rowHeight": 100,
-                    "columns": [
-                        {
-                            "title": "时段",
-                            "width": 150,
-                            "dataIndex": "time"
-                        },
-                        {
-                            "title": "计划数",
-                            "dataIndex": "plan"
-                        },
-                        {
-                            "title": "投入数",
-                            "dataIndex": "input"
-                        },
-                        {
-                            "title": "送检数",
-                            "dataIndex": "check"
-                        },
-                        {
-                            "title": "包装数",
-                            "dataIndex": "pack"
-                        },
-                        {
-                            "title": "达成率",
-                            "dataIndex": "success",
-                            "render": "rateRender"
-                        },
-                        {
-                            "title": "备注",
-                            "dataIndex": "desc",
-                            "render": "descRender"
+                                null,
+                                null,
+                                null,
+                                null,
+                                null
+                            ],
+                            "columns": [
+                                {
+                                    "width": 100,
+                                    "sort": 0,
+                                    "title": "前五大不良"
+                                },
+                                {
+                                    "width": 100,
+                                    "sort": 0,
+                                    "title": "数量"
+                                },
+                                {
+                                    "width": 100,
+                                    "sort": 0,
+                                    "title": "原因"
+                                }
+                            ],
+                            "pagesize": 5,
+                            "interval": 3
                         }
-                    ],
-                    "data": [
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "11"
-                        },
-                        {
-                            "key": "2",
-                            "time": "9-10",
-                            "plan": "200",
-                            "input": "200",
-                            "check": "200",
-                            "pack": "0",
-                            "success": "100%",
-                            "desc": "10"
-                        },
-                        {
-                            "key": "3",
-                            "time": "10-11",
-                            "plan": "200",
-                            "input": "203",
-                            "check": "400",
-                            "pack": "0",
-                            "success": "120%",
-                            "desc": "9"
-                        },
-                        {
-                            "key": "4",
-                            "time": "11-12",
-                            "plan": "",
-                            "input": "",
-                            "check": "",
-                            "pack": "",
-                            "success": "",
-                            "desc": "8"
-                        },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "7"
-                        },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "6"
+                    },
+                    {
+                        "layout": {
+                            "w": 60,
+                            "x": 40,
+                            "h": 100,
+                            "y": 0
                         },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "5"
-                        },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "4"
-                        },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "3"
-                        },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "2"
-                        },
-                        {
-                            "key": "1",
-                            "time": "8-9",
-                            "plan": "150",
-                            "input": "160",
-                            "check": "100",
-                            "pack": "0",
-                            "success": "70%",
-                            "desc": "1"
+                        "type": "table",
+                        "config": {
+                            "data": [
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 142
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 7
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "8~9",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 1067
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 793
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 2026
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 7
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 17
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "上午",
+                                    "投入数": 1654
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "下午"
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 2026
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 1067
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 793
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 17
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 7
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 1654
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 0
+                                },
+                                {
+                                    "时段": "当天",
+                                    "投入数": 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
                         }
-                    ],
-                    "render": "tableRender"
-                },
-                "layout": {
-                    "x": 50,
-                    "y": 0,
-                    "w": 50,
-                    "h": 50
-                }
+                    }
+                ]
             }
-        ]
-    }
-}
-],
-"instance": {
-    "templateCodes": [
-        "506CFE6D911"
-    ],
-    "switchFrequency": 5000,
-    "display": "AutoSwitch",
-    "refreshFrequency": 5000
-}
-
+        }
+    ]
 }

+ 1 - 1
kanban-client/app/main.dev.js

@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
 import Factory from './component/factory.dev.js';
 import DateFormatter from './utils/DateTimeUtils.js';
 
-var code = '5B9B3019436';
+var code = '5F26ADA961D';
 
 ReactDOM.render(
     <Factory code={[code]} />,