bklLiudl
2024-07-23 7850733bb718cb91be15449261d0134f59903c4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
var StoreChartManager = {
    Server: function (URL, data, callback) {
        $.gitAjax({
            url: URL,
            data: data,
            type: "post",
            dataType: "json",
            success: function (result) {
                callback(result);
            }
        });
    },
    ToolBar: function () {
        StoreChartManager.Chart1();
        StoreChartManager.Chart2();
 
        var searchBar = $("div[data-condition='search']");
        searchBar.find("a[data-command='search']").click(function () {
            StoreChartManager.Chart1();
            StoreChartManager.Chart2();
        });
    },
    AutoOrders: function () {
 
        var searchBar = $("div[data-condition='search']");
        var LRow = searchBar.find("select[name='Pai']").val();
              
        if (Number(LRow) + 1 > 2) {
            $("#Pai").find("option[value='1']").attr("selected", true);
        } else {
 
            $("#Pai").find("option[value='" + (Number(LRow) + 1).toString() + "']").attr("selected", true);
        }
 
        StoreChartManager.Chart1();
        StoreChartManager.Chart2();
    },
    Chart1: function () {
        var myChart = echarts.init(document.getElementById('main'));
 
        var searchBar = $("div[data-condition='search']");
        var LRow = searchBar.find("select[name='Pai']").val();
 
 
        var lie = ['1', '2', '3', '4', '5', '6', '7',
            '8', '9', '10', '11', '12', '13', '14', '15', '16', '17',
            '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28','29'];
        if (LRow == "2") {
            lie = ['1', '2', '3', '4', '5', '6', '7',
                '8', '9', '10', '11', '12', '13', '14', '15', '16', '17',
                '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
                '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42','43'];
        } else
        {
            lie = ['1', '2', '3', '4', '5', '6', '7',
                '8', '9', '10', '11', '12', '13', '14', '15', '16', '17',
                '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29'];
        }
 
        var ceng = ['1', '2', '3'];
        var searchBar = $("div[data-condition='search']");
        var Pai = searchBar.find("select[name='Pai']").val();
 
        StoreChartManager.Server('/Data/SChartAjax/GetList', { aaa: Pai }, function (result) {
            if (result != null) {
                if (result.Code == 1) {
                    var str = result.Result;
                    var newdata = eval(str);
                    //var newdata = [[0,0,1]];
                    option = {
                        title: {
                            show: true,
                            text: "\n"+Pai + "排库位图表",
                            left: 'center'
                        },
                        //grid: {
                        //    show: true,
                        //    backgroundColor:'red'
                        //    //left: '5%',
                        //    //top: '10%'
                        //},
                        xAxis: {
                            type: 'category',
                            data: lie,
                            name: "列",
                            boundaryGap: true,
                            splitArea: {
                                show: true,
                                lineStyle: {
                                    color: '#999'
                                }
                            },
                            splitLine: {
                                show: true,
                                //interval: '0',
                                lineStyle: {
                                    width: 0,
                                    color: ['black'],
                                    type: 'dashed',
                                    opacity:1
                                }
                            },
                            minorTick: {
                                show: true
                            }
                        },
                        yAxis: {
                            type: 'category',
                            data: ceng,
                            name: '层',
                            boundaryGap: true,
                            splitArea: {
                                show: true
                            },
                            splitLine: {
                                show: true,
                                //interval: '0',                          // 显示所有线条
                                lineStyle: {
                                    width: 0,                           // 线条宽度
                                    color: ['black'],                    // 线条颜色
                                    type: 'dashed',                     // 虚线
                                    opacity: 1
                                }
                            }
                        },
                        visualMap: {
                            type: 'piecewise',
                            splitNumber: 4,
                            right: 10,
                            bottom: 100,
                            align: 'left',
                            pieces: [
                                { value: 1, label: '空库位', color:'rgb(84, 112, 198)' },/*, color: 'grey' */
                                { value: 2, label: '合格', color:'rgb(145, 204, 117)'},
                                { value: 3, label: '待入库', color:'rgb(255, 220, 96)' },
                                { value: 4, label: '待出库', color: 'rgb(238, 102, 102)' },
                                { value: 5, label: '空托盘', color: 'rgb(202, 231, 240)' }
                            ]
                        },
                        series: {
                            type: 'heatmap',
                            left: 0,
                            data: newdata
                        }
                    };
                    myChart.setOption(option);
                    
                } else {
                    $.jBox.tip(result.Message, "warn");
                }
            }
        });
    },
    Chart2: function () {
        var myCharts = echarts.init(document.getElementById('mains'));
        StoreChartManager.Server('/Data/SChartAjax/GetCharts', { aaa: "aa" }, function (result) {
            if (result != null) {
                obj = eval(result.Result);
 
                if (result.Code == 1) {
                    options = {
                        title: {
                            text: '\n立体库使用图表',
                            left: 'center'
                        },
                        tooltip: {
                            trigger: 'item',
                            //formatter: '{a} <br/>{b} : {c}  ({d}%)'
                            formatter: '{a} <br/>{b} ({d}%)'
                        },
                        series: [
                            {
                                name: '立体仓库:',
                                type: 'pie',
                                radius: '60%',
                                center: ['50%', '60%'],
                                bottom: 100,
                                data: obj,
                                emphasis: {
                                    itemStyle: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }
                        ]
                    };
                    myCharts.setOption(options)
 
                } else {
                    $.jBox.tip(result.Message, "warn");
                }
            }
        }); 
    }
}