Browse Source

消息提示框组件字段调整

zhuth 7 years ago
parent
commit
9b4b17b16b

+ 3 - 0
kanban-client/README.md

@@ -74,6 +74,9 @@ columns[i].rowStyle---------------指定列数据列样式
 * 添加pie图图例垂直排布时根据宽度自动换行逻辑
 ##### 20180530
 * 看板多画面展示接口调整
+##### 20180611
+* 消息提示框字段调整
+
 #### 已知小bug
 * 多模板看板第一次进入需要多等待一个刷新时才会切换到下一个模板。
 * 如果看板第一个模板返回报错则后续正确模板也将无法显示。

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

@@ -6,7 +6,7 @@ import { converter } from './converter.js';
 import URL from '../constants/url.dev.json';
 import 'whatwg-fetch';
 
-import tempdata from '../data/bug.json';
+import tempdata from '../data/testtable.json';
 
 class Factory extends React.Component {
 
@@ -44,12 +44,12 @@ class Factory extends React.Component {
                 throw {message: '该看板内容为空'}
             }
             me.setState({
-                error: null,
+                msg: null,
                 model: converter(modelconfig),
             });
         }).catch(function (ex) {
             me.setState({
-                error: {message: ex.message}
+                msg: {name: 'Error', message: ex.message}
             });
             console.log('parsing failed', ex);
         });
@@ -153,9 +153,9 @@ class Factory extends React.Component {
     }
 
     render() {
-        let { titleHeight, model, error } = this.state;
-        if (this.state.error) {
-            return <MessageBox static={this.props.static} titleHeight={titleHeight} error={error} />
+        let { titleHeight, model, msg } = this.state;
+        if (msg) {
+            return <MessageBox static={this.props.static} titleHeight={titleHeight} msg={msg} />
         }
         if (!this.state.model) {
             return <div style={{color: 'white'}}>loading...</div>

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

@@ -41,12 +41,12 @@ class Factory extends React.Component {
                 throw {message: '该看板内容为空'}
             }
             me.setState({
-                error: null,
+                msg: null,
                 model: converter(modelconfig),
             });
         }).catch(function (ex) {
             me.setState({
-                error: {message: ex.message}
+                msg: {name: 'Error', message: ex.message}
             });
             console.log('parsing failed', ex);
         });
@@ -134,9 +134,9 @@ class Factory extends React.Component {
     }
 
     render() {
-        let { titleHeight, model, error } = this.state;
-        if (this.state.error) {
-            return <MessageBox static={this.props.static} titleHeight={titleHeight} error={error} />
+        let { titleHeight, model, msg } = this.state;
+        if (msg) {
+            return <MessageBox static={this.props.static} titleHeight={titleHeight} msg={msg} />
         }
         if (!this.state.model) {
             return <div style={{color: 'white'}}>loading...</div>

+ 3 - 4
kanban-client/app/data/testbar.json

@@ -17,20 +17,19 @@
                 },
                 "type": "bar",
                 "config": {
-                    "xfields": "[null, 王五, 张三, TEST0821, 晓兰, EMR01, 陈梦, 吴雨骁, 粟宇, 周兵, TX03, lptest, 黄俊, 陈炜, 赵六, 龙震坤, 测试人员, 刘萌冰, 卫立煌, 廖耀湘, 张玲萍, 李剑辉, 史晨如, 黄信, 詹国胜, 群, 熊志新, 陈庆之, 张文, 刘娇, 顾群2, 测试0103, EMR02, 张荣, 余慧, 陈劲松, 吴雨骁test, 黎旦阳, 陈虎, 顾群, 杨若楠, 陈金金, 易紫燕, USER0005, 龙晓兰, 李四, 国胜, 祝通鸿test, 徐健, TEST115, 王成雍]",
+                    "xfields": "[null, 王五, 张三, TEST0821, 晓兰, EMR01, 陈梦, 吴雨骁, 粟宇, 周兵, TX03, lptest, 黄俊, 陈炜, 赵六, 龙震坤, 测试人员, 刘萌冰, 卫立煌, 廖耀湘, 张玲萍, 李剑辉, 史晨如, 黄信, 詹国胜, 群, 熊志新, 陈庆之, 张文, 刘娇, 顾群2, 测试0103, EMR02, 张荣, 余慧, 陈劲松, 吴雨骁test, 黎旦阳, 陈虎, 顾群, 杨若楠]",
                     "xtype": "category",
                     "color": "[\"#CC99FF\",\"#FF0000\",\"#0000FF\",\"#99CC00\"]",
                     "yconfig": "{\"position\":\"left\",\"nameLocation\":\"middle\"}",
                     "title": "BAR标题",
                     "ytype": "numeric",
-                    "areaconfig": "{\"left\":\"11\"}",
                     "xconfig": "{\"position\":\"bottom\"}",
                     "ytitle": "数量",
                     "series": [{
-                        "data": [9, 4, 4, 0, 0, 1, 0, 1, 2, 2, 0, 0, 7, 1, 8, 0, 1, 0, 5, 5, 9, 0, 0, 5, 0, 1, 0, 5, 3, 1, 0, 0, 2, 0, 0, 0, 1, 5, 0, 1, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0],
+                        "data": [9, 4, 4, 0, 0, 1, 0, 1, 2, 2, 0, 0, 7, 1, 8, 0, 1, 0, 5, 5, 9, 0, 0, 5, 0, 1, 0, 5, 3, 1, 0, 0, 2, 0, 0, 0, 1, 5, 0, 1, 0],
                         "name": "已启动"
                     }, {
-                        "data": [0, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 0, 9, 1, 5, 2, 0, 1, 1, 1, 2, 1, 0, 2, 10, 3, 1, 2, 1, 3, 1, 0, 0, 1, 1, 1, 0, 1, 5, 2, 1, 0, 4, 1, 1, 0, 2, 0, 0, 0, 1],
+                        "data": [0, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 0, 9, 1, 5, 2, 0, 1, 1, 1, 2, 1, 0, 2, 10, 3, 1, 2, 1, 3, 1, 0, 0, 1, 1, 1, 0, 1, 5, 2, 1],
                         "name": "未启动"
                     }],
                     "subtitle": "假装写个副标题",

+ 14 - 13
kanban-client/app/data/testform.json

@@ -5,34 +5,35 @@
                 "items": [
                     {
                         "layout": {
-                            "w": 100,
-                            "h": 100,
+                            "w": 60,
+                            "h": 50,
                             "y": 0,
                             "x": 0
                         },
                         "config": {
                             "data": [
                                 {
-                                    "field": { "text": "公", "style": "{\"color\": \"red\"}"},
-                                    "value": { "text": "1000"},
-                                    "width": 100
+                                    "field": { "text": "红烧茄子", "style": "{\"color\": \"red\", \"textAlign\": \"center\"}"},
+                                    "value": { "text": "¥18", "style": "{\"color\": \"red\", \"textAlign\": \"center\"}"}
                                 },
                                 {
-                                    "field": { "text": "公"},
-                                    "value": { "text": "告"}
+                                    "field": { "text": "清蒸鲈鱼", "style": {"textAlign": "center"}},
+                                    "value": { "text": "¥58", "style": {"textAlign": "center"}}
                                 },
                                 {
-                                    "field": { "text": "公"},
-                                    "value": { "text": "告"}
+                                    "field": { "text": "麻婆豆腐", "style": {"textAlign": "center"}},
+                                    "value": { "text": "¥8", "style": {"textAlign": "center"}},
+                                    "fill": true
                                 },
                                 {
-                                    "field": { "text": "公"},
-                                    "value": { "text": "告"}
+                                    "field": { "text": "麻辣鸡丁", "style": {"textAlign": "center"}},
+                                    "value": { "text": "¥35", "style": {"textAlign": "center"}}
                                 }
                             ],
-                            "columns": 4,
+                            "columns": 2,
+                            "fieldstyle": "{\"textAlign\": \"center\"}",
                             "header": {
-                                "text": "xxx当日排行", 
+                                "text": "今日特价", 
                                 "style": "{\"color\": \"green\",\"border\": \"1px solid white\"}"
                             }
                             

+ 1 - 0
kanban-client/app/data/testline.json

@@ -17,6 +17,7 @@
                 },
                 "type": "line",
                 "config": {
+                    "title": "折线图",
                     "xfields": "[null, 王五, 张三, TEST0821, 晓兰, EMR01, 陈梦, 吴雨骁, 粟宇, 周兵, TX03, lptest, 黄俊, 陈炜, 赵六, 龙震坤, 测试人员, 刘萌冰, 卫立煌, 廖耀湘, 张玲萍, 李剑辉, 史晨如, 黄信, 詹国胜, 群, 熊志新, 陈庆之, 张文, 刘娇, 顾群2, 测试0103, EMR02, 张荣, 余慧, 陈劲松, 吴雨骁test, 黎旦阳, 陈虎, 顾群, 杨若楠, 陈金金, 易紫燕, USER0005, 龙晓兰, 李四, 国胜, 祝通鸿test, 徐健, TEST115, 王成雍]",
                     "xtype": "category",
                     "color": "[]",

+ 2 - 2
kanban-client/app/data/testpie.json

@@ -5,8 +5,8 @@
                 "items": [
                     {
                         "layout": {
-                            "w": 50,
-                            "h": 50,
+                            "w": 100,
+                            "h": 100,
                             "y": 0,
                             "x": 0
                         },

+ 140 - 319
kanban-client/app/data/testtable.json

@@ -12,325 +12,146 @@
                         },
                         "type": "table",
                         "config": {
-                            "data": [
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 0
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 1
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 2
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 3
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 4
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 5
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 6
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 7
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 8
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 9
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 10
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 11
-                                },
-                                {
-                                    "时段": "8~9",
-                                    "投入数": 12
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 13
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 14
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 15
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 16
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 17
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 18
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 19
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 20
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 21
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 22
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 23
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 24
-                                },
-                                {
-                                    "时段": "9~10",
-                                    "投入数": 25
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 26
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 27
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 28
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 29
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 30
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 31
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 32
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 33
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 34
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 35
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 36
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 37
-                                },
-                                {
-                                    "时段": "10~11",
-                                    "投入数": 38
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 39
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 40
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 41
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 42
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 43
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 44
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 45
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 46
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 47
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 48
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 49
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 50
-                                },
-                                {
-                                    "时段": "11~12",
-                                    "投入数": 51
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 52
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 53
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 54
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 55
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 56
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 57
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 58
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 59
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 60
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 61
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 62
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 63
-                                },
-                                {
-                                    "时段": "上午",
-                                    "投入数": 64
-                                },
-                                {
-                                    "时段": "12~13",
-                                    "投入数": 65
-                                },
-                                {
-                                    "时段": "12~13",
-                                    "投入数": 66
-                                }
-                            ],
-                            "columns": [
-                                {
-                                    "dataIndex": "时段",
-                                    "width": 100,
-                                    "sort": 0,
-                                    "title": "时段"
-                                },
-                                {
-                                    "dataIndex": "计划数",
-                                    "width": 100,
-                                    "sort": 0,
-                                    "title": "计划数"
-                                },
-                                {
-                                    "dataIndex": "投入数",
-                                    "width": 100,
-                                    "sort": 0,
-                                    "title": "投入数",
-                                    "render": "function(value,record,index){;if(value>200){return{children:value,props:{style:{\"color\":\"#99CC00\"}}}}else{return{children:value,props:{style:{}}}}}"
-                                },
-                                {
-                                    "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": 0,
-                            "interval": 0,
-                            "title": {},
-                            "headerrowsstyle": "{\"color\":\"#FFFF00\"}"
+                            "title": {"text": "车间执行看板"},
+                            "pagesize": 10,
+                            "data": [{
+                                "时段": "8~9",
+                                "达成率": "78%",
+                                "投入数": 208,
+                                "良品产出": 156,
+                                "不良数": 8,
+                                "计划数": 200,
+                                "直通率": "96.2%"
+                            }, {
+                                "时段": "9~10",
+                                "达成率": "85%",
+                                "投入数": 366,
+                                "良品产出": 169,
+                                "不良数": 7,
+                                "计划数": 200,
+                                "直通率": "98.1%"
+                            }, {
+                                "时段": "10~11",
+                                "达成率": "42%",
+                                "投入数": 367,
+                                "良品产出": 76,
+                                "不良数": 15,
+                                "计划数": 180,
+                                "直通率": "95.9%"
+                            }, {
+                                "时段": "11~12",
+                                "达成率": "129%",
+                                "投入数": 399,
+                                "良品产出": 129,
+                                "不良数": 0,
+                                "计划数": 100,
+                                "直通率": "100%"
+                            }, {
+                                "时段": "上午",
+                                "达成率": "78%",
+                                "投入数": 1340,
+                                "良品产出": 530,
+                                "不良数": 30,
+                                "计划数": 680,
+                                "直通率": "97.8%"
+                            }, {
+                                "时段": "12~13",
+                                "达成率": "77%",
+                                "投入数": 211,
+                                "良品产出": 77,
+                                "不良数": 10,
+                                "计划数": 100,
+                                "直通率": "95.3%"
+                            }, {
+                                "时段": "13~14",
+                                "达成率": "96%",
+                                "投入数": 345,
+                                "良品产出": 192,
+                                "不良数": 20,
+                                "计划数": 200,
+                                "直通率": "94.2%"
+                            }, {
+                                "时段": "14~15",
+                                "达成率": "70%",
+                                "投入数": 268,
+                                "良品产出": 140,
+                                "不良数": 0,
+                                "计划数": 200,
+                                "直通率": "100%"
+                            }, {
+                                "时段": "15~16",
+                                "达成率": "87%",
+                                "投入数": 313,
+                                "良品产出": 157,
+                                "不良数": 13,
+                                "计划数": 180,
+                                "直通率": "95.8%"
+                            }, {
+                                "时段": "16~17",
+                                "达成率": "51%",
+                                "投入数": 73,
+                                "良品产出": 27,
+                                "不良数": 1,
+                                "计划数": 53,
+                                "直通率": "98.6%"
+                            }, {
+                                "时段": "下午",
+                                "达成率": "81%",
+                                "投入数": 1210,
+                                "良品产出": 593,
+                                "不良数": 44,
+                                "计划数": 680,
+                                "直通率": "96.4%"
+                            }, {
+                                "时段": "当天",
+                                "达成率": "79%",
+                                "投入数": 2550,
+                                "良品产出": 1123,
+                                "不良数": 74,
+                                "计划数": 1413,
+                                "直通率": "97.1%"
+                            }],
+                            "columns": [{
+                                "title": "时段",
+                                "sort": 0,
+                                "width": 100,
+                                "dataIndex": "时段"
+                            }, {
+                                "title": "计划数",
+                                "sort": -1,
+                                "width": 100,
+                                "dataIndex": "计划数"
+                            }, {
+                                "title": "投入数",
+                                "sort": -1,
+                                "width": 100,
+                                "dataIndex": "投入数"
+                            }, {
+                                "title": "完成数",
+                                "sort": 0,
+                                "width": 100,
+                                "dataIndex": "良品产出"
+                            }, {
+                                "title": "不良数",
+                                "sort": 0,
+                                "width": 100,
+                                "dataIndex": "不良数"
+                            }, {
+                                "title": "达成率",
+                                "sort": 0,
+                                "dataIndex": "达成率",
+                                "render": "function(value,record,index) {   value = value ? value+'' : ''; var num = Number(value.replace('%', '')); ;if(num<100){return{children:value,props:{style:{\"color\":\"#FF0000\"}}}}  else{return{children:value,props:{style:{\"color\":\"#00FF00\"}}}}}"
+                            }, {
+                                "title": "一次直通率",
+                                "sort": 0,
+                                "width": 120,
+                                "dataIndex": "直通率"
+                            }, {
+                                "title": "备注",
+                                "sort": 0,
+                                "width": 100,
+                                "dataIndex": "备注"
+                            }]
                         }
                     }
                 ]

File diff suppressed because it is too large
+ 0 - 0
kanban-client/app/lib/echarts.min.js


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

@@ -29,7 +29,7 @@ if (!window.Promise) {
 	window.Promise = Promise;  
 }  
 
-var code = 'A64E4730611';
+var code = 'A73B24B0233';
 var index = 0;
 
 ReactDOM.render(

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

@@ -34,11 +34,11 @@ export default class MessageBox extends React.Component {
     }
 
     render() {
-        const { error, prefixCls} = this.state;
-        let { name, message } = error;
+        const { msg, prefixCls} = this.state;
+        let { name, message } = msg;
         return (
             <div className={prefixCls} key='msgbox'>
-               <div className={`${prefixCls}-title`}>{'Error'}</div>
+               <div className={`${prefixCls}-title`}>{name}</div>
                <div className={`${prefixCls}-content`}>{`${message}`}</div>
             </div>
         );

Some files were not shown because too many files changed in this diff